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 85 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 14,970 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,030 points
4,329 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
• 10,560 points
66 views
+2 votes
1 answer
+1 vote
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
362 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,030 points
57 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
423 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
44 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.