How to wait for the webpage to load in selenium using java

0 votes
How do we make selenium to wait for the page to load? In the sense how should we write the script in java so that the selenium test case waits for the page to load before testing it.
Aug 28, 2018 in Selenium by curious
• 560 points

recategorized Aug 30, 2018 by Vardhan 229 views

1 answer to this question.

0 votes
Firstly, when you launch a web application, the selenium test script waits for the page to be loaded before executing the test script.

Secondly, all the web elements are not loaded at the same time, in a situation like that we can use implictwait, the following statement might be helpful:

driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);

Selenium will wait for maximum 5 seconds for the web elements to load before executing the test case.
answered Aug 28, 2018 by bug_seeker
• 15,360 points

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer

How to scroll the Page up or down in Selenium WebDriver? (using java)

Its pretty simple. Check out the below ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,110 points
8,515 views
+1 vote
2 answers

How to get the title of a webpage using Selenium Java?

Essentially, driver.getTitle(); function can be used to ...READ MORE

answered Dec 17, 2018 in Selenium by Vardhan
• 12,740 points
600 views
+2 votes
1 answer
0 votes
2 answers

How to scroll down a webpage in selenium using Java?

This works... JavascriptExecutor jse = (JavascriptExecutor)driver; j ...READ MORE

answered Apr 3 in Selenium by anonymous
6,213 views
0 votes
1 answer
0 votes
1 answer

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,110 points
996 views
0 votes
1 answer
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,130 points
1,148 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
891 views