Wait until page loads before click using Selenium Webdriver

0 votes
driver.find_element_by_id("ch4_loginGuestBtn").click()

This command intermittently fails with:

"Element is not clickable"

I'm guessing I need to do something like the following.

    guestlogin_button = wait.until(EC.visibility_of_element_located((By.id, ".ch4_loginGuestBtn")))

    actions = ActionChains(driver)

    actions.move_to_element(guestlogin_button).click().perform()

This is, however, failing with:

AttributeError: type object 'By' has no attribute 'id'

What am I doing wrong, how do I fix the wait.until line?

Aug 8, 2018 in Selenium by Martin
• 4,320 points
4,431 views

1 answer to this question.

0 votes

Change the following

guestlogin_button = wait.until(EC.visibility_of_element_located((By.id, ".ch4_loginGuestBtn")))

to

guestlogin_button = wait.until(EC.visibility_of_element_located((By.ID, ".ch4_loginGuestBtn")))

answered Aug 8, 2018 by Samarpit
• 5,910 points

Related Questions In Selenium

+1 vote
4 answers

Need to wait until page is completely loaded - Selenium WebDriver

You can try something like -  new WebDriverWait(firefoxDriver, ...READ MORE

answered Dec 21, 2019 in Selenium by Robin
64,347 views
0 votes
1 answer

30 min Wait on a page and then perform any Operation using Selenium Webdriver

Implicit wait tells webdriver to poll the ...READ MORE

answered Apr 19, 2018 in Selenium by Shubham
• 13,490 points
3,092 views
0 votes
1 answer

Double click a record in a grid using Selenium webdriver

Try Actions class to perform this Actions action ...READ MORE

answered Mar 30, 2018 in Selenium by Damon Salvatore
• 5,980 points
5,401 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,762 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,184 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
7,258 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,895 views
0 votes
3 answers

Click Allow on Show Notifications popup using Selenium Webdriver

Try this: Robot robot = new Robot(); robot.delay(5000); robot.keyPress(KeyEvent.VK_TAB); robot.keyPress(KeyEvent.VK_ENTER); hope this ...READ MORE

answered Mar 1, 2020 in Selenium by anuj
29,962 views
0 votes
3 answers

How to set Page Load Timeout using C# using Selenium WebDriver

driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(15); READ MORE

answered Apr 17, 2019 in Selenium by Tim Muir
10,216 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP