Jump to content
Danp2

WebDriver UDF - Help & Support

Recommended Posts

 

While using chromedriver, I once encountered an error message. The error seemed to have occured in _WD_CreateSession command and as far as I remember the title of message box was 'WebDriver.au3 Error' and the text read something like 'send / receive error'. I tried to replicate the error in vain. I am worried that it might occur when it should not, such as when I am away.

Do you have any idea what could cause the error? How can I prevent it or how can I trap it?

Share this post


Link to post
Share on other sites

Maybe I can do this and hope that the error won't show up again.

SetupChrome()
_WD_Startup()
$_WD_ERROR_MSGBOX = False
$timer = TimerInit()
While Not WinActive("data:, - Chrome")
    $Session = _WD_CreateSession($sDesiredCapabilities)
    Sleep(1000)
    While Not WinActive("data:, - Chrome")
        Sleep(100)
        If TimerDiff($timer) > 10000 Then
            $timer = TimerInit()
            ExitLoop
        EndIf
    WEnd
WEnd

 

Share this post


Link to post
Share on other sites

I'm having a bit of a problem with using chromedriver headlessly. The sites I'm trying to go to are having Mixed Content problems, and I can't get chromedriver to start in a way that doesn't grind everything to a halt when the Mixed Content happens.

Local $oChrome = _WD_CreateSession('{"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true, "args": ["--headless", "--allow-running-insecure-content"] }}}}')

Which then creates __WD_Posts like:

__WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":false,"acceptSslCerts":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{"chromedriverVersion":"2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb)","userDataDir":"C:\\Users\\Intern\\AppData\\Local\\Temp\\scoped_dir16220_22809"},"cssSelectorsEnabled":true,"databaseEnabled":false,"handlesAlerts":true,"hasTouchScreen":false,"javascriptEnabled":true,"locationContextEnabled":true,"mobileEmulationEnabled":false,"nativeEvents":true,"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platform":"Windows NT","rotatable":false,"setWindowRect":true,"takesHeapSnapshot":true,"takesScreenshot":true,"unexpectedAlertBehaviour":"","version":"66.0.3359.117","webStorageEnabled":true},"sessionId":"6d7fab266a0ca493d2f894c931ca620b"}}

 

Share this post


Link to post
Share on other sites

@Danp2 

#include <wd_core.au3>
#include <wd_helper.au3>

;####################
;Opening Chrome
;####################
Local $oId = _WD_Startup()
Local $oChrome = _WD_CreateSession('{"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true}}}}');, "args": ["--headless", "--allow-running-insecure-content"] }}}}')

;Start navigating to the login page
_WD_Navigate($oChrome, 'https://www-01.ibm.com/software/passportadvantage/')

 

Share this post


Link to post
Share on other sites

@Danp2 It doesn't? I commented out the headless part of the code, so I can uncomment it real quick so it runs but fails. I also always use Aut2Exe for console writing.

#include <wd_core.au3>
#include <wd_helper.au3>

;####################
;Opening Chrome
;####################
Local $oId = _WD_Startup()
Local $oChrome = _WD_CreateSession('{"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true, "args": ["--headless", "--allow-running-insecure-content"] }}}}')

;Start navigating to the login page
_WD_Navigate($oChrome, 'https://www-01.ibm.com/software/passportadvantage/')

I also have the following as my Global Variables (which I should maybe put into the script with _WD_Option() rather than editing wd_core.au3 directly).

Global $_WD_DRIVER = "C:\PathTo\chromedriver_win32\chromedriver.exe" ; Path to web driver executable
Global $_WD_DRIVER_PARAMS = "" ; Parameters to pass to web driver executable
Global $_WD_BASE_URL = "HTTP://127.0.0.1"
Global $_WD_PORT = 9515 ; Port used for web driver communication
Global $_WD_OHTTP = ObjCreate("winhttp.winhttprequest.5.1")
Global $_WD_HTTPRESULT ; Result of last WinHTTP request

 

Edited by Redd500

Share this post


Link to post
Share on other sites

Okay, so I realized the errors were mostly from the cmd window and not Scite because I don't use Scite I use Notepad++.

#include <wd_core.au3>
#include <wd_helper.au3>

;####################
;Opening Chrome
;####################
_WD_Option("Driver", "C:\Users\Intern\Downloads\chromedriver_win32\chromedriver.exe")
_WD_Option("Port", 9515)
Local $oId = _WD_Startup()
Local $oChrome = _WD_CreateSession('{"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true, "args": ["--headless", "--allow-running-insecure-content"] }}}}')

;Start navigating to the login page
_WD_Navigate($oChrome, 'https://www-01.ibm.com/software/passportadvantage/')
_WD_LinkClickByText($oChrome, "Passport Advantage Online")
_WD_LinkClickByText($oChrome, "Passport Advantage for Business Partners")
_WD_LinkClickByText($oChrome, "Reseller sign in")

This runs 100% fine if I don't do it headlessly.

_WDStartup: OS: WIN_10 WIN32_NT 16299 
_WDStartup: AutoIt: 3.3.14.3
_WDStartup: WD.au3: 0.1.0.9
_WDStartup: Driver: C:\PathTo\chromedriver_win32\chromedriver.exe
_WDStartup: Params: 
_WDStartup: Port:   9515
__WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true, "args": ["--headless", "--allow-running-insecure-content"] }}}}
__WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":false,"acceptSslCerts":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{"chromedriverVersion":"2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb)","userDataDir":"C:\\Users\\Intern\\AppData\\Local\\Temp\\scoped_dir12052_12441"},"cssSelectorsEnabled":true,"databaseEnabled":false,"handlesAlerts":true,"hasTouchScreen":false,"javascriptEnabled":true,"locationContextEnabled":true,"mobileEmulationEnabled":false,"nativeEvents":true,"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platform":"Windows NT","rotatable":false,"setWindowRect":true,"takesHeapSnapshot":true,"takesScreenshot":true,"unexpectedAlertBehaviour":"","version":"66.0.3359.117","webStorageEnabled":true},"sessionId":"a1fb3c4c09bc2f518c2f85665051efd0"}}
_WD_CreateSession: {"value":{"capabilities":{"acceptInsecureCerts":false,"acceptSslCerts":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{"chromedriverVersion":"2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb)","userDataDir":"C:\\Users\\Intern\\AppData\\Local\\Temp\\scoped_dir12052_12441"},"cssSelectorsEnabled":true,"databaseEnabled":false,"handlesAlerts":true,"hasTouchScreen":false,"javascriptEnabled":true,"locationContextEnabled":true,"mobileEmulationEnabled":false,"nativeEvents":true,"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platform":"Windows NT","rotatable":false,"setWindowRect":true,"takesHeapSnapshot":true,"takesScreenshot":true,"unexpectedAlertBehaviour":"","version":"66.0.3359.117","webStorageEnabled":true},"sessionId":"a1fb3c4c09bc2f518c2f85665051efd0"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/a1fb3c4c09bc2f518c2f85665051efd0/url; $sData={"url":"https://www-01.ibm.com/software/passportadvantage/"}
__WD_Post: StatusCode=200; ResponseText={"value":null}
_WD_Navigate: {"value":null}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/a1fb3c4c09bc2f518c2f85665051efd0/element; $sData={"using":"partial link text","value":"Passport Advantage Online"}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"Unable to locate element{\"method\"\"partial link text\",\"selector\"\"Passport Advantage Online\"}(Session infoheadless chrome=66.0.3359.117)","stacktrace":"Backtrace:\n\t(No symbol) [0x00FCE8F0]\n\t(No symbol) [0x00FB7CCD]\n\t(No symbol) [0x00F86D73]\n\t(No symbol) [0x00F55A6E]\n\t(No symbol) [0x00F6F760]\n\t(No symbol) [0x00F66D60]\n\t(No symbol) [0x00F6E35B]\n\t(No symbol) [0x00F66CEB]\n\t(No symbol) [0x00F50D9E]\n\t(No symbol) [0x00F52314]\n\t(No symbol) [0x00F522BA]\n\t(No symbol) [0x00FF38D6]\n\t(No symbol) [0x00FD2AB3]\n\t(No symbol) [0x00FA08C6]\n\t(No symbol) [0x00FA0BF3]\n\t(No symbol) [0x00FA0D03]\n\t(No symbol) [0x00FD4B47]\n\t(No symbol) [0x00FA060F]\n\t(No symbol) [0x00FA177E]\n\t(No symbol) [0x00F9D59B]\n\t(No symbol) [0x00F9D6F5]\n\t(No symbol) [0x00FB000B]\n\tBaseThreadInitThunk [0x76AE8654+36]\n\tRtlGetAppContainerNamedObjectPath [0x77724B17+311]\n\tRtlGetAppContainerNamedObjectPath [0x77724AE7+263]\n"}}
_WD_FindElement: {"value":{"error":"no such element","message":"Unable to locate element{\"method\"\"partial link text\",\"selector\"\"Passport Advantage Online\"}(Session infoheadless chrome=66.0.3359.117)","stacktrace":"Backtrace:\n\t(No symbol) [0x00FCE8F0]\n\t(No symbol) [0x00FB7CCD]\n\t(No symbol) [0x00F86D73]\n\t(No symbol) [0x00F55A6E]\n\t(No symbol) [0x00F6F760]\n\t(No symbol) [0x00F66D60]\n\t(No symbol) [0x00F6E35B]\n\t(No symbol) [0x00F66CEB]\n\t(No symbol) [0x00F50D9E]\n\t(No symbol) [0x00F52314]\n\t(No symbol) [0x00F522BA]\n\t(No symbol) [0x00FF38D6]\n\t(No symbol) [0x00FD2AB3]\n\t(No symbol) [0x00FA08C6]\n\t(No symbol) [0x00FA0BF3]\n\t(No symbol) [0x00FA0D03]\n\t(No symbol) [0x00FD4B47]\n\t(No symbol) [0x00FA060F]\n\t(No symbol) [0x00FA177E]\n\t(No symbol) [0x00F9D59B]\n\t(No symbol) [0x00F9D6F5]\n\t(No symbol) [0x00FB000B]\n\tBaseThreadInitThunk [0x76AE8654+36]\n\tRtlGetAppContainerNamedObjectPath [0x77724B17+311]\n\tRtlGetAppContainerNamedObjectPath [0x77724AE7+263]\n"}}
_WD_FindElement ==> No match: HTTP status = 404
_WD_LinkClickByText ==> No match
__WD_Post: URL=HTTP://127.0.0.1:9515/session/a1fb3c4c09bc2f518c2f85665051efd0/element; $sData={"using":"partial link text","value":"Passport Advantage for Business Partners"}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"Unable to locate element{\"method\"\"partial link text\",\"selector\"\"Passport Advantage for Business Partners\"}(Session infoheadless chrome=66.0.3359.117)","stacktrace":"Backtrace:\n\t(No symbol) [0x00FCE8F0]\n\t(No symbol) [0x00FB7CCD]\n\t(No symbol) [0x00F86D73]\n\t(No symbol) [0x00F55A6E]\n\t(No symbol) [0x00F6F760]\n\t(No symbol) [0x00F66D60]\n\t(No symbol) [0x00F6E35B]\n\t(No symbol) [0x00F66CEB]\n\t(No symbol) [0x00F50D9E]\n\t(No symbol) [0x00F52314]\n\t(No symbol) [0x00F522BA]\n\t(No symbol) [0x00FF38D6]\n\t(No symbol) [0x00FD2AB3]\n\t(No symbol) [0x00FA08C6]\n\t(No symbol) [0x00FA0BF3]\n\t(No symbol) [0x00FA0D03]\n\t(No symbol) [0x00FD4B47]\n\t(No symbol) [0x00FA060F]\n\t(No symbol) [0x00FA177E]\n\t(No symbol) [0x00F9D59B]\n\t(No symbol) [0x00F9D6F5]\n\t(No symbol) [0x00FB000B]\n\tBaseThreadInitThunk [0x76AE8654+36]\n\tRtlGetAppContainerNamedObjectPath [0x77724B17+311]\n\tRtlGetAppContainerNamedObjectPath [0x77724AE7+263]\n"}}
_WD_FindElement: {"value":{"error":"no such element","message":"Unable to locate element{\"method\"\"partial link text\",\"selector\"\"Passport Advantage for Business Partners\"}(Session infoheadless chrome=66.0.3359.117)","stacktrace":"Backtrace:\n\t(No symbol) [0x00FCE8F0]\n\t(No symbol) [0x00FB7CCD]\n\t(No symbol) [0x00F86D73]\n\t(No symbol) [0x00F55A6E]\n\t(No symbol) [0x00F6F760]\n\t(No symbol) [0x00F66D60]\n\t(No symbol) [0x00F6E35B]\n\t(No symbol) [0x00F66CEB]\n\t(No symbol) [0x00F50D9E]\n\t(No symbol) [0x00F52314]\n\t(No symbol) [0x00F522BA]\n\t(No symbol) [0x00FF38D6]\n\t(No symbol) [0x00FD2AB3]\n\t(No symbol) [0x00FA08C6]\n\t(No symbol) [0x00FA0BF3]\n\t(No symbol) [0x00FA0D03]\n\t(No symbol) [0x00FD4B47]\n\t(No symbol) [0x00FA060F]\n\t(No symbol) [0x00FA177E]\n\t(No symbol) [0x00F9D59B]\n\t(No symbol) [0x00F9D6F5]\n\t(No symbol) [0x00FB000B]\n\tBaseThreadInitThunk [0x76AE8654+36]\n\tRtlGetAppContainerNamedObjectPath [0x77724B17+311]\n\tRtlGetAppContainerNamedObjectPath [0x77724AE7+263]\n"}}
_WD_FindElement ==> No match: HTTP status = 404
_WD_LinkClickByText ==> No match
__WD_Post: URL=HTTP://127.0.0.1:9515/session/a1fb3c4c09bc2f518c2f85665051efd0/element; $sData={"using":"partial link text","value":"Reseller sign in"}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"Unable to locate element{\"method\"\"partial link text\",\"selector\"\"Reseller sign in\"}(Session infoheadless chrome=66.0.3359.117)","stacktrace":"Backtrace:\n\t(No symbol) [0x00FCE8F0]\n\t(No symbol) [0x00FB7CCD]\n\t(No symbol) [0x00F86D73]\n\t(No symbol) [0x00F55A6E]\n\t(No symbol) [0x00F6F760]\n\t(No symbol) [0x00F66D60]\n\t(No symbol) [0x00F6E35B]\n\t(No symbol) [0x00F66CEB]\n\t(No symbol) [0x00F50D9E]\n\t(No symbol) [0x00F52314]\n\t(No symbol) [0x00F522BA]\n\t(No symbol) [0x00FF38D6]\n\t(No symbol) [0x00FD2AB3]\n\t(No symbol) [0x00FA08C6]\n\t(No symbol) [0x00FA0BF3]\n\t(No symbol) [0x00FA0D03]\n\t(No symbol) [0x00FD4B47]\n\t(No symbol) [0x00FA060F]\n\t(No symbol) [0x00FA177E]\n\t(No symbol) [0x00F9D59B]\n\t(No symbol) [0x00F9D6F5]\n\t(No symbol) [0x00FB000B]\n\tBaseThreadInitThunk [0x76AE8654+36]\n\tRtlGetAppContainerNamedObjectPath [0x77724B17+311]\n\tRtlGetAppContainerNamedObjectPath [0x77724AE7+263]\n"}}
_WD_FindElement: {"value":{"error":"no such element","message":"Unable to locate element{\"method\"\"partial link text\",\"selector\"\"Reseller sign in\"}(Session infoheadless chrome=66.0.3359.117)","stacktrace":"Backtrace:\n\t(No symbol) [0x00FCE8F0]\n\t(No symbol) [0x00FB7CCD]\n\t(No symbol) [0x00F86D73]\n\t(No symbol) [0x00F55A6E]\n\t(No symbol) [0x00F6F760]\n\t(No symbol) [0x00F66D60]\n\t(No symbol) [0x00F6E35B]\n\t(No symbol) [0x00F66CEB]\n\t(No symbol) [0x00F50D9E]\n\t(No symbol) [0x00F52314]\n\t(No symbol) [0x00F522BA]\n\t(No symbol) [0x00FF38D6]\n\t(No symbol) [0x00FD2AB3]\n\t(No symbol) [0x00FA08C6]\n\t(No symbol) [0x00FA0BF3]\n\t(No symbol) [0x00FA0D03]\n\t(No symbol) [0x00FD4B47]\n\t(No symbol) [0x00FA060F]\n\t(No symbol) [0x00FA177E]\n\t(No symbol) [0x00F9D59B]\n\t(No symbol) [0x00F9D6F5]\n\t(No symbol) [0x00FB000B]\n\tBaseThreadInitThunk [0x76AE8654+36]\n\tRtlGetAppContainerNamedObjectPath [0x77724B17+311]\n\tRtlGetAppContainerNamedObjectPath [0x77724AE7+263]\n"}}
_WD_FindElement ==> No match: HTTP status = 404
_WD_LinkClickByText ==> No match
>Exit code: 0    Time: 7.552

In the cmd window, I get:

Starting ChromeDriver 2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb) on port 9515
Only local connections are allowed.
[0430/174035.091:ERROR:gpu_process_transport_factory.cc(1007)] Lost UI shared context.

DevTools listening on ws://127.0.0.1:12423/devtools/browser/6c85843e-d682-460f-811f-ad5f11c18883
[0430/174037.348:INFO:CONSOLE(2)] "Uncaught ReferenceError: dojo is not defined", source: https://www-01.ibm.com/software/main/js/swg-global.js (2)
[0430/174037.377:INFO:CONSOLE(0)] "Mixed Content: The page at 'https://www-01.ibm.com/software/passportadvantage/' was loaded over HTTPS, but requested an insecure script 'http://www.ibm.com/software/passportadvantage/fix_translate.js'. This request has been blocked; the content must be served over HTTPS.", source: https://www-01.ibm.com/software/passportadvantage/ (0)
[0430/174037.620:INFO:CONSOLE(0)] "The SSL certificate used to load resources from https://idaas.iam.ibm.com will be distrusted in the future. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.", source: https://www-01.ibm.com/software/passportadvantage/ (0)
[0430/174038.812:INFO:CONSOLE(0)] "The SSL certificate used to load resources from https://aa.agkn.com will be distrusted in the future. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.", source: https://bcp.crwdcntrl.net/5/ct=y/c=10026/rand=800688350/pv=y/tp=IBMX/seg=IBMID%3ANo/seg=%23OpR%2383593%23digitalData%20%3A%20user%20%3A%20userInfo%20%3A%20registry_country_code%20%3A%20us/int=%23OpR%2377304%23digitalData%20%3A%20siteID%20%3A%20IBM_GlobalMarketing/int=%23OpR%2378616%23Site%20Visitor%20%3A%20IBM.com/int=%23OpR%2378749%23digitalData%20%3A%20bomboraTopics%20%3A%20Analytics%20Software/int=%23OpR%2378784%23digitalData%20%3A%20bomboraTopics%20%3A%20Security%20Solutions/int=%23OpR%2378785%23digitalData%20%3A%20bomboraTopics%20%3A%20Software%20Licensing/int=%23OpR%2378786%23digitalData%20%3A%20bomboraTopics%20%3A%20Software%20Requirements/int=%23OpR%2378787%23digitalData%20%3A%20bomboraTopics%20%3A%20Software%20as%20a%20Service%20(SaaS)/int=%23OpR%2380062%23IBM%20-%20All%20URL%20Visitors/int=%23OpR%2383413%23digitalData%20%3A%20nluKeywords%20%3A%20Help%20desk/dem=%23OpR%2377294%23digitalData%20%3A%20isIBMer%20%3A%200/dem=%23OpR%2377836%23digitalData%20%3A%20language%20%3A%20en-US/genp=%23OpR%2377458%23digitalData%20%3A%20gbt10%20%3A%20G0000/genp=%23OpR%2377460%23digitalData%20%3A%20gbt17%20%3A%20G17PA/ug=%23OpR%2378009%23https%3A%2F%2Fwww-01.ibm.com%2Fsoftware%2Fpassportadvantage%2F/ug=%23OpR%2381952%23https%3A%2F%2Fwww-01/rt=ifr (0)
[0430/174042.811:INFO:CONSOLE(0)] "The SSL certificate used to load resources from https://uipglob.semasio.net will be distrusted in the future. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.", source: https://pixel.mathtag.com/sync/iframe?mt_uuid=75e75ae7-85b3-4100-ba99-459642dd3316&no_iframe=1&mt_adid=171815&mt_lim=15 (0)

 

Share this post


Link to post
Share on other sites

Okay, so I'm guessing I should attempt Firefox next? IE doesn't work the way I need it to in headless, either, so I'm just going to attempt Firefox.

Share this post


Link to post
Share on other sites

I have a simple code to login to a web page. If I enter a wrong password the website shows an alert message, but the ChromeDriver seems unable to detect the alert. _WD_Alert($session, 'status') shows True but _WD_Alert($session, 'gettext') shows nothing. Please let me know where I'm doing not right.

#include "wd_core.au3"

Local $center = @DesktopWidth/2
Local $url = "http://www.acegolf.com/member/login.php?next_url=%2Fclub%2Fboard%2Fwrite.php%3Fpage%3D%26cb_id%3D353%26gsn%3D3464%26q%3D%26flag%3D"
Local $sDesiredCapabilities
SetupChrome()
_WD_Startup()
$Session = _WD_CreateSession($sDesiredCapabilities)
Sleep(2000)
_WD_Navigate($Session, $url)

Dim $xy = 0
While Not IsArray($xy)
    $xy = PixelSearch($center-260, 0, $center-260, @DesktopHeight, Dec("DFEFC0"))
    Sleep(100)
WEnd

$id = "cycho"
$pass = "12345" ; This is a wrong password

MouseClick("left", $xy[0], $xy[1]+10)
Sleep(200)
Send($id)
Sleep(200)
Send("{TAB}")
Sleep(200)
Send($pass)
Sleep(200)
Send("{ENTER}")
Sleep(2000)

MsgBox(0, '', _WD_Alert($Session, 'gettext'))

_WD_Shutdown()


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

    $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true, "args":["start-maximized", "disable-infobars"] }}}}'
EndFunc

 

Edited by CYCho

Share this post


Link to post
Share on other sites

@CYCho This appears to be an issue with ChromeDriver. When I ran your code in Scite, I received the following results in the Output panel --

__WD_Get: URL=HTTP://127.0.0.1:9515/session/521c93e3fcf3bdb8486c2a6b25425620/alert/text
__WD_Get: StatusCode=500; $sResponseText={"value":{"error":"unexpected alert open","message":"(Session infochrome=66.0.3359.139)","stacktrace":"Backtrace:\n\t(No symbol) [0x0099E8F0]\n\t(No symbol) [0x00987CCD]\n\t(No symbol) [0x00956B11]\n\t(No symbol) [0x0094CCD6]\n\t(No symbol) [0x0094CFC9]\n\t(No symbol) [0x0094CF88]\n\t(No symbol) [0x00955502]\n\t(No symbol) [0x0094D9A2]\n\t(No symbol) [0x0094DD9D]\n\t(No symbol) [0x0094DBEA]\n\t(No symbol) [0x0094D701]\n\t(No symbol) [0x0094D25F]\n\t(No symbol) [0x0094D19F]\n\t(No symbol) [0x009578D0]\n\t(No symbol) [0x009138EE]\n\t(No symbol) [0x00936CEB]\n\t(No symbol) [0x00920D9E]\n\t(No symbol) [0x00922314]\n\t(No symbol) [0x009222BA]\n\t(No symbol) [0x009C38D6]\n\t(No symbol) [0x009A2AB3]\n\t(No symbol) [0x009708C6]\n\t(No symbol) [0x00970BF3]\n\t(No symbol) [0x00970D03]\n\t(No symbol) [0x009A4B47]\n\t(No symbol) [0x0097060F]\n\t(No symbol) [0x0097177E]\n\t(No symbol) [0x0096D59B]\n\t(No symbol) [0x0096D6F5]\n\t(No symbol) [0x0098000B]\n\tBaseThreadInitThunk [0x76CD8484+36]\n\tRtlValidSecurityDescriptor [0x771D2EC0+448]\n\tRtlValidSecurityDescriptor [0x771D2E90+400]\n"}}

This is a stacktrace of the error occurring within the webdriver itself. The code ran as expected when adjusted to use Firefox instead of Chrome.

P.S. Is there a reason you are using PixelSearch, MouseClick, and Send instead of the available commands in the Webdriver UDF?

Share this post


Link to post
Share on other sites

@Danp2 Thank you. I have no experience with FireFox. Maybe I should try it.

PixelSearch, MouseClick, and Send are the functions I am used to for a long time. I didn't care to learn anything else. And you know I am very new to webdriver. What are webdriver alternatives that are better and I should learn?

Edited by CYCho

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Danp2
      Introduction
      This UDF will allow you to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.
      Requirements
      JSON UDF https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn
      WinHTTP UDF https://www.autoitscript.com/forum/topic/84133-winhttp-functions/
      WebDriver for desired browser
      Chrome WebDriver https://sites.google.com/a/chromium.org/chromedriver/downloads FireFox WebDriver https://github.com/mozilla/geckodriver/releases Edge WebDriver https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Source Code
      You will always be able to find the latest version in the GitHub Repo 
      Help / Support
      See the wiki for details on the UDF --
      https://www.autoitscript.com/wiki/WebDriver
      Please post any questions, suggestions or errors in the GH&S thread.
      https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/
    • By Langmeister
      I am once again asking for your experienced assistance. If I open a website that uses notifications I am asked to allow or block them for that website after a few seconds. This notification pops up every time the page gets navigated to, even tho you have clicked on allow for several times. I am explicitly not searching for smth to get rid of "Chrome is being controlled by automated test sw". Instead I am searching for a line of script to disable all notifications by default: like here chrome://settings/content/notifications. 
      This is code should give you an example of what notifications I am talking about:
      #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities, $sSession, $sID _WD_Option("Driver", "C:\Program Files (x86)\AutoIt3\chromedriver.exe") _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}}' _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://webradio.planetradio.de/") _WD_LoadWait($sSession)  
    • By Langmeister
      Hi, I'm sure that this is a simple question regarding webdriver udf but my search on the forum did not result in the exact same scenario that I need. I will adapt it to my corporate needs but at first I want it to work with an example everybody can reproduce if needed.
      I navigate to https://www.daysoftheyear.com/ and want to find out what special day today is. Using the following Code returns the wanted text that today is 'shark awareness day' in the console but it is not pasted in notepad as it is not copied as it probably should be.
      #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities, $sSession, $sID _WD_Option("Driver", "C:\Program Files (x86)\AutoIt3\chromedriver.exe") _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}}' _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.daysoftheyear.com/?timezone_offset=nan") _WD_LoadWait($sSession) Sleep(3000) Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[2]/header/div/div[1]/div/div[2]/h3/a") _WD_ElementAction($sSession, $sElement, 'text') ClipGet() Run("notepad.exe") Sleep(500) Send("^v") Scite returns this, therefore the text has been found but the last mile to paste it to notepad or excel does not work for me.
      __WD_Get: URL=HTTP://127.0.0.1:9515/session/b72166b774d7fefb258b3721fc1d4306/element/657e6b5d-31a9-46a8-85c4-acb7f72bf659/text __WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":"Shark Awareness Day"}... _WD_ElementAction: {"value":"Shark Awareness Day"}... Thanks in advance! 
       
    • By Langmeister
      Hi, I need help performing actions in Salesforce using IE. I used to complete tasks via MouseMove/MouseClick etc. on the Chrome application of SF, but unfortunately this only works for me and not my colleagues due to different positions of things etc. Being unable to get Webdriver UDF or Chromedriver running to interact with the code directly, I chose to look into the IE UDF. ATM I'm trying to tick a specific checkbox in SF which simply allows me to "select all checkboxes" at the same time. Applying the following code on a random website with checkboxes works just fine for me: (in this case selecting cheese checkbox)
      #include <IE.au3> Local $oIE = _IECreate("http://www.echoecho.com/htmlforms09.htm") Local $oSubmit = _IEGetObjByName($oIE, "option3") _IEAction($oSubmit, "click") _IELoadWait($oIE) But applying it to the Salesforce website it does exactly nothing and responds with these warnings/errors:
      The script is exactly the same, except for website and the input name tag of the desired checkbox being different.
      #include <IE.au3> Local $oIE = _IECreate("Corporate Salesforce URL") Local $oSubmit = _IEGetObjByName($oIE, "myPage:myForm:oliListBlock:oliListTable:j_id36") _IEAction($oSubmit, "click") _IELoadWait($oIE) As its working with random websites my guess is that there has to be something done to get it work with SF.
      Hope the more experienced SF+AutoIt pros can help me out here. Thanks in advance!
    • By JohnWIlling
      We are running on a VIrtual Machine via Remote Desktop.  We are having a situation where the loading of the chromedriver.exe is taking longer on the VM than on a physical machine.  It is causing the first call to  WD_Post in _WD_CreateSession to fail.
      To workaround the Issue, I used a simplified version of (_WinAPI_GetTcpTable) UDF to Loop waiting for the driver port to be in the listening state.  At that point, I know that the Post will work:
      Func _WaitForPort($ListenPort) Do Local $tMIB_TCPTABLE = DllStructCreate("dword[6]") Local $aRet = DllCall("Iphlpapi.dll", "DWORD", "GetTcpTable", "struct*", $tMIB_TCPTABLE, "DWORD*", 0, "BOOL", True) Local $dwSize = $aRet[2] $tMIB_TCPTABLE = DllStructCreate("DWORD[" & $dwSize / 4 & "]") $aRet = DllCall("Iphlpapi.dll", "DWORD", "GetTcpTable", "struct*", $tMIB_TCPTABLE, "DWORD*", $dwSize, "BOOL", True) If $aRet[0] <> 0 Then Return SetError(1) Local $iNumEntries = DllStructGetData($tMIB_TCPTABLE, 1, 1) Local $aRes[$iNumEntries][6] For $i = 0 To $iNumEntries - 1 Local $Type = DllStructGetData($tMIB_TCPTABLE, 1, 2 + $i * 5 + 0) $aRet = DllCall("ws2_32.dll", "ushort", "ntohs", "uint", DllStructGetData($tMIB_TCPTABLE, 1, 2 + $i * 5 + 2)) ; local port Local $Port = $aRet[0] ConsoleWrite("Checking Row:" & $i & " State:<" & $Type & "> Port:<" & $Port & ">" & @CRLF) ; Type 2 is LISTENING If $Type = 2 And $Port = $ListenPort Then Return 1; EndIF Next Sleep(500); Until 0; Return 0; EndFunc ;==>_WaitForPort  
×
×
  • Create New...