I am new to this but I get the following error... what's wrong? Windows 7, lastest chrome driver and chrome.
---------------------------
test.ahk
---------------------------
Error: 0xA00A0021 -
Source: Selenium
Description: SessionNotCreatedError
session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"90E432F756CAFB226C36A98FBE702F35","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=MYIP)
(Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 6.1 SP1 x86_64)
HelpFile: (null)
HelpContext: 0
Specifically: Get
Line#
004: SetWorkingDir,%A_ScriptDir%
009: Return
009: Reload
009: Return
013: driver := ComObjCreate("Selenium.ChromeDriver")
014: drive.start("CHROME", "https://google.com")
---> 015: driver.Get("https://google.com/")
016: MsgBox,driver.Window.Title "
" driver.Url
017: Return
018: Exit
019: Exit
019: Exit
Continue running the script?
---------------------------
Oui Non
---------------------------
Using Selenium with AutoHotkey- Cross browser automation!
Re: Using Selenium with AutoHotkey- Cross browser automation!
013: driver := ComObjCreate("Selenium.ChromeDriver")
014: drive.start("CHROME", "https://google.com")
Use:
Code: Select all
driver := ComObjCreate("Selenium.ChromeDriver")
driver.Get("https://google.com")
Re: Using Selenium with AutoHotkey- Cross browser automation!
Still not working and getting this error:
Code: Select all
---------------------------
test.ahk
---------------------------
Error: 0xA00A0021 -
Source: Selenium
Description: SessionNotCreatedError
session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"E591AB90FD0D03228349A3AFFC68C33E","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=MYIP)
(Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 6.1 SP1 x86_64)
HelpFile: (null)
HelpContext: 0
Specifically: Get
Line#
003: SendMode,Input
004: SetWorkingDir,%A_ScriptDir%
012: Return
015: driver := ComObjCreate("Selenium.ChromeDriver")
---> 016: driver.Get("https://google.com")
017: MsgBox,driver.Window.Title "
" driver.Url
018: Return
019: Exit
020: Exit
020: Exit
Continue running the script?
---------------------------
Oui Non
---------------------------
Re: Using Selenium with AutoHotkey- Cross browser automation!
It's only a guess, but I think you will still have to "start" - but you had a typo: driver.start("CHROME", "https://google.com") - a missing r
Re: Using Selenium with AutoHotkey- Cross browser automation!
I see you didnt mention installing selenium.I am new to this but I get the following error... what's wrong? Windows 7, lastest chrome driver and chrome.
Make sure you have installed selenium from here:
https://github.com/florentbr/SeleniumBa ... g/v2.0.9.0
Once Selenium is installed take the newer downloaded chromedriver you have and put it in the selenium folder and overwrite the older chromedriver that comes with it.
For reference chromedriver download page: https://sites.google.com/a/chromium.org ... /downloads
Re: Using Selenium with AutoHotkey- Cross browser automation!
Hi Thanks it works now. Chrome driver was not in the good folder... used the startup folder instead of the real folder of selenium...
I have 2 more questions
How I could keep my cookies and login access to website in Selenium Chrome?
How I can add an extension and keep it to Selenium Chrome?
Thanks for help
I have 2 more questions
How I could keep my cookies and login access to website in Selenium Chrome?
How I can add an extension and keep it to Selenium Chrome?
Thanks for help
Re: Using Selenium with AutoHotkey- Cross browser automation!
Ok found out that I needed to login 1 time with selenium then it will save on my user profile.
However, it look like if I'm signed by google gmail I lost my connection with the website when new selenium chrome open and have to hit the sign in by google to make me logged in again.
However, it look like if I'm signed by google gmail I lost my connection with the website when new selenium chrome open and have to hit the sign in by google to make me logged in again.
Re: Using Selenium with AutoHotkey- Cross browser automation!
Take a look at this post if you want to connect to an existing chrome browsing session:
https://autohotkey.com/boards/viewtopic ... m&start=30
https://autohotkey.com/boards/viewtopic ... m&start=30
Re: Using Selenium with AutoHotkey- Cross browser automation!
Nice, work perfectly!
If I want to tick a tick box should I use the below?
driver.FindElementByXPath("/html/body/div[26]/div/div[1]/div[2]/div[2]/table/tbody/tr[4]/td[2]").click()
I have other xpath like //*[@id=""THISISATESTVALUE""] that work for selecting with a .click() but the above xpath is the only 1 I have for the "check box" that I need to tick.
I tried with the .click() but it does not work.
If I want to tick a tick box should I use the below?
driver.FindElementByXPath("/html/body/div[26]/div/div[1]/div[2]/div[2]/table/tbody/tr[4]/td[2]").click()
I have other xpath like //*[@id=""THISISATESTVALUE""] that work for selecting with a .click() but the above xpath is the only 1 I have for the "check box" that I need to tick.
I tried with the .click() but it does not work.
Re: Using Selenium with AutoHotkey- Cross browser automation!
Use FindElementsByXPath (notice the s in the name)
Try:
driver.FindElementsByXPath("/html/body/div[26]/div/div[1]/div[2]/div[2]/table/tbody/tr[4]/td").Item[2]click()
Using absolute paths is ok and will work only if the page layout is the same 100% of the time.
It is worth learning how to write relative paths to be reliable when page layouts change.
HTH
Try:
driver.FindElementsByXPath("/html/body/div[26]/div/div[1]/div[2]/div[2]/table/tbody/tr[4]/td").Item[2]click()
Using absolute paths is ok and will work only if the page layout is the same 100% of the time.
It is worth learning how to write relative paths to be reliable when page layouts change.
HTH
Re: Using Selenium with AutoHotkey- Cross browser automation!
Thanks again:)
Let says the script write something in a text box, how I can add an if statement to verify if that textbox got the input the script entered?
Let says the script write something in a text box, how I can add an if statement to verify if that textbox got the input the script entered?
Code: Select all
driver.FindElementByXPath("//div[@data-widget-cid=""widget-16""]/select").SendKeys("Test123")
if (driver.FindElementByXPath("//div[@data-widget-cid=""widget-16""]/select"). ;contain the word Test123 continue, else popup a message box
Re: Using Selenium with AutoHotkey- Cross browser automation!
Try one of these:
if (driver.FindElementByXPath("//div[@data-widget-cid='widget-16']/select").Attribute("textContent") = "Test123")
if (driver.FindElementByXPath("//div[@data-widget-cid='widget-16']/select").Attribute("innerText") = "Test123")
if (driver.FindElementByXPath("//div[@data-widget-cid='widget-16']/select").Attribute("textContent") = "Test123")
if (driver.FindElementByXPath("//div[@data-widget-cid='widget-16']/select").Attribute("innerText") = "Test123")
Re: Using Selenium with AutoHotkey- Cross browser automation!
both not working. No error from script but it not find the word.
Re: Using Selenium with AutoHotkey- Cross browser automation!
Hi,
Does anyone know that ways to get control new tabs? I want to use and navigate new tabs but I don't know how to do that. I googled but I can only find results about java, python and others which not fit for autohotkey. Using driver.getWindowHandles() and driver.switchTo().window(tabs.get(0)) are the soulutions of this problem I think, but I don't know how to change this codes for autohotkey.
https://www.testingexcellence.com/webdr ... avascript/
Does anyone know that ways to get control new tabs? I want to use and navigate new tabs but I don't know how to do that. I googled but I can only find results about java, python and others which not fit for autohotkey. Using driver.getWindowHandles() and driver.switchTo().window(tabs.get(0)) are the soulutions of this problem I think, but I don't know how to change this codes for autohotkey.
https://www.testingexcellence.com/webdr ... avascript/
Code: Select all
driver:= ComObjCreate("Selenium.CHROMEDriver") ;Chrome driver
driver.Get("http://www.google.com")
MsgBox
driver.sendKeys(driver.Keys.CONTROL)
driver.sendKeys(driver.Keys.SHIFT)
Xpath = //*[contains(text(), 'Gmail')]
driver.FindElementByXPath(Xpath).click()
/*
; I don't know how to get a control of the second new tab
driver.getWindowHandles()
driver.switchTo().window(tabs.get(0))
*/
MsgBox
driver.Get("http://the-automator.com/") ; I want to open this url at the second tab(new tab)
MsgBox
Re: Using Selenium with AutoHotkey- Cross browser automation!
Code: Select all
#Persistent
driver := ComObjCreate("Selenium.ChromeDriver")
driver.Get("http://www.google.com")
driver.ExecuteScript("window.open();")
driver.SwitchToNextWindow
driver.Get("http://www.google.com")
Re: Using Selenium with AutoHotkey- Cross browser automation!
malcev wrote:Code: Select all
#Persistent driver := ComObjCreate("Selenium.ChromeDriver") driver.Get("http://www.google.com") driver.ExecuteScript("window.open();") driver.SwitchToNextWindow driver.Get("http://www.google.com")
It works!! Thank you!!
- Thoughtfu1Tux
- Posts: 125
- Joined: 31 May 2018, 23:26
Re: Using Selenium with AutoHotkey- Cross browser automation!
Anyone have any idea on how to incorporate the new Firefox Marionette Driver into Selenium?
I found a tutorial that links to the new driver that you have to put into the Selenium Folder but am having no luck trying to convert the Java code to AutoHotKey code.
Here is the link to the article that explains the New Firefox driver: Solving Firefox 47+ Selenium WebDriver problem
I have tried the below with no luck.
I found a tutorial that links to the new driver that you have to put into the Selenium Folder but am having no luck trying to convert the Java code to AutoHotKey code.
Here is the link to the article that explains the New Firefox driver: Solving Firefox 47+ Selenium WebDriver problem
I have tried the below with no luck.
Code: Select all
driver.setProperty("webdriver.gecko.driver", "C:\Program Files\SeleniumBasic\geckodriver.exe")
driver:= ComObjCreate("Selenium.firefoxDriver") ;Firefox driver
AND
driver.setProperty("webdriver.gecko.driver", "C:\Program Files\SeleniumBasic\geckodriver.exe")
driver:= ComObjCreate("Selenium.geckoDriver") ;Firefox driver
Re: Using Selenium with AutoHotkey- Cross browser automation!
https://github.com/mozilla/geckodriver/ ... CHANGES.md
The version used in this thread https://florentbr.github.io/SeleniumBasic/ is based on Selenium 2.x0.16.0 (2017-04-21)
Note that geckodriver v0.16.0 is only compatible with Selenium 3.4 and greater.
- Thoughtfu1Tux
- Posts: 125
- Joined: 31 May 2018, 23:26
Re: Using Selenium with AutoHotkey- Cross browser automation!
Ah, I totally missed that. Thank you.Xtra wrote:https://github.com/mozilla/geckodriver/ ... CHANGES.mdThe version used in this thread https://florentbr.github.io/SeleniumBasic/ is based on Selenium 2.x0.16.0 (2017-04-21)
Note that geckodriver v0.16.0 is only compatible with Selenium 3.4 and greater.
Have you tried using AutoHotKey with Selenium 3.x by any chance?
From what I've read there was a big change from SeleniumBasic to Selenium 3, and I haven't seen any posts about anyone using AutoHotKey to control Selenium 3. Is it impossible to control Selenium 3, or has no one really needed to because SeleniumBasic functions without any real issues?
Who is online
Users browsing this forum: No registered users and 10 guests