Selenium: Something is wrong

Get help with using AutoHotkey and its commands and hotkeys
User avatar
rizwan4season
Posts: 11
Joined: 13 Nov 2020, 08:37

Selenium: Something is wrong

26 Dec 2020, 22:31

Code: Select all

waitfindElementByIDchange(driver,"ctl00_ContentPlaceHolder2_NonDutyPaidItemDetailUc1_btnAnalysisLookup") 
msgbox,done

waitfindElementByIDchange(driver,id)
click:
loop
{
	try
	{
		found := driver.findElementByID(id)
		if(found)
		{
			break
		}
	}
	catch
	{
		goto,click
	}
}
return
[Mod edit: [code][/code] tags added.]
User avatar
Xtra
Posts: 2048
Joined: 02 Oct 2015, 12:15

Re: Selenium: Something is wrong

27 Dec 2020, 15:18

That is not how you create a function. Also goto loop label is pointless.

try:

Code: Select all

waitfindElementByIDchange(driver,"ctl00_ContentPlaceHolder2_NonDutyPaidItemDetailUc1_btnAnalysisLookup") 
msgbox,done

waitfindElementByIDchange(driver,id)
{
	loop
	{
		try
		{
			found := driver.findElementByID(id)
			if (found)
			{
				break
			}
		}
		catch
		{
			Sleep 100
		}
	}
}

Return to “Ask For Help”

Who is online

Users browsing this forum: asundrus, fiendhunter, Jmori, viv, XMCQCX and 52 guests