Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. QA Testing
  3. Question
QA Testing

How to solve the problem of selenium waiting until page loads?

Asked by Vikash Kumar Oct 20, 2022 1.1K views 1 answer
Share

About this question

I run nearly 30-40 test cases twice a day. And every time some test case fails due to page load time. In fact I have explicitly mentioned Thread.sleep("2000"); wherever I feel it takes more time to load. But still some 5-6 test cases fail. How can I make my selenium wait until the page loads ?? And I got this exception


Starting ChromeDriver 2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed) on port 1828

              Only local connections are allowed.Exception in thread "main" org.openqa.selenium.ElementNotVisibleException: element not visible(Session info: chrome=54.0.2840.99)

              (Driver info: chromedriver=2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed),platform=Windows NT 10.0.14393 x86_64) (WARNING: The server did not provide any stacktrace information)               Command duration or timeout: 36 milliseconds

              Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40'System info: host: 'DESKTOP-LU4RI93', ip: '10.100.154.4', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_111'

              Driver info: org.openqa.selenium.chrome.ChromeDriver Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed), userDataDir=C:UsersHRT 1~1AppDataLocalTempscoped_dir6436_32242}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=54.0.2840.99, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]

              Session ID: dacb1d58627c657aa111d94eba60b81f

Your answer

1 Answer

More QA Testing discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest QA Testing Blogs

Guides, tips and career advice on QA Testing from JanBask experts.