Looks like it takes time to load the webpage, and hence the detection of webelement wasn’t happening. You can either use @shri’s code above or just add these two statements just below the code driver = webdriver.Firefox()
:
driver.maximize_window() # For maximizing window
driver.implicitly_wait(20) # gives an implicit wait for 20 seconds
More Related Contents:
- Can Selenium interact with an existing browser session?
- What is the difference between cssSelector & Xpath and which is better with respect to performance for cross browser testing?
- How to run Selenium WebDriver test cases in Chrome
- Is there a version of Selenium WebDriver that is not detectable?
- Unable to find a matching set of capabilities with selenium 3.4.3, firefox 54.0 and gecko driver 0.17
- Many process of Google Chrome (32 bit)
- How to launch all Karate features setting up which browser to use as an external maven variable
- Reached error page: about:neterror when trying to navigate to other tabs if there is a form submit under that tab
- Refreshing Web Page By WebDriver When Waiting For Specific Condition
- How to download an image using Selenium (any version)?
- Selenium WebDriver how to close browser popup
- Need to find element in selenium by css
- Headless browser detection
- What is the internal working difference between Implicit Wait and Explicit Wait
- ERROR:ssl_client_socket_openssl.cc(1158)] handshake failed with ChromeDriver Chrome browser and Selenium
- What is the exact purpose of Selenium Grid?
- Cannot get automation extension from timeout: Timed out receiving message from renderer
- How do you click on a checkbox from a list of checkboxes via Selenium/Webdriver in Java?
- org.openqa.selenium.InvalidCookieDomainException: Document is cookie-averse using Selenium and WebDriver
- Selenium Webdriver – click on hidden elements
- Which is the best and fastest way to find the element using webdriver? By.XPath or By.ID or anything else? And why? [closed]
- org.openqa.selenium.SessionNotCreatedException: Unable to find a matching set of capabilities while initiating Firefox v37 through Selenium v3.11.0
- Selenium how to manage wait for page load?
- selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 80
- Is there a Selenium WebDriver available for the Microsoft Edge browser?
- Handle windows authentication pop up on Chrome
- selenium implicitly wait doesn’t work
- isElementPresent is very slow in case if element does not exist.
- Switch between two browser windows using Selenium WebDriver
- How to get attribute value inside a div in webdriver