Jump to content
Danp2

WebDriver UDF - Help & Support

Recommended Posts

@BigDaddyO I took a slightly different approach in modifying __WD_Error. Take a look and let me know if you see any issues.

Func __WD_Error($sWhere, $i_WD_ERROR, $sMessage = "")
    Local $sMsg

    Switch $_WD_DEBUG
        Case $_WD_DEBUG_None

        Case $_WD_DEBUG_Error
            If $i_WD_ERROR <> $_WD_ERROR_Success Then ContinueCase

        Case $_WD_DEBUG_Info
            $sMsg = $sWhere & " ==> " & $aWD_ERROR_DESC[$i_WD_ERROR]

            If $sMessage <> "" Then
                $sMsg = $sMsg & ": " & $sMessage
            EndIf

            ConsoleWrite($sMsg & @CRLF)

            If @Compiled Then
                If $_WD_ERROR_MSGBOX And $i_WD_ERROR < 6 Then MsgBox(16, "WD_Core.au3 Error:", $sMsg)
                DllCall("kernel32.dll", "none", "OutputDebugString", "str", $sMsg)
            EndIf
    EndSwitch

    Return $i_WD_ERROR
EndFunc ;==>__WD_Error

 

Share this post


Link to post
Share on other sites

Well, after reading up on what ContinueCase does, I don't see any problems with what you have.

i'll download the latest from GitHub and check it out.


hmm... I guess I have to have a signature...

Share this post


Link to post
Share on other sites

I don't know if it makes a difference here, but remember ContinueCase will execute the code inside the following case without running the comparison test in the next case statement. In other words, it will jump into the next case statement regardless of whether the test in the next Case is true or not.

Edited by BrewManNH

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

I would prefer to do something like that:

Func __WD_Error($sWhere, $i_WD_ERROR, $sMessage = "")
    Local $sMsg = $sWhere & " ==> " & $aWD_ERROR_DESC[$i_WD_ERROR] & ($sMessage <> "" ? ": " & $sMessage : "")

    Switch $_WD_DEBUG
        Case $_WD_DEBUG_None

        Case $_WD_DEBUG_Error
            If $i_WD_ERROR <> $_WD_ERROR_Success Then
                __WD_Error_Debug($sMsg,$i_WD_ERROR)
            EndIf

        Case $_WD_DEBUG_Info
            __WD_Error_Debug($sMsg,$i_WD_ERROR)

    EndSwitch

    Return $i_WD_ERROR
EndFunc   ;==>__WD_Error

Func __WD_Error_Debug($sMsg,$i_WD_ERROR)

    ConsoleWrite($sMsg & @CRLF)

    If @Compiled Then
        If $_WD_ERROR_MSGBOX And $i_WD_ERROR < $_WD_ERROR_Timeout Then MsgBox(16, "WD_Core.au3 Error:", $sMsg)
        DllCall("kernel32.dll", "none", "OutputDebugString", "str", $sMsg)
    EndIf

EndFunc   ;==>_WD_Error_Debug
 

 

 

Sorry about syntax highlighter, I can't load it with my 10kbs connection :S

 

Saludos

 

 

Share this post


Link to post
Share on other sites

Edit:  SOLVED, see below.

I'm trying to run my automation from a server which has some additional security policy and it blocks Chrome Unpacked extensions.

I found a way to get around that by disabling the Automation Extension:  Chromium Bug 1749

per that link:  

You can set the "useAutomationExtension" capability to false.

        ChromeOptions options = new ChromeOptions();
        options.setExperimentalOption("useAutomationExtension", false);
        WebDriver driver = new ChromeDriver(options);

This capability will help to not load Chrome Automation extension. Due to which, "Failed to load extension" popup would not appear.

But please note you will not be able to perform any window resizing/positioning operations without the Chrome automation extension.

 

But I can't figure out how to use that .setExperimentalOption() feature. 

 

I tried 

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

but that didn't work.

 

Found the correct way, not using the experimental and just setting it as a normal option.

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

 

Edited by BigDaddyO

hmm... I guess I have to have a signature...

Share this post


Link to post
Share on other sites

@Danp2 thank you for the help i love u <3 that was so stupid i forget to change the xpath...i need to control a lot of windows in the same time thats why im using loop ;)

Share this post


Link to post
Share on other sites

how can i change it to female?any idea?

<div class="gender" id="genderselect" style="display: inline-block; left: 1040px; top: 185px;">
            <label for="ul-id">
                <button type="button" class="ng-building">
                    Male
                </button>
            </label>
            <ul role="listbox" id="ul-id" class="md-whiteframe-z1" name="ul-id">
                <li role="option" id="selectDisabled"><span id="gen">Gender</span></li>
                <li role="option">Male</li>
                <li role="option">Female</li>>
            </ul>
        </div>

 

Sans titre.png

Share this post


Link to post
Share on other sites
<button class="videoAdUiSkipButton videoAdUiAction videoAdUiRedesignedSkipButton"><div class="videoAdUiSkipButtonExperimentalText videoAdUiFixedPaddingSkipButtonText">Skip Ad</div><div class="videoAdUiExperimentalSkipIcon videoAdUiFixedPaddingSkipButtonIcon"></div></button>

i want to skip google ad by pressing that button but that didnt work idk why :c

my script:

_WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[@class='videoAdUiSkipButton videoAdUiAction videoAdUiRedesignedSkipButton']")
_WD_ElementAction($sSession,$sElement,'click')

Share this post


Link to post
Share on other sites
10 hours ago, omarjr16 said:

how can i change it to female?any idea?

Your code below should work as long as the xpath is correct for the desired LI element. Actually, you need to capture the returned element from _WDFindElement. Otherwise, how does $sElement get its value?

5 hours ago, omarjr16 said:

_WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[@class='videoAdUiSkipButton videoAdUiAction videoAdUiRedesignedSkipButton']") _WD_ElementAction($sSession,$sElement,'click')

See above comment. Post the results from the Scite output panel.

Share this post


Link to post
Share on other sites
$sElement =  _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[@class='videoAdUiSkipButton videoAdUiAction videoAdUiRedesignedSkipButtonng-binding']")
ConsoleWrite("'$sElement': " & $sElement & @CRLF)   ;returns empty string...?
ConsoleWrite("'$sElement' text: " & _WD_ElementAction($sSession, $sElement, 'text') & @CRLF)  ;returns empty string...?
ConsoleWrite("'$sElement' rect: " & _WD_ElementAction($sSession, $sElement, 'rect') & @CRLF)  ;returns empty string...???
_WD_ElementAction($sSession,$sElement,'click')

 

Share this post


Link to post
Share on other sites

@Danp2 ;-;

$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[@class='videoAdUiSkipButton videoAdUiAction videoAdUiRedesignedSkipButtonng-binding']") 
ConsoleWrite("'$sElement': " & $sElement & @CRLF) ;returns empty string...?
ConsoleWrite("'$sElement' text: " & _WD_ElementAction($sSession, $sElement, 'text') & @CRLF) ;returns empty string...??
ConsoleWrite("'$sElement' rect: " & _WD_ElementAction($sSession, $sElement, 'rect') & @CRLF) ;returns empty string...??? 
_WD_ElementAction($sSession,$sElement,'click')
>"C:\Program Files (x86)\autoit\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Admin\Desktop\UDF\udf\chrom\Browserudf - Copie.au3"    
_WDStartup: "chromedriver.exe"  --verbose --log-path=C:\Users\Admin\Desktop\UDF\udf\chrom\chrome2.log 
'$sElement': 
'$sElement' text: 
'$sElement' rect:

Share this post


Link to post
Share on other sites
>"C:\Program Files (x86)\autoit\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Admin\Desktop\UDF\udf\chrom\Browserudf - Copie.au3"    
_WDStartup: OS: WIN_10 WIN32_NT 15063 
_WDStartup: AutoIt: 3.3.14.5
_WDStartup: WD.au3: 0.1.0.10
_WDStartup: Driver: chromedriver.exe
_WDStartup: Params:  --verbose --log-path=C:\Users\Admin\Desktop\UDF\udf\chrom\chrome2.log
_WDStartup: Port:   9515
__WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true } }}}
__WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":false,"acceptSslCerts":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{"chromedriverVersion":"2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e)","userDataDir":"C:\\Users\\Admin\\AppData\\Local\\Temp\\scoped_dir3660_9957"},"cssSelectorsEnabled":true,"databaseEnabled":false,"goog:chromeOptions":{"debuggerAddress":"localhost:3457"},"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":"69.0.3497.81","webStorageEnabled":true},"sessionId":"b2a19e1b631984f79ef5d7035be4d99c"}}
_WD_CreateSession: {"value":{"capabilities":{"acceptInsecureCerts":false,"acceptSslCerts":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{"chromedriverVersion":"2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e)","userDataDir":"C:\\Users\\Admin\\AppData\\Local\\Temp\\scoped_dir3660_9957"},"cssSelectorsEnabled":true,"databaseEnabled":false,"goog:chromeOptions":{"debuggerAddress":"localhost:3457"},"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":"69.0.3497.81","webStorageEnabled":true},"sessionId":"b2a19e1b631984f79ef5d7035be4d99c"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/b2a19e1b631984f79ef5d7035be4d99c/element; $sData={"using":"xpath","value":"//button[@class='videoAdUiSkipButton videoAdUiAction videoAdUiRedesignedSkipButtonng-binding']"}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"Unable to locate element{\"method\"\"xpath\",\"selector\"\"//button[@class='videoAdUiSkipButton videoAdUiAction videoAdUiRedesignedSkipButtonng-binding']\"}(Session infochrome=69.0.3497.81)","stacktrace":"Backtrace:\n\tOrdinal0 [0x002842E0+803552]\n\tOrdinal0 [0x0022E1BD+451005]\n\tOrdinal0 [0x0020925D+299613]\n\tOrdinal0 [0x001D777E+96126]\n\tOrdinal0 [0x001F15E0+202208]\n\tOrdinal0 [0x001E8EA0+167584]\n\tOrdinal0 [0x001F022B+197163]\n\tOrdinal0 [0x001E8D3B+167227]\n\tOrdinal0 [0x001D2418+74776]\n\tOrdinal0 [0x001D3876+79990]\n\tOrdinal0 [0x001D3810+79888]\n\tOrdinal0 [0x0028EB32+846642]\n\tOrdinal0 [0x0023A55E+501086]\n\tOrdinal0 [0x0023A883+501891]\n\tOrdinal0 [0x0023AA03+502275]\n\tOrdinal0 [0x0028FE37+851511]\n\tOrdinal0 [0x0023A29F+500383]\n\tOrdinal0 [0x002447AE+542638]\n\tOrdinal0 [0x0024FABB+588475]\n\tOrdinal0 [0x0024FC25+588837]\n\tOrdinal0 [0x0024EDDB+585179]\n\tBaseThreadInitThunk [0x74DC8744+36]\n\tRtlGetAppContainerNamedObjectPath [0x774958ED+253]\n\tRtlGetAppContainerNamedObjectPath [0x774958BD+205]\n"}}
_WD_FindElement: {"value":{"error":"no such element","message":"Unable to locate element{\"method\"\"xpath\",\"selector\"\"//button[@class='videoAdUiSkipButton videoAdUiAction videoAdUiRedesignedSkipButtonng-binding']\"}(Session infochrome=69.0.3497.81)","stacktrace":"Backtrace:\n\tOrdinal0 [0x002842E0+803552]\n\tOrdinal0 [0x0022E1BD+451005]\n\tOrdinal0 [0x0020925D+299613]\n\tOrdinal0 [0x001D777E+96126]\n\tOrdinal0 [0x001F15E0+202208]\n\tOrdinal0 [0x001E8EA0+167584]\n\tOrdinal0 [0x001F022B+197163]\n\tOrdinal0 [0x001E8D3B+167227]\n\tOrdinal0 [0x001D2418+74776]\n\tOrdinal0 [0x001D3876+79990]\n\tOrdinal0 [0x001D3810+79888]\n\tOrdinal0 [0x0028EB32+846642]\n\tOrdinal0 [0x0023A55E+501086]\n\tOrdinal0 [0x0023A883+501891]\n\tOrdinal0 [0x0023AA03+502275]\n\tOrdinal0 [0x0028FE37+851511]\n\tOrdinal0 [0x0023A29F+500383]\n\tOrdinal0 [0x002447AE+542638]\n\tOrdinal0 [0x0024FABB+588475]\n\tOrdinal0 [0x0024FC25+588837]\n\tOrdinal0 [0x0024EDDB+585179]\n\tBaseThreadInitThunk [0x74DC8744+36]\n\tRtlGetAppContainerNamedObjectPath [0x774958ED+253]\n\tRtlGetAppContainerNamedObjectPath [0x774958BD+205]\n"}}
_WD_FindElement ==> No match: HTTP status = 404
'$sElement': 
__WD_Get: URL=HTTP://127.0.0.1:9515/session/b2a19e1b631984f79ef5d7035be4d99c/element//text
__WD_Get: StatusCode=404; $sResponseText={"value":{"error":"stale element reference","message":"element is not attached to the page document(Session infochrome=69.0.3497.81)","stacktrace":"Backtrace:\n\tOrdinal0 [0x002842E0+803552]\n\tOrdinal0 [0x0022E1BD+451005]\n\tOrdinal0 [0x0020925D+299613]\n\tOrdinal0 [0x0020AF1D+306973]\n\tOrdinal0 [0x0020AE06+306694]\n\tOrdinal0 [0x001D5F01+89857]\n\tOrdinal0 [0x001E8E6D+167533]\n\tOrdinal0 [0x001D43A8+82856]\n\tOrdinal0 [0x001E9081+168065]\n\tOrdinal0 [0x001F022B+197163]\n\tOrdinal0 [0x001E8D3B+167227]\n\tOrdinal0 [0x001D2418+74776]\n\tOrdinal0 [0x001D3876+79990]\n\tOrdinal0 [0x001D3810+79888]\n\tOrdinal0 [0x0028EB32+846642]\n\tOrdinal0 [0x0023A55E+501086]\n\tOrdinal0 [0x0023A883+501891]\n\tOrdinal0 [0x0023AA03+502275]\n\tOrdinal0 [0x0028FE37+851511]\n\tOrdinal0 [0x0023A29F+500383]\n\tOrdinal0 [0x002447AE+542638]\n\tOrdinal0 [0x0024FABB+588475]\n\tOrdinal0 [0x0024FC25+588837]\n\tOrdinal0 [0x0024EDDB+585179]\n\tBaseThreadInitThunk [0x74DC8744+36]\n\tRtlGetAppContainerNamedObjectPath [0x774958ED+253]\n\tRtlGetAppContainerNamedObjectPath [0x774958BD+205]\n"}}
_WD_ElementAction: {"value":{"error":"stale element reference","message":"element is not attached to the page document(Session infochrome=69.0.3497.81)","stacktrace":"Backtrace:\n\tOrdinal0 [0x002842E0+803552]\n\tOrdinal0 [0x0022E1BD+451005]\n\tOrdinal0 [0x0020925D+299613]\n\tOrdinal0 [0x0020AF1D+306973]\n\tOrdinal0 [0x0020AE06+306694]\n\tOrdinal0 [0x001D5F01+89857]\n\tOrdinal0 [0x001E8E6D+167533]\n\tOrdinal0 [0x001D43A8+82856]\n\tOrdinal0 [0x001E9081+168065]\n\tOrdinal0 [0x001F022B+197163]\n\tOrdinal0 [0x001E8D3B+167227]\n\tOrdinal0 [0x001D2418+74776]\n\tOrdinal0 [0x001D3876+79990]\n\tOrdinal0 [0x001D3810+79888]\n\tOrdinal0 [0x0028EB32+846642]\n\tOrdinal0 [0x0023A55E+501086]\n\tOrdinal0 [0x0023A883+501891]\n\tOrdinal0 [0x0023AA03+502275]\n\tOrdinal0 [0x0028FE37+851511]\n\tOrdinal0 [0x0023A29F+500383]\n\tOrdinal0 [0x002447AE+542638]\n\tOrdinal0 [0x0024FABB+588475]\n\tOrdinal0 [0x0024FC25+588837]\n\tOrdinal0 [0x0024EDDB+585179]\n\tBaseThreadInitThunk [0x74DC8744+36]\n\tRtlGetAppContainerNamedObjectPath [0x774958ED+253]\n\tRtlGetAppContainerNamedObjectPath [0x774958BD+205]\n"}}
'$sElement' text: 
__WD_Get: URL=HTTP://127.0.0.1:9515/session/b2a19e1b631984f79ef5d7035be4d99c/element//rect
__WD_Get: StatusCode=404; $sResponseText={"value":{"error":"stale element reference","message":"element is not attached to the page document(Session infochrome=69.0.3497.81)","stacktrace":"Backtrace:\n\tOrdinal0 [0x002842E0+803552]\n\tOrdinal0 [0x0022E1BD+451005]\n\tOrdinal0 [0x0020925D+299613]\n\tOrdinal0 [0x0020AF1D+306973]\n\tOrdinal0 [0x0020AE06+306694]\n\tOrdinal0 [0x001D656C+91500]\n\tOrdinal0 [0x001E8E6D+167533]\n\tOrdinal0 [0x001D43A8+82856]\n\tOrdinal0 [0x001E9081+168065]\n\tOrdinal0 [0x001F022B+197163]\n\tOrdinal0 [0x001E8D3B+167227]\n\tOrdinal0 [0x001D2418+74776]\n\tOrdinal0 [0x001D3876+79990]\n\tOrdinal0 [0x001D3810+79888]\n\tOrdinal0 [0x0028EB32+846642]\n\tOrdinal0 [0x0023A55E+501086]\n\tOrdinal0 [0x0023A883+501891]\n\tOrdinal0 [0x0023AA03+502275]\n\tOrdinal0 [0x0028FE37+851511]\n\tOrdinal0 [0x0023A29F+500383]\n\tOrdinal0 [0x002447AE+542638]\n\tOrdinal0 [0x0024FABB+588475]\n\tOrdinal0 [0x0024FC25+588837]\n\tOrdinal0 [0x0024EDDB+585179]\n\tBaseThreadInitThunk [0x74DC8744+36]\n\tRtlGetAppContainerNamedObjectPath [0x774958ED+253]\n\tRtlGetAppContainerNamedObjectPath [0x774958BD+205]\n"}}
_WD_ElementAction: {"value":{"error":"stale element reference","message":"element is not attached to the page document(Session infochrome=69.0.3497.81)","stacktrace":"Backtrace:\n\tOrdinal0 [0x002842E0+803552]\n\tOrdinal0 [0x0022E1BD+451005]\n\tOrdinal0 [0x0020925D+299613]\n\tOrdinal0 [0x0020AF1D+306973]\n\tOrdinal0 [0x0020AE06+306694]\n\tOrdinal0 [0x001D656C+91500]\n\tOrdinal0 [0x001E8E6D+167533]\n\tOrdinal0 [0x001D43A8+82856]\n\tOrdinal0 [0x001E9081+168065]\n\tOrdinal0 [0x001F022B+197163]\n\tOrdinal0 [0x001E8D3B+167227]\n\tOrdinal0 [0x001D2418+74776]\n\tOrdinal0 [0x001D3876+79990]\n\tOrdinal0 [0x001D3810+79888]\n\tOrdinal0 [0x0028EB32+846642]\n\tOrdinal0 [0x0023A55E+501086]\n\tOrdinal0 [0x0023A883+501891]\n\tOrdinal0 [0x0023AA03+502275]\n\tOrdinal0 [0x0028FE37+851511]\n\tOrdinal0 [0x0023A29F+500383]\n\tOrdinal0 [0x002447AE+542638]\n\tOrdinal0 [0x0024FABB+588475]\n\tOrdinal0 [0x0024FC25+588837]\n\tOrdinal0 [0x0024EDDB+585179]\n\tBaseThreadInitThunk [0x74DC8744+36]\n\tRtlGetAppContainerNamedObjectPath [0x774958ED+253]\n\tRtlGetAppContainerNamedObjectPath [0x774958BD+205]\n"}}
'$sElement' rect: 
__WD_Post: URL=HTTP://127.0.0.1:9515/session/b2a19e1b631984f79ef5d7035be4d99c/element//click; $sData={"id":""}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"stale element reference","message":"element is not attached to the page document(Session infochrome=69.0.3497.81)","stacktrace":"Backtrace:\n\tOrdinal0 [0x002842E0+803552]\n\tOrdinal0 [0x0022E1BD+451005]\n\tOrdinal0 [0x0020925D+299613]\n\tOrdinal0 [0x0020AF1D+306973]\n\tOrdinal0 [0x0020AE06+306694]\n\tOrdinal0 [0x001D816A+98666]\n\tOrdinal0 [0x001D460D+83469]\n\tOrdinal0 [0x001E8E6D+167533]\n\tOrdinal0 [0x001D43A8+82856]\n\tOrdinal0 [0x001E9081+168065]\n\tOrdinal0 [0x001F022B+197163]\n\tOrdinal0 [0x001E8D3B+167227]\n\tOrdinal0 [0x001D2418+74776]\n\tOrdinal0 [0x001D3876+79990]\n\tOrdinal0 [0x001D3810+79888]\n\tOrdinal0 [0x0028EB32+846642]\n\tOrdinal0 [0x0023A55E+501086]\n\tOrdinal0 [0x0023A883+501891]\n\tOrdinal0 [0x0023AA03+502275]\n\tOrdinal0 [0x0028FE37+851511]\n\tOrdinal0 [0x0023A29F+500383]\n\tOrdinal0 [0x002447AE+542638]\n\tOrdinal0 [0x0024FABB+588475]\n\tOrdinal0 [0x0024FC25+588837]\n\tOrdinal0 [0x0024EDDB+585179]\n\tBaseThreadInitThunk [0x74DC8744+36]\n\tRtlGetAppContainerNamedObjectPath [0x774958ED+253]\n\tRtlGetAppContainerNamedObjectPath [0x774958BD+205]\n"}}
_WD_ElementAction: {"value":{"error":"stale element reference","message":"element is not attached to the page document(Session infochrome=69.0.3497.81)","stacktrace":"Backtrace:\n\tOrdinal0 [0x002842E0+803552]\n\tOrdinal0 [0x0022E1BD+451005]\n\tOrdinal0 [0x0020925D+299613]\n\tOrdinal0 [0x0020AF1D+306973]\n\tOrdinal0 [0x0020AE06+306694]\n\tOrdinal0 [0x001D816A+98666]\n\tOrdinal0 [0x001D460D+83469]\n\tOrdinal0 [0x001E8E6D+167533]\n\tOrdinal0 [0x001D43A8+82856]\n\tOrdinal0 [0x001E9081+168065]\n\tOrdinal0 [0x001F022B+197163]\n\tOrdinal0 [0x001E8D3B+167227]\n\tOrdinal0 [0x001D2418+74776]\n\tOrdinal0 [0x001D3876+79990]\n\tOrdinal0 [0x001D3810+79888]\n\tOrdinal0 [0x0028EB32+846642]\n\tOrdinal0 [0x0023A55E+501086]\n\tOrdinal0 [0x0023A883+501891]\n\tOrdinal0 [0x0023AA03+502275]\n\tOrdinal0 [0x0028FE37+851511]\n\tOrdinal0 [0x0023A29F+500383]\n\tOrdinal0 [0x002447AE+542638]\n\tOrdinal0 [0x0024FABB+588475]\n\tOrdinal0 [0x0024FC25+588837]\n\tOrdinal0 [0x0024EDDB+585179]\n\tBaseThreadInitThunk [0x74DC8744+36]\n\tRtlGetAppContainerNamedObjectPath [0x774958ED+253]\n\tRtlGetAppContainerNamedObjectPath [0x774958BD+205]\n"}}
>Exit code: 0    Time: 136.9

@Danp2

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/
      HtmlTable2Array UDF (optional) https://www.autoitscript.com/forum/topic/167679-read-data-from-html-tables-from-raw-html-source/
      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 Jgladden
      Dan - thanks for all that you do - this stuff is great. 
      Hoping you can assist with an issue we are having now that we have moved to Windows 10/Server 2016. The Chrome interactions were working flawlessly until moving over. Now my code fails when attempting to create the session. As you can see, our Chrome install is not in a standard location but I have validated the path to the binary. I have attached some detail below including system info, console output and the chrome log detail. I have tried several recommendations that have seen in various forums but none have made a difference
      Any assistance you can give would be greatly appreciated. 
      Thanks in advance, 
      chrome_Details.txt
    • 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!
×
×
  • Create New...