Wait until element becomes clickable #1332
-
Is there a way to wait until element becomes clickable while using SeleniumBase? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
@RomanJus That waiting is automatic with SeleniumBase. Is there more to the error message? (Eg. "Other element would receive the click: ..."). Are you running your SeleniumBase tests with |
Beta Was this translation helpful? Give feedback.
-
Issue I am having is when I type into email input field on a shipping page, once the field contains a valid email, the page grays out and an animation runs for about 3 seconds while a call is made to get address specific shipping methods. When the call returns, the appropriate shipping methods are added to the page with default method auto-selected, and the 'continue to payment' button updates from grayed out to enabled as expected, however when I try sb.click(continue_to_payment_btn, scroll=False) it is not being clicked. If I add sb.sleep(3) at the end of the method that types the email_address into the field, then the sb.click(continue_to_payment_btn, scroll=False) works. So I believe you that sbase should automatically wait for things to become clickable, but in this case there seems to be an issue related to either (or both) of loading animations or elements just added to the page and becoming enabled. I even have tried sb.wait_for_element(continue_to_payment_btn, timeout=10) before trying to click and that doesn't fix the problem, but a hardcoded 3 second wait after entering the email while the animation displays does work. Hope it helps. Thanks for a great tool! |
Beta Was this translation helpful? Give feedback.
@RomanJus That waiting is automatic with SeleniumBase. Is there more to the error message? (Eg. "Other element would receive the click: ..."). Are you running your SeleniumBase tests with
--safari
to get the native Safari integration? The SeleniumBase Safari integration includes some fixes that aren't part of the standard Selenium Safari APIs.