Autohotkey & Selenium Chrome

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
devnullsp
Posts: 73
Joined: 21 Nov 2017, 09:00

Autohotkey & Selenium Chrome

12 Dec 2017, 18:19

HI,

At first, thanks for your work.

I have two questions

1.- It's posible to execute Selenium Chromedrive without installing it (loading dll or registred or similar)?
2.- I got one error message about disabling the extensions when using chrome selenium. How do i set chrome startup parameters? (v.g. --disable-extensions)

TIA.
devnullsp
Posts: 73
Joined: 21 Nov 2017, 09:00

Re: Autohotkey & Selenium Chrome

15 Dec 2017, 03:34

Autoresponse :)

1.- Sorry not advance :(

2.-

Code: Select all

url;="http:\\google.com"
driver:= ComObjCreate("Selenium.WebDriver")
driver.AddArgument("--no-sandbox")
driver.AddArgument("--disable-extensions")
driver.AddArgument("--disable-quic")
driver.AddArgument("--use-spdy=off")
driver.setBinary("C:\Datos\RPA\EXTERNO\GoogleChromePortable 62_032\GoogleChromePortable.exe")
driver.SetProfile("C:\Datos\RPA\EXTERNO\GoogleChromePortable 62_032\Data\profile\Default")
driver.Start("chrome", url)
driver.Get("/")
At this sample:

- run no default google, v.g. Chrome portable
- Use profile for save sessions
- disable extensions and especifics protocols.


Another 2c for you:

1.- Get all options from selec tag

Code: Select all

	elementos := driver.findElementbyXPath("//*[@id='PDQToolbar']/div[2]/select")
	i := elementos.Attribute("length")
	c := ""
	Loop %i%
	{
		t := driver.findElementbyXPath("//*[@id='PDQToolbar']/div[2]/select/option[" . A_Index . "]").Attribute("innerText")
		c := c t "`n"
	}
	msgbox %c%
2.- Click (select) desired select tag option: ("ROBOT" its the option)

Code: Select all

	i := driver.findElementbyXPath("//*[@id='PDQToolbar']/div[2]/select").Attribute("length")
	Loop %i%
	{
		elem := driver.findElementbyXPath("//*[@id='PDQToolbar']/div[2]/select/option[" . A_Index . "]")
		t := elem.Attribute("innerText")
		if(t="ROBOT") 
		{
			elem.click()
			break
		}
			
	}

3.- Select windows default chrome profile (current user)

Code: Select all


usu = %username%
driver.SetProfile("C:\Users\" . usu . "\AppData\Local\Google\Chrome\User")

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Billykid, Google [Bot] and 207 guests