thirtyfour icon indicating copy to clipboard operation
thirtyfour copied to clipboard

Query finds nothing, even though WebDriver response is successful

Open flippette opened this issue 1 year ago • 0 comments

I'm trying to find this element which gets created by JavaScript a few seconds after the page loads:

<li
  class="MuiListItem-root MuiListItem-gutters MuiListItem-padding practice-exercises-list-item css-j4r5fq"
  data-testid="practiceExercisesListItem1"
></li>

I used this code:

info!("begin query for exercise");
let _exercise = dbg!(
    driver
        .query(By::Tag("li"))
        .with_class("practice-exercises-list-item")
        .wait(Duration::from_secs(10), Duration::from_secs(10))
        .any()
        .await?
);
And this appears in the logs (`RUST_LOG=trace cargo run`):
2024-12-10T10:12:41.930735Z  INFO giextract: begin query for exercise
2024-12-10T10:12:41.930768Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver request: POST session/ec6c33c0-165c-4b30-b5a4-ccbfe574a092/elements {"using":"css selector","value":"li"}
2024-12-10T10:12:41.930879Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: take? ("http", localhost:4444): expiration = Some(90s)
2024-12-10T10:12:41.930901Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: reuse idle connection for ("http", localhost:4444)
2024-12-10T10:12:41.932129Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: put; add idle connection for ("http", localhost:4444)
2024-12-10T10:12:41.932147Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: pooling idle connection for ("http", localhost:4444)
2024-12-10T10:12:41.932174Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver response: 200 {"value":[{"element-6066-11e4-a52e-4f735466cecf":"6b9b1709-290b-4486-a5b2-6a21ad5d3ffc"},{"element-6066-11e4-a52e-4f735466cecf":"1fa3bd2d-d102-415c-aa9e-6d4dcb2dd642"}]}
2024-12-10T10:12:41.932224Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver request: GET session/ec6c33c0-165c-4b30-b5a4-ccbfe574a092/element/6b9b1709-290b-4486-a5b2-6a21ad5d3ffc/attribute/class
2024-12-10T10:12:41.932294Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: take? ("http", localhost:4444): expiration = Some(90s)
2024-12-10T10:12:41.932307Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: reuse idle connection for ("http", localhost:4444)
2024-12-10T10:12:41.932959Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: put; add idle connection for ("http", localhost:4444)
2024-12-10T10:12:41.932976Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: pooling idle connection for ("http", localhost:4444)
2024-12-10T10:12:41.933003Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver response: 200 {"value":"MuiListItem-root MuiListItem-gutters MuiListItem-padding practice-type-list-item css-120b5pf"}
2024-12-10T10:12:41.933034Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver request: GET session/ec6c33c0-165c-4b30-b5a4-ccbfe574a092/element/1fa3bd2d-d102-415c-aa9e-6d4dcb2dd642/attribute/class
2024-12-10T10:12:41.933099Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: take? ("http", localhost:4444): expiration = Some(90s)
2024-12-10T10:12:41.933112Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: reuse idle connection for ("http", localhost:4444)
2024-12-10T10:12:41.933609Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: put; add idle connection for ("http", localhost:4444)
2024-12-10T10:12:41.933624Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: pooling idle connection for ("http", localhost:4444)
2024-12-10T10:12:41.933650Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver response: 200 {"value":"MuiListItem-root MuiListItem-gutters MuiListItem-padding practice-type-list-item css-120b5pf"}
2024-12-10T10:12:51.931902Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver request: POST session/ec6c33c0-165c-4b30-b5a4-ccbfe574a092/elements {"using":"css selector","value":"li"}
2024-12-10T10:12:51.932073Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: take? ("http", localhost:4444): expiration = Some(90s)
2024-12-10T10:12:51.932098Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: reuse idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.934523Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: put; add idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.934546Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: pooling idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.934590Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver response: 200 {"value":[{"element-6066-11e4-a52e-4f735466cecf":"6b9b1709-290b-4486-a5b2-6a21ad5d3ffc"},{"element-6066-11e4-a52e-4f735466cecf":"1fa3bd2d-d102-415c-aa9e-6d4dcb2dd642"},{"element-6066-11e4-a52e-4f735466cecf":"771495c4-5c8a-42b1-9cc5-0c1c5b4223ca"},{"element-6066-11e4-a52e-4f735466cecf":"ee2296da-cb00-4e6d-9dce-d2af2b2dc014"},{"element-6066-11e4-a52e-4f735466cecf":"e2080c38-8027-4332-ab7a-df26a551a42e"},{"element-6066-11e4-a52e-4f735466cecf":"658934a8-9638-4d87-bade-04aaf04e3e6a"},{"element-6066-11e4-a52e-4f735466cecf":"1de59d53-e5c6-407d-9f44-34b1825b1e28"},{"element-6066-11e4-a52e-4f735466cecf":"9f2d2abc-13ac-4740-827e-3f3127f75686"},{"element-6066-11e4-a52e-4f735466cecf":"f4d05378-8f28-43b2-b1f7-e9115bbe5f5b"},{"element-6066-11e4-a52e-4f735466cecf":"65e1b864-d769-4b16-913c-81297a211860"},{"element-6066-11e4-a52e-4f735466cecf":"133aa0bf-1676-4730-b77f-e51e5282b247"},{"element-6066-11e4-a52e-4f735466cecf":"e476185f-ba41-47ea-ba44-8200cec6bade"},{"element-6066-11e4-a52e-4f735466cecf":"84005995-928f-42ef-8d09-97c1150be970"}]}
2024-12-10T10:12:51.934693Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver request: GET session/ec6c33c0-165c-4b30-b5a4-ccbfe574a092/element/6b9b1709-290b-4486-a5b2-6a21ad5d3ffc/attribute/class
2024-12-10T10:12:51.934778Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: take? ("http", localhost:4444): expiration = Some(90s)
2024-12-10T10:12:51.934794Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: reuse idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.935563Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: put; add idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.935580Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: pooling idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.935606Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver response: 200 {"value":"MuiListItem-root MuiListItem-gutters MuiListItem-padding practice-type-list-item css-120b5pf"}
2024-12-10T10:12:51.935636Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver request: GET session/ec6c33c0-165c-4b30-b5a4-ccbfe574a092/element/1fa3bd2d-d102-415c-aa9e-6d4dcb2dd642/attribute/class
2024-12-10T10:12:51.935701Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: take? ("http", localhost:4444): expiration = Some(90s)
2024-12-10T10:12:51.935714Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: reuse idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.936254Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: put; add idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.936271Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: pooling idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.936297Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver response: 200 {"value":"MuiListItem-root MuiListItem-gutters MuiListItem-padding practice-type-list-item css-120b5pf"}
2024-12-10T10:12:51.936327Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver request: GET session/ec6c33c0-165c-4b30-b5a4-ccbfe574a092/element/771495c4-5c8a-42b1-9cc5-0c1c5b4223ca/attribute/class
2024-12-10T10:12:51.936398Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: take? ("http", localhost:4444): expiration = Some(90s)
2024-12-10T10:12:51.936411Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: reuse idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.937001Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: put; add idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.937017Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: pooling idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.937043Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver response: 200 {"value":"MuiListItem-root MuiListItem-gutters MuiListItem-padding practice-exercises-list-item css-j4r5fq"}
2024-12-10T10:12:51.937072Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver request: GET session/ec6c33c0-165c-4b30-b5a4-ccbfe574a092/element/ee2296da-cb00-4e6d-9dce-d2af2b2dc014/attribute/class
2024-12-10T10:12:51.937135Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: take? ("http", localhost:4444): expiration = Some(90s)
2024-12-10T10:12:51.937148Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: reuse idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.937608Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: put; add idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.937624Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: pooling idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.937650Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver response: 200 {"value":"MuiListItem-root MuiListItem-gutters MuiListItem-padding practice-exercises-list-item css-j4r5fq"}
2024-12-10T10:12:51.937678Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver request: GET session/ec6c33c0-165c-4b30-b5a4-ccbfe574a092/element/e2080c38-8027-4332-ab7a-df26a551a42e/attribute/class
2024-12-10T10:12:51.937741Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: take? ("http", localhost:4444): expiration = Some(90s)
2024-12-10T10:12:51.937753Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: reuse idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.938333Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: put; add idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.938356Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: pooling idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.938382Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver response: 200 {"value":"MuiListItem-root MuiListItem-gutters MuiListItem-padding practice-exercises-list-item css-j4r5fq"}
2024-12-10T10:12:51.938411Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver request: GET session/ec6c33c0-165c-4b30-b5a4-ccbfe574a092/element/658934a8-9638-4d87-bade-04aaf04e3e6a/attribute/class
2024-12-10T10:12:51.938473Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: take? ("http", localhost:4444): expiration = Some(90s)
2024-12-10T10:12:51.938486Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: reuse idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.938921Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: put; add idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.938937Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: pooling idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.938962Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver response: 200 {"value":"MuiListItem-root MuiListItem-gutters MuiListItem-padding practice-exercises-list-item css-j4r5fq"}
2024-12-10T10:12:51.938990Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver request: GET session/ec6c33c0-165c-4b30-b5a4-ccbfe574a092/element/1de59d53-e5c6-407d-9f44-34b1825b1e28/attribute/class
2024-12-10T10:12:51.939052Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: take? ("http", localhost:4444): expiration = Some(90s)
2024-12-10T10:12:51.939064Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: reuse idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.939492Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: put; add idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.939508Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: pooling idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.939534Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver response: 200 {"value":"MuiListItem-root MuiListItem-gutters MuiListItem-padding practice-exercises-list-item css-j4r5fq"}
2024-12-10T10:12:51.939562Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver request: GET session/ec6c33c0-165c-4b30-b5a4-ccbfe574a092/element/9f2d2abc-13ac-4740-827e-3f3127f75686/attribute/class
2024-12-10T10:12:51.939625Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: take? ("http", localhost:4444): expiration = Some(90s)
2024-12-10T10:12:51.939637Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: reuse idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.940096Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: put; add idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.940112Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: pooling idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.940138Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver response: 200 {"value":"MuiListItem-root MuiListItem-gutters MuiListItem-padding practice-exercises-list-item css-j4r5fq"}
2024-12-10T10:12:51.940166Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver request: GET session/ec6c33c0-165c-4b30-b5a4-ccbfe574a092/element/f4d05378-8f28-43b2-b1f7-e9115bbe5f5b/attribute/class
2024-12-10T10:12:51.940234Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: take? ("http", localhost:4444): expiration = Some(90s)
2024-12-10T10:12:51.940246Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: reuse idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.940727Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: put; add idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.940744Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: pooling idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.940769Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver response: 200 {"value":"MuiListItem-root MuiListItem-gutters MuiListItem-padding practice-exercises-list-item css-j4r5fq"}
2024-12-10T10:12:51.940798Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver request: GET session/ec6c33c0-165c-4b30-b5a4-ccbfe574a092/element/65e1b864-d769-4b16-913c-81297a211860/attribute/class
2024-12-10T10:12:51.940861Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: take? ("http", localhost:4444): expiration = Some(90s)
2024-12-10T10:12:51.940874Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: reuse idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.941582Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: put; add idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.941598Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: pooling idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.941624Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver response: 200 {"value":"MuiListItem-root MuiListItem-gutters MuiListItem-padding practice-exercises-list-item css-j4r5fq"}
2024-12-10T10:12:51.941652Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver request: GET session/ec6c33c0-165c-4b30-b5a4-ccbfe574a092/element/133aa0bf-1676-4730-b77f-e51e5282b247/attribute/class
2024-12-10T10:12:51.941715Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: take? ("http", localhost:4444): expiration = Some(90s)
2024-12-10T10:12:51.941728Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: reuse idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.942179Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: put; add idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.942195Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: pooling idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.942224Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver response: 200 {"value":"MuiListItem-root MuiListItem-gutters MuiListItem-padding practice-exercises-list-item css-j4r5fq"}
2024-12-10T10:12:51.942253Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver request: GET session/ec6c33c0-165c-4b30-b5a4-ccbfe574a092/element/e476185f-ba41-47ea-ba44-8200cec6bade/attribute/class
2024-12-10T10:12:51.942315Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: take? ("http", localhost:4444): expiration = Some(90s)
2024-12-10T10:12:51.942328Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: reuse idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.942758Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: put; add idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.942774Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: pooling idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.942800Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver response: 200 {"value":"MuiListItem-root MuiListItem-gutters MuiListItem-padding practice-exercises-list-item css-j4r5fq"}
2024-12-10T10:12:51.942828Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver request: GET session/ec6c33c0-165c-4b30-b5a4-ccbfe574a092/element/84005995-928f-42ef-8d09-97c1150be970/attribute/class
2024-12-10T10:12:51.942890Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: take? ("http", localhost:4444): expiration = Some(90s)
2024-12-10T10:12:51.942903Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: reuse idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.943418Z TRACE run_webdriver_cmd: hyper_util::client::legacy::pool: put; add idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.943434Z DEBUG run_webdriver_cmd: hyper_util::client::legacy::pool: pooling idle connection for ("http", localhost:4444)
2024-12-10T10:12:51.943459Z DEBUG run_webdriver_cmd: thirtyfour::session::http: webdriver response: 200 {"value":"MuiListItem-root MuiListItem-gutters MuiListItem-padding practice-exercises-list-item css-j4r5fq"}
[src/main.rs:145:21] driver.query(By::Tag("li")).with_class("practice-exercises-list-item").wait(Duration::from_secs(10),
Duration::from_secs(10)).any().await? = []

Even though the WebDriver server gives a successful response, the Rust call returns nothing.

flippette avatar Dec 10 '24 10:12 flippette