Jump to content
Danp2

WebDriver UDF - Help & Support

Recommended Posts

@Danp2 @error = 0

i can use adblocker but i need to download the extension every time i make a new session.... u can see alot of diffrence between normal chrome window and the new session window i will be very happy if u show me how to turn on extensions 

image.png

Share this post


Link to post
Share on other sites
4 minutes ago, omarjr16 said:

_WDStartup: WD.au3: 0.1.0.10

You should download the latest version

8 minutes ago, omarjr16 said:

_WD_FindElement ==> No match: HTTP status = 404

Your element isn't being found. You may have better luck using a CSS selector instead of xpath in this instance.

Share this post


Link to post
Share on other sites

I've had problems accessing controls where there are spaces between multiple object names.  Whenever I see that, I switch over to using Contains() and do an and for each word

$_WD_LOCATOR_ByXPath, "//button[contains(@class, 'videoAdUiSkipButton') and contains(@class,'videoAdUiAction') and contains(@class,'videoAdUiRedesignedSkipButtonng-binding')]

 


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

Share this post


Link to post
Share on other sites

@BigDaddyO still dont work

My Code:

$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[contains(@class, 'videoAdUiSkipButton') and contains(@class,'videoAdUiAction') and contains(@class,'videoAdUiRedesignedSkipButtonng-binding')]")
 sleep(1000)
ConsoleWrite("'$sElement': " & $sElement & @CRLF) ;returns empty string...?
ConsoleWrite("'Error': " & @error & @CRLF)
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')

Error:

__WD_Post: URL=HTTP://127.0.0.1:9515/session/881d0c1b7786144ad48c7a3ac7e49d2b/element; $sData={"using":"xpath","value":"//button[contains(@class, 'videoAdUiSkipButton') and contains(@class,'videoAdUiAction') and contains(@class,'videoAdUiRedesignedSkipButtonng-binding')]"}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"Unable to locate element{\"method\"\"xpath\",\"selector\"\"//button[contains(@class, 'videoAdUiSkipButton') and contains(@class,'videoAdUiAction') and contains(@class,'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[contains(@class, 'videoAdUiSkipButton') and contains(@class,'videoAdUiAction') and contains(@class,'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': 
'Error': 0
__WD_Get: URL=HTTP://127.0.0.1:9515/session/881d0c1b7786144ad48c7a3ac7e49d2b/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/881d0c1b7786144ad48c7a3ac7e49d2b/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/881d0c1b7786144ad48c7a3ac7e49d2b/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: 142.7

html:

image.png.a6e146792ff18afe084b771850d9c0fe.png

Share this post


Link to post
Share on other sites
#include "wd_helper.au3"
#include "wd_core.au3"

HotKeySet("{F4}", "iWork")

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

$iWork = 0
$_WD_DEBUG = true
$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true, "args":["disable-infobars"]  }}}}'

_WD_Startup()
$sSession= _WD_CreateSession($sDesiredCapabilities)

while 1
while $iWork = 1
 ;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[@class='videoAdUiSkipButton videoAdUiAction videoAdUiRedesignedSkipButtonng-binding']")
 $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[contains(@class, 'videoAdUiSkipButton') and contains(@class,'videoAdUiAction') and contains(@class,'videoAdUiRedesignedSkipButtonng-binding')]")
_WD_ElementAction($sSession,$sElement,'click')
Wend
Wend

Func iWork()
   HotKeySet("{F4}")
   If $iWork = 1 then
      $iWork = 0
   Else
      $iWork = 1
   Endif
   HotKeySet("{F4}", "iWork")
Endfunc

i Want to auto-skip google ads .. adblocker will be better but i didnt  found how to add him to the new session :(

Share this post


Link to post
Share on other sites

Since you are using Chrome, when you do the Inspect to see the html.  If you do Ctrl+F  that will bring up a Find.  You can paste the exact xpath there and if it doesn't find it, then there is something wrong.  You can update the xpath text in the Find box on the fly until it highlights the element you want.

Also, you may want to follow that element tree up and make sure it's not in a frame.


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

Share this post


Link to post
Share on other sites
ChromeOptions options = new ChromeOptions();
options.addExtensions(new File("/path/to/extension.crx"));
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
ChromeDriver driver = new ChromeDriver(capabilities);

can u show me how to call this Chromedriver code using autoit ...

Share this post


Link to post
Share on other sites
1 hour ago, BigDaddyO said:

Also, you may want to follow that element tree up and make sure it's not in a frame.

its in frame what i must do?!

image.png.096b2377deb0b9d0dd2fb9e60fab38c5.png

Share this post


Link to post
Share on other sites

so i must do something like this ?!

$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//iframe[contains(@src,'http://imasdk.googleapis.com/js/core/bridge3.234.1_en.html#goog_')]")
    _WD_FrameEnter($sSession, $sElement)

    $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[contains(@class, 'videoAdUiSkipButton') and contains(@class,'videoAdUiAction') and contains(@class,'videoAdUiRedesignedSkipButtonng-binding')]")
    _WD_ElementAction($sSession,$sElement,'click')

 

Share this post


Link to post
Share on other sites

it didnt work :( 

My Code:

$eFrame = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//iframe[contains(@src,'http://imasdk.googleapis.com/js/core/bridge3.234.1_en.html#goog_')]")
   $FrameEnter = _WD_FrameEnter($sSession, $eFrame)
   $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[contains(@class, 'videoAdUiSkipButton') and contains(@class,'videoAdUiAction') and contains(@class,'videoAdUiRedesignedSkipButtonng-binding')]")
   _WD_ElementAction($sSession,$sElement,'click')

Console:

DStartup: 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\webdriver udf\Projects\chrome.log
_WDStartup: Port:   9515
__WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true, "args":["disable-infobars"]  }}}}
__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_dir10176_23500"},"cssSelectorsEnabled":true,"databaseEnabled":false,"goog:chromeOptions":{"debuggerAddress":"localhost:24682"},"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":"570fd6c710831f389894fdddfd9c6afd"}}
_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_dir10176_23500"},"cssSelectorsEnabled":true,"databaseEnabled":false,"goog:chromeOptions":{"debuggerAddress":"localhost:24682"},"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":"570fd6c710831f389894fdddfd9c6afd"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/570fd6c710831f389894fdddfd9c6afd/url; $sData={"url":"https://youtube.com"}
__WD_Post: StatusCode=200; ResponseText={"value":null}
_WD_Navigate: {"value":null}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/570fd6c710831f389894fdddfd9c6afd/element; $sData={"using":"xpath","value":"//iframe[contains(@src,'http://imasdk.googleapis.com/js/core/bridge3.234.1_en.html#goog_')]"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"c8965b93-c60b-48f2-b8a1-be1d0c2ffd71"}}
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"c8965b93-c60b-48f2-b8a1-be1d0c2ffd71"}}

Finding Frame result (c8965b93-c60b-48f2-b8a1-be1d0c2ffd71)

__WD_Post: URL=HTTP://127.0.0.1:9515/session/570fd6c710831f389894fdddfd9c6afd/frame; $sData={"id":{"element-6066-11e4-a52e-4f735466cecf":"c8965b93-c60b-48f2-b8a1-be1d0c2ffd71"}}
__WD_Post: StatusCode=500; ResponseText={"value":{"error":"unknown error","message":"missing 'ELEMENT'(Session infochrome=69.0.3497.81)","stacktrace":"Backtrace:\n\tOrdinal0 [0x011342E0+803552]\n\tOrdinal0 [0x010DE1BD+451005]\n\tOrdinal0 [0x010B925D+299613]\n\tOrdinal0 [0x010A0EFF+200447]\n\tOrdinal0 [0x01098E6D+167533]\n\tOrdinal0 [0x010A022B+197163]\n\tOrdinal0 [0x01098D3B+167227]\n\tOrdinal0 [0x01082418+74776]\n\tOrdinal0 [0x01083876+79990]\n\tOrdinal0 [0x01083810+79888]\n\tOrdinal0 [0x0113EB32+846642]\n\tOrdinal0 [0x010EA55E+501086]\n\tOrdinal0 [0x010EA883+501891]\n\tOrdinal0 [0x010EAA03+502275]\n\tOrdinal0 [0x0113FE37+851511]\n\tOrdinal0 [0x010EA29F+500383]\n\tOrdinal0 [0x010F47AE+542638]\n\tOrdinal0 [0x010FFABB+588475]\n\tOrdinal0 [0x010FFC25+588837]\n\tOrdinal0 [0x010FEDDB+585179]\n\tBaseThreadInitThunk [0x764E8744+36]\n\tRtlGetAppContainerNamedObjectPath [0x77B558ED+253]\n\tRtlGetAppContainerNamedObjectPath [0x77B558BD+205]\n"}}
_WD_Window: {"value":{"error":"unknown error","message":"missing 'ELEMENT'(Session infochrome=69.0.3497.81)","stacktrace":"Backtrace:\n\tOrdinal0 [0x011342E0+803552]\n\tOrdinal0 [0x010DE1BD+451005]\n\tOrdinal0 [0x010B925D+299613]\n\tOrdinal0 [0x010A0EFF+200447]\n\tOrdinal0 [0x01098E6D+167533]\n\tOrdinal0 [0x010A022B+197163]\n\tOrdinal0 [0x01098D3B+167227]\n\tOrdinal0 [0x01082418+74776]\n\tOrdinal0 [0x01083876+79990]\n\tOrdinal0 [0x01083810+79888]\n\tOrdinal0 [0x0113EB32+846642]\n\tOrdinal0 [0x010EA55E+501086]\n\tOrdinal0 [0x010EA883+501891]\n\tOrdinal0 [0x010EAA03+502275]\n\tOrdinal0 [0x0113FE37+851511]\n\tOrdinal0 [0x010EA29F+500383]\n\tOrdinal0 [0x010F47AE+542638]\n\tOrdinal0 [0x010FFABB+588475]\n\tOrdinal0 [0x010FFC25+588837]\n\tOrdinal0 [0x010FEDDB+585179]\n\tBaseThreadInitThunk [0x764E8744+36]\n\tRtlGetAppContainerNamedObjectPath [0x77B558ED+253]\n\tRtlGetAppContainerNamedObjectPath [0x77B558BD+205]\n"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/570fd6c710831f389894fdddfd9c6afd/element; $sData={"using":"xpath","value":"//button[contains(@class, 'videoAdUiSkipButton') and contains(@class,'videoAdUiAction') and contains(@class,'videoAdUiRedesignedSkipButtonng-binding')]"}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"Unable to locate element{\"method\"\"xpath\",\"selector\"\"//button[contains(@class, 'videoAdUiSkipButton') and contains(@class,'videoAdUiAction') and contains(@class,'videoAdUiRedesignedSkipButtonng-binding')]\"}(Session infochrome=69.0.3497.81)","stacktrace":"Backtrace:\n\tOrdinal0 [0x011342E0+803552]\n\tOrdinal0 [0x010DE1BD+451005]\n\tOrdinal0 [0x010B925D+299613]\n\tOrdinal0 [0x0108777E+96126]\n\tOrdinal0 [0x010A15E0+202208]\n\tOrdinal0 [0x01098EA0+167584]\n\tOrdinal0 [0x010A022B+197163]\n\tOrdinal0 [0x01098D3B+167227]\n\tOrdinal0 [0x01082418+74776]\n\tOrdinal0 [0x01083876+79990]\n\tOrdinal0 [0x01083810+79888]\n\tOrdinal0 [0x0113EB32+846642]\n\tOrdinal0 [0x010EA55E+501086]\n\tOrdinal0 [0x010EA883+501891]\n\tOrdinal0 [0x010EAA03+502275]\n\tOrdinal0 [0x0113FE37+851511]\n\tOrdinal0 [0x010EA29F+500383]\n\tOrdinal0 [0x010F47AE+542638]\n\tOrdinal0 [0x010FFABB+588475]\n\tOrdinal0 [0x010FFC25+588837]\n\tOrdinal0 [0x010FEDDB+585179]\n\tBaseThreadInitThunk [0x764E8744+36]\n\tRtlGetAppContainerNamedObjectPath [0x77B558ED+253]\n\tRtlGetAppContainerNamedObjectPath [0x77B558BD+205]\n"}}
_WD_FindElement: {"value":{"error":"no such element","message":"Unable to locate element{\"method\"\"xpath\",\"selector\"\"//button[contains(@class, 'videoAdUiSkipButton') and contains(@class,'videoAdUiAction') and contains(@class,'videoAdUiRedesignedSkipButtonng-binding')]\"}(Session infochrome=69.0.3497.81)","stacktrace":"Backtrace:\n\tOrdinal0 [0x011342E0+803552]\n\tOrdinal0 [0x010DE1BD+451005]\n\tOrdinal0 [0x010B925D+299613]\n\tOrdinal0 [0x0108777E+96126]\n\tOrdinal0 [0x010A15E0+202208]\n\tOrdinal0 [0x01098EA0+167584]\n\tOrdinal0 [0x010A022B+197163]\n\tOrdinal0 [0x01098D3B+167227]\n\tOrdinal0 [0x01082418+74776]\n\tOrdinal0 [0x01083876+79990]\n\tOrdinal0 [0x01083810+79888]\n\tOrdinal0 [0x0113EB32+846642]\n\tOrdinal0 [0x010EA55E+501086]\n\tOrdinal0 [0x010EA883+501891]\n\tOrdinal0 [0x010EAA03+502275]\n\tOrdinal0 [0x0113FE37+851511]\n\tOrdinal0 [0x010EA29F+500383]\n\tOrdinal0 [0x010F47AE+542638]\n\tOrdinal0 [0x010FFABB+588475]\n\tOrdinal0 [0x010FFC25+588837]\n\tOrdinal0 [0x010FEDDB+585179]\n\tBaseThreadInitThunk [0x764E8744+36]\n\tRtlGetAppContainerNamedObjectPath [0x77B558ED+253]\n\tRtlGetAppContainerNamedObjectPath [0x77B558BD+205]\n"}}
_WD_FindElement ==> No match: HTTP status = 404

Finding The Element result ()

__WD_Post: URL=HTTP://127.0.0.1:9515/session/570fd6c710831f389894fdddfd9c6afd/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 [0x011342E0+803552]\n\tOrdinal0 [0x010DE1BD+451005]\n\tOrdinal0 [0x010B925D+299613]\n\tOrdinal0 [0x010BAF1D+306973]\n\tOrdinal0 [0x010BAE06+306694]\n\tOrdinal0 [0x0108816A+98666]\n\tOrdinal0 [0x0108460D+83469]\n\tOrdinal0 [0x01098E6D+167533]\n\tOrdinal0 [0x010843A8+82856]\n\tOrdinal0 [0x01099081+168065]\n\tOrdinal0 [0x010A022B+197163]\n\tOrdinal0 [0x01098D3B+167227]\n\tOrdinal0 [0x01082418+74776]\n\tOrdinal0 [0x01083876+79990]\n\tOrdinal0 [0x01083810+79888]\n\tOrdinal0 [0x0113EB32+846642]\n\tOrdinal0 [0x010EA55E+501086]\n\tOrdinal0 [0x010EA883+501891]\n\tOrdinal0 [0x010EAA03+502275]\n\tOrdinal0 [0x0113FE37+851511]\n\tOrdinal0 [0x010EA29F+500383]\n\tOrdinal0 [0x010F47AE+542638]\n\tOrdinal0 [0x010FFABB+588475]\n\tOrdinal0 [0x010FFC25+588837]\n\tOrdinal0 [0x010FEDDB+585179]\n\tBaseThreadInitThunk [0x764E8744+36]\n\tRtlGetAppContainerNamedObjectPath [0x77B558ED+253]\n\tRtlGetAppContainerNamedObjectPath [0x77B558BD+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 [0x011342E0+803552]\n\tOrdinal0 [0x010DE1BD+451005]\n\tOrdinal0 [0x010B925D+299613]\n\tOrdinal0 [0x010BAF1D+306973]\n\tOrdinal0 [0x010BAE06+306694]\n\tOrdinal0 [0x0108816A+98666]\n\tOrdinal0 [0x0108460D+83469]\n\tOrdinal0 [0x01098E6D+167533]\n\tOrdinal0 [0x010843A8+82856]\n\tOrdinal0 [0x01099081+168065]\n\tOrdinal0 [0x010A022B+197163]\n\tOrdinal0 [0x01098D3B+167227]\n\tOrdinal0 [0x01082418+74776]\n\tOrdinal0 [0x01083876+79990]\n\tOrdinal0 [0x01083810+79888]\n\tOrdinal0 [0x0113EB32+846642]\n\tOrdinal0 [0x010EA55E+501086]\n\tOrdinal0 [0x010EA883+501891]\n\tOrdinal0 [0x010EAA03+502275]\n\tOrdinal0 [0x0113FE37+851511]\n\tOrdinal0 [0x010EA29F+500383]\n\tOrdinal0 [0x010F47AE+542638]\n\tOrdinal0 [0x010FFABB+588475]\n\tOrdinal0 [0x010FFC25+588837]\n\tOrdinal0 [0x010FEDDB+585179]\n\tBaseThreadInitThunk [0x764E8744+36]\n\tRtlGetAppContainerNamedObjectPath [0x77B558ED+253]\n\tRtlGetAppContainerNamedObjectPath [0x77B558BD+205]\n"}}
>Exit code: 0    Time: 144.6

 

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 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 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 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...