question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Elements take too long to be located

See original GitHub issue

My element takes approx. ~10s to be located

2020-07-14 15:45:32:191 - [HTTP] --> POST /wd/hub/session/ae17c3f8-3ea8-49a8-ae75-072afc9eb49f/element
2020-07-14 15:45:32:191 - [HTTP] {"using":"id","value":"notification_container"}
2020-07-14 15:45:32:191 - [debug] [W3C (ae17c3f8)] Calling AppiumDriver.findElement() with args: ["id","notification_container","ae17c3f8-3ea8-49a8-ae75-072afc9eb49f"]
2020-07-14 15:45:32:192 - [debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
2020-07-14 15:45:32:192 - [debug] [BaseDriver] Waiting up to 0 ms for condition
2020-07-14 15:45:32:192 - [debug] [WD Proxy] Matched '/element' to command name 'findElement'
2020-07-14 15:45:32:192 - [debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8200/wd/hub/session/6a96693b-f410-49d8-8a46-9736c88bfae9/element] with body: {"strategy":"id","selector":"notification_container","context":"","multiple":false}
2020-07-14 15:45:42:367 - [debug] [WD Proxy] Got response with status 200: {"sessionId":"6a96693b-f410-49d8-8a46-9736c88bfae9","value":{"ELEMENT":"afdb98f3-cc81-4628-86fd-302e25ad3a79","element-6066-11e4-a52e-4f735466cecf":"afdb98f3-cc81-4628-86fd-302e25ad3a79"}}
2020-07-14 15:45:42:367 - [debug] [W3C (ae17c3f8)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"afdb98f3-cc81-4628-86fd-302e25ad3a79","ELEMENT":"afdb98f3-cc81-4628-86fd-302e25ad3a79"}
2020-07-14 15:45:42:368 - [HTTP] <-- POST /wd/hub/session/ae17c3f8-3ea8-49a8-ae75-072afc9eb49f/element 200 10177 ms - 137

But the same element sometimes takes only millisecs to be located

2020-07-14 14:44:55:399 - [HTTP] --> POST /wd/hub/session/7533ddaa-150d-4f69-88ae-bc5ea67fa38a/element
2020-07-14 14:44:55:400 - [HTTP] {"using":"id","value":"notification_container"}
2020-07-14 14:44:55:400 - [debug] [W3C (7533ddaa)] Calling AppiumDriver.findElement() with args: ["id","notification_container","7533ddaa-150d-4f69-88ae-bc5ea67fa38a"]
2020-07-14 14:44:55:400 - [debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
2020-07-14 14:44:55:400 - [debug] [BaseDriver] Waiting up to 0 ms for condition
2020-07-14 14:44:55:400 - [debug] [WD Proxy] Matched '/element' to command name 'findElement'
2020-07-14 14:44:55:400 - [debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8200/wd/hub/session/886a489b-737a-48aa-b795-8711897c13e6/element] with body: {"strategy":"id","selector":"notification_container","context":"","multiple":false}
2020-07-14 14:44:55:428 - [debug] [WD Proxy] Got response with status 200: {"sessionId":"886a489b-737a-48aa-b795-8711897c13e6","value":{"ELEMENT":"75c5f0a6-dbd0-43dd-aa97-132fb033abd6","element-6066-11e4-a52e-4f735466cecf":"75c5f0a6-dbd0-43dd-aa97-132fb033abd6"}}
2020-07-14 14:44:55:429 - [debug] [W3C (7533ddaa)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"75c5f0a6-dbd0-43dd-aa97-132fb033abd6","ELEMENT":"75c5f0a6-dbd0-43dd-aa97-132fb033abd6"}
2020-07-14 14:44:55:429 - [HTTP] <-- POST /wd/hub/session/7533ddaa-150d-4f69-88ae-bc5ea67fa38a/element 200 30 ms - 137

Why was that? How can speed up the finding elements process? I’ve tried to lower waitForIdleTimeOut but it has no luck.

waitForIdleTimeout=1
waitForSelectorTimeout=1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ltpquangcommented, Jul 15, 2020

Thank you so much for the docs Kazu. Maybe I missed them. I’m going to dig into and will close this issue when everything gets clear. 🥺

0reactions
ltpquangcommented, Jul 15, 2020

All clear. Adding this capability works for me:

settings[waitForIdleTimeout]=0

Since it is a setting capabilities, we must use the format settings[<settingname>] as described in this link.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Finding an element takes too much time - Learn - UiPath Forum
I am using Click activity on an element on IE browser, and this takes 5-10 seconds, which is way too slow. Is there...
Read more >
Appium takes too long to find elements (iOS) #13540 - GitHub
The problem When the page source is large, Appium takes a huge amount of time just to get one element on screen. As...
Read more >
Activating a div when a certain element takes too long to load
Basically, before your "slow loading" code, you start a timer, and when it fires you do something. After the DOM loads, you cancel...
Read more >
Add end screens to videos - YouTube Help
End screens can be added to the last 5–20 seconds of a video. You can use them to promote other videos, encourage viewers...
Read more >
How to Increase Page Speed - Neil Patel
Page speed directly affects page views, time on page, bounce rate, & conversions. There are steps to increase page speed and improve your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found