Jump to content

WebDriver UDF - Help & Support


Recommended Posts

  • Replies 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

This is the "General Help and Support" thread for the WebDriver UDF. The UDF itself can be downloaded here. So if you have any questions, suggestions or errors please post here.

use the _WD_ElementAction function like this: $sValue = _WD_ElementAction($sSession, $sElement, 'attribute', 'src') p.s. ... and remove @src from the xPath: "//img[@alt='NiceGirl']"

Time ago I wrote a function to extract data from  the source HTML code of tables. https://www.autoitscript.com/forum/topic/167679-read-data-from-html-tables-from-raw-html-source/ Seems that that fun

Posted Images

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')]

 

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

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 :(

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.

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

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')

 

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

 

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 levila
      Hi Guys, i just do some codding to automate login to some of the web.
      I manage to do the script but somehow after script done, some weird box popup. and keep looping until i close the main chrome.exe

      here is my code. kinldy pls assist, im very new to webdriver udf.
      #NoTrayIcon #include "wd_core.au3" #include "wd_helper.au3" $_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error Local $sDesiredCapabilities, $sSession SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://someoftheweb.com") _ChromeSetInputValueByName($sSession, "inputName", "Username") _ChromeSetInputValueById($sSession, "inputPassword", "Password") _ChromeSetMouseClick($sSession, "submit", "click") _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, "args":["--no-sandbox"]}}}}' EndFunc Func _ChromeSetInputValueByName($sSession,$name,$Value) $sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='"&$name&"']") _WD_ElementAction($sSession,$sButton,'value', $Value) EndFunc Func _ChromeSetInputValueById($sSession,$Id,$Value) $sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='"&$Id&"']") _WD_ElementAction($sSession,$sButton,'value', $Value) EndFunc Func _ChromeSetMouseClick($sSession,$Id,$Value) $sButton = _WD_FindElement($sSession,$_WD_LOCATOR_ByXPath,"//button[@type='"&$Id&"']") _WD_ElementAction($sSession, $sButton, 'click', $Value) EndFunc  
    • By RohanM
      Hi Team,
      is there is a way to embed the webpage in auto it GUI using webdriver? what I want to do is that, I want to open edge browser inside the AutoIT GUI, in IE we have _IECreateEmbedded function but for the webdriver I am not able to find a function, please help  
      Rohan M
    • 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/205553-webdriver-udf-help-support-iii/
      Previous support threads (Closed)
      https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/
      https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/
       
    • By goku200
      I am trying to change the settings of the print option to Save as PDF and its not changing the settings and clicking on the Save button at the bottom. Here is my script that I have written and the format is correct below. Chrome browser I'm using is 97.0 My script was working fine using Chrome 95.0\ Not sure why its not working now
      It finds the print-preview-app element but not the others.
       
    • By goku200
      I am trying to hit the Return key without having to use the Send keys. I have the following code and its not hitting the Return key. Am I missing something?
      ; Press Return $sAction = '{"actions":[{"type": "key", "id": "keyboard_1", "actions": [{"type": "keyDown", "value": "\uE006"},' ; Pause $sAction &= '{"type": "pause", "duration": 500},' ; Release Return $sAction &= '{"type": "keyUp", "value": "\uE006"}]}]}' _WD_Action($sSession, "actions", $sAction)  
×
×
  • Create New...