Selenium Chrome - Iselementpresent help Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Axxi
Posts: 15
Joined: 02 Apr 2020, 10:56

Selenium Chrome - Iselementpresent help

14 Apr 2020, 08:54

Hey!

I've had a hard time getting the function IsElementPresent to work, im using selenium with chrome. I just cant for the life of me figure out the correct way to use it, it always returns an error.

My objective with this is for the script to wait until the page had loaded/a certain element has been found before it continues. Any help is deeply appreciated!



Code: Select all

driver := ChromeGet()

if driver.IsElementPresent(By.Xpath("//input[@name='SearchIdentifierValue']"))
{
	msgbox 2
}
else
{
	msgbox 1
}




ChromeGet(IP_Port := "127.0.0.1:9222") {
	driver := ComObjCreate("Selenium.ChromeDriver")
	driver.SetCapability("debuggerAddress", IP_Port)
	driver.Start()
	return driver
}
Axxi
Posts: 15
Joined: 02 Apr 2020, 10:56

Re: Selenium Chrome - Iselementpresent help

14 Apr 2020, 10:30

Thank you, it worked! :) I dont really understand why it worked but i'll look into what that means.

malcev wrote:
14 Apr 2020, 10:19

Code: Select all

By := ComObjCreate("Selenium.By")
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Selenium Chrome - Iselementpresent help

14 Apr 2020, 10:44

If You read selenium help then You will see By class->By Constructor.
It means that You have to create this object.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 223 guests