How to detect when a webpage is loaded? (Selenium)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
daiweisc
Posts: 49
Joined: 19 Oct 2019, 04:27

How to detect when a webpage is loaded? (Selenium)

23 May 2024, 23:39

Why the code " Driver.implicitly_wait(10) " is wrong?

Code: Select all

  Driver := ComObjCreate("Selenium.ChromeDriver")
	Driver.SetPreference("download.default_directory", "D:\download")
	Driver.SetPreference("download.directory_upgrade", true)
	Driver.SetPreference("download.extensions_to_open", "")
	Driver.SetPreference("download.prompt_for_download", false)
	Driver.Setbinary("C:\Users\Administrator\AppData\Roaming\360ent\Application\360ent.exe")
	Driver.AddArgument("--lang=zh-CN")
	Driver.AddArgument("--start-maximized")
	; global Driver
	User := "daiwei"
	Password := "Hegang@2022"
	Webpage := "http://10.203.0.225/mes"
	Sleep,3000
  	Driver.implicitly_wait(10)   
	Driver.Get(Webpage)                   ; Navigate to a webpage
[Mod edit: Added 'Selenium' to the topic title.]
ShatterCoder
Posts: 88
Joined: 06 Oct 2016, 15:57

Re: How to detect when a webpage is loaded? (Selenium)

24 May 2024, 17:20

According to this post in stackoverflow, the Get() command has a built in wait for the DOM.readyState. Unless you have java stuff on the page loading content in panes within the main document, you should not have to worry about it. And if you do have java stuff to worry about... well read the post below for a better understanding of the issue at hand.

https://stackoverflow.com/questions/15122864/selenium-wait-until-document-is-ready

Good luck, and I hope this helps at least a bit.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: dra3th, Google [Bot], Spawnova and 251 guests