Jump to content

Recommended Posts

Hi AutoIT Folks,

 

May i seek your help regarding Chrome Automation.

I am unable to make a simple run of the below script. Just new with the chrome automation since IE is having limitations already.

 

Thank you.

Local $sDesiredCapabilities, $iIndex, $sSession
Local $nMsg, $lProcess = False

Local $sDesiredCapabilities, $sSession
SetupChrome()
_WD_Startup()
$sSession = _WD_CreateSession($sDesiredCapabilities)

;Login
_WD_NewTab($sSession)
_WD_Navigate($sSession, "https://www.autoitscript.com/site/")

_WD_Shutdown()


Func SetupChrome()
_WD_Option('Driver', 'chromedriver.exe')
_WD_Option('Port', 9515)
_WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"')

$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}}'
EndFunc

 

Share this post


Link to post
Share on other sites
16 minutes ago, TheOne23 said:

I am unable to make a simple run of the below script.

<sarcasm>

I'm guessing that you forgot to hit F5 to run the script in Scite. Otherwise, I can't imagine why you wouldn't have shown the output from the Scite console so that we can actually help you.

</sarcasm>

😜

Share this post


Link to post
Share on other sites

Hi Nine,

Checking on it now. 

Just an overview of the output I would like to share below:

>"D:\Backup\Back_up for new Laptop\D\Tools\AutoIT v3.3.14.3\autoit-v3\install\SciTe\..\autoit3.exe" /ErrorStdOut "D:\Automations\Chrome Automation\WebDriver-0.3.0.3\WebDriver-0.3.0.3\Chrome_test.au3"    
_WD_IsLatestRelease: True
_WD_IsLatestRelease ==> Success
_WDStartup: OS: WIN_10 WIN32_NT 16299 
_WDStartup: AutoIt: 3.3.14.5
_WDStartup: WD.au3: 0.3.0.3 (Up to date)
_WDStartup: WinHTTP:    1.6.4.1
_WDStartup: Driver: chromedriver.exe
_WDStartup: Params: --log-path="D:\Automations\Chrome Automation\WebDriver-0.3.0.3\WebDriver-0.3.0.3\chrome.log"
_WDStartup: Port:   9515
__WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}}
__WD_Post: StatusCode=500; ResponseText={"value":{"error":"session not created","message":"session not created: This version of ChromeDriver...
__WD_Post ==> Timeout: {"value":{"error":"session not created","message":"session not created: This version of ChromeDriver only supports Chrome version 84","stacktrace":"Backtrace:\n\tOrdinal0 [0x00B087E3+2852835]\n\tOrdinal0 [0x009F5BB1+1727409]\n\tOrdinal0 [0x008CE4B9+517305]\n\tOrdinal0 [0x00860BA0+68512]\n\tOrdinal0 [0x0085D3A0+54176]\n\tOrdinal0 [0x0087D9F7+186871]\n\tOrdinal0 [0x0087D7FD+186365]\n\tOrdinal0 [0x0087B70B+177931]\n\tOrdinal0 [0x00862584+75140]\n\tOrdinal0 [0x00863650+79440]\n\tOrdinal0 [0x008635E9+79337]\n\tOrdinal0 [0x00A0AD5C+1813852]\n\tGetHandleVerifier [0x00C2C616+1075574]\n\tGetHandleVerifier [0x00C2C367+1074887]\n\tGetHandleVerifier [0x00C37497+1120247]\n\tGetHandleVerifier [0x00C2CC16+1077110]\n\tOrdinal0 [0x00A03206+1782278]\n\tOrdinal0 [0x00A0C3BB+1819579]\n\tOrdinal0 [0x00A0C523+1819939]\n\tOrdinal0 [0x00A22B45+1911621]\n\tBaseThreadInitThunk [0x750E8674+36]\n\tRtlGetAppContainerNamedObjectPath [0x779F5EC7+311]\n\tRtlGetAppContainerNamedObjectPath [0x779F5E97+263]\n"}}
_WD_CreateSession: {"value":{"error":"session not created","message":"session not created: This version of ChromeDriver only supports Chrome version 84","stacktrace":"Backtrace:\n\tOrdinal0 [0x00B087E3+2852835]\n\tOrdinal0 [0x009F5BB1+1727409]\n\tOrdinal0 [0x008CE4B9+517305]\n\tOrdinal0 [0x00860BA0+68512]\n\tOrdinal0 [0x0085D3A0+54176]\n\tOrdinal0 [0x0087D9F7+186871]\n\tOrdinal0 [0x0087D7FD+186365]\n\tOrdinal0 [0x0087B70B+177931]\n\tOrdinal0 [0x00862584+75140]\n\tOrdinal0 [0x00863650+79440]\n\tOrdinal0 [0x008635E9+79337]\n\tOrdinal0 [0x00A0AD5C+1813852]\n\tGetHandleVerifier [0x00C2C616+1075574]\n\tGetHandleVerifier [0x00C2C367+1074887]\n\tGetHandleVerifier [0x00C37497+1120247]\n\tGetHandleVerifier [0x00C2CC16+1077110]\n\tOrdinal0 [0x00A03206+1782278]\n\tOrdinal0 [0x00A0C3BB+1819579]\n\tOrdinal0 [0x00A0C523+1819939]\n\tOrdinal0 [0x00A22B45+1911621]\n\tBaseThreadInitThunk [0x750E8674+36]\n\tRtlGetAppContainerNamedObjectPath [0x779F5EC7+311]\n\tRtlGetAppContainerNamedObjectPath [0x779F5E97+263]\n"}}
_WD_CreateSession ==> Webdriver Exception: HTTP status = 500
__WD_Get: URL=HTTP://127.0.0.1:9515/session//window/handles
__WD_Get: StatusCode=404; $iResult = 0; $sResponseText={"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOr...
_WD_Window: {"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOr...
_WD_Window ==> Invalid session ID: HTTP status = 404
_WD_NewTab ==> Webdriver Exception
__WD_Post: URL=HTTP://127.0.0.1:9515/session//url; $sData={"url":"https://www.autoitscript.com/site/"}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOr...
_WD_Navigate: {"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOrdinal0 [0x00B087E3+2852835]\n\tOrdinal0 [0x009F5BB1+1727409]\n\tOrdinal0 [0x008CE362+516962]\n\tOrdinal0 [0x008620E9+73961]\n\tOrdinal0 [0x0087B7D7+178135]\n\tOrdinal0 [0x0087A25A+172634]\n\tOrdinal0 [0x00879E34+171572]\n\tOrdinal0 [0x0085234E+9038]\n\tOrdinal0 [0x008527A6+10150]\n\tOrdinal0 [0x00852E40+11840]\n\tOrdinal0 [0x00A0AD5C+1813852]\n\tGetHandleVerifier [0x00C2C616+1075574]\n\tGetHandleVerifier [0x00C2C367+1074887]\n\tGetHandleVerifier [0x00C37497+1120247]\n\tGetHandleVerifier [0x00C2CC16+1077110]\n\tOrdinal0 [0x00A03206+1782278]\n\tOrdinal0 [0x0085220B+8715]\n\tOrdinal0 [0x00851F18+7960]\n\tGetHandleVerifier [0x00DFBBCC+2973484]\n\tBaseThreadInitThunk [0x750E8674+36]\n\tRtlGetAppContainerNamedObjectPath [0x779F5EC7+311]\n\tRtlGetAppContainerNamedObjectPath [0x779F5E97+263]\n"}}
_WD_Navigate ==> Invalid session ID: HTTP status = 404
>Exit code: 0    Time: 4.06

 

Share this post


Link to post
Share on other sites
9 minutes ago, TheOne23 said:

_WDStartup: WinHTTP:    1.6.4.1

Please grab the latest source from here.

Quote
{"value":{"error":"session not created","message":"session not created: This version of ChromeDriver only supports Chrome version 84"

This is your true issue that needs to be resolved. What version of Chrome and Chromedriver are you attempting to use?

Share this post


Link to post
Share on other sites

Hi Danp2,

 

I am using Version 83.0.4103.106 (Official Build) (64-bit) and used this driver: ChromeDriver 83.0.4103.14 since there is no exact version in the list of downloadable in the download page. I am downloading now the latest version of _WDStartup: WinHTTP:    1.6.4.1

 

Thank you.

Share this post


Link to post
Share on other sites

Hi Dan,

It is working perfectly now! 

Thank you very much! You're the Man Bro!

I have another query, if you have a function that will do web scraping of innertext from a web page.

Thank you.

Share this post


Link to post
Share on other sites

Hi Danp2,

Thank you very much on the inputs. Really informative and helped me a lot.

I will play around on the functions you suggested.

Thank you!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...