Jump to content

Recommended Posts

Hallo Experts,

Your testsite and the examples are very good. Thanks a lot.  

I used your example with Chromewebdriver. The Chrome Browser open, the site will shown, but all other functions not executed.

The Chomedriver.exe Windows shows this text:

Starting ChromeDriver 90.0.4430.24 (4c6d850f087da467d926e8eddb76550aed655991-refs/branch-heads/4430@{#429}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.

DevTools listening on ws://127.0.0.1:54044/devtools/browser/3c17aefd-a104-43e7-8c17-318963cda872
[12848:3100:0501/153128.889:ERROR:device_event_log_impl.cc(214)] [15:31:28.888] USB: usb_device_handle_win.cc:1054 Failed to read descriptor from node connection: Ein an das System angeschlossenes Gerõt funktioniert nicht. (0x1F)
[12848:3100:0501/153128.896:ERROR:device_event_log_impl.cc(214)] [15:31:28.896] USB: usb_device_handle_win.cc:1054 Failed to read descriptor from node connection: Ein an das System angeschlossenes Gerõt funktioniert nicht. (0x1F)

The Error :  A devise connected to the systen does not work (0x1F)

Win 10
Chrome & Driver 90

What i do wrong. Can you help me?

Reiner

 

 

Link to post
Share on other sites

Here is my code:

;Test webdriver

#include "wd_core.au3"
#include "wd_helper.au3"

Global $sDriver ="C:\Program Files\Google\chromedriver.exe"
Local $sDesiredCapabilities, $sSession
SetupChrome()
_WD_Startup()
$sSession = _WD_CreateSession($sDesiredCapabilities)
_WD_Navigate($sSession, "http://demo.guru99.com/test/simple_context_menu.html")
Sleep(2000)
$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[contains(text(),'Double-Click Me To See Alert')]")

If @error = $_WD_ERROR_Success Then
    _WD_ElementActionEx($sSession, $sElement, "doubleclick")
    MsgBox(16,"Test 01","Zeile 18")
EndIf

_WD_Alert($sSession, 'accept')


Func SetupChrome()
    _WD_Option('Driver', $sDriver)
    _WD_Option('Port', 9515)
    _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"')
    $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["start-maximized","disable-infobars"]}}}}'
EndFunc   ;==>SetupChrome

Scite output panel:

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\u4006\Documents\Autolt\Test_Webdriver_01.au3" /UserParams    
+>10:39:38 Starting AutoIt3Wrapper (19.1127.1402.0} from:SciTE.exe (4.2.0.0)  Keyboard:00000407  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0407)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\u4006\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\u4006\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.5)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\u4006\Documents\Autolt\Test_Webdriver_01.au3
+>10:39:38 AU3Check ended.rc:0
>Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\u4006\Documents\Autolt\Test_Webdriver_01.au3"    
+>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+BREAK to Stop.
_WD_IsLatestRelease: False
_WD_IsLatestRelease ==> Success
_WD_Startup: OS:    WIN_10 WIN32_NT 17763 
_WD_Startup: AutoIt:    3.3.14.5
_WD_Startup: WD.au3:    0.4.0.2 (Update available)
_WD_Startup: WinHTTP:   1.6.4.1 (Download latest source at <https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3>)
_WD_Startup: Driver:    C:\Program Files\Google\chromedriver.exe
_WD_Startup: Params:    --log-path="C:\Users\u4006\Documents\Autolt\chrome.log"
_WD_Startup: Port:  9515
__WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["start-maximized","disable-infobars"]}}}}
__WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"90.0....
_WD_CreateSession: {"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"90.0.4430.85","chrome":{"chromedriverVersion":"90.0.4430.24 (4c6d850f087da467d926e8eddb76550aed655991-refs/branch-heads/4430@{#429})","userDataDir":"C:\\Users\\u4006\\AppData\\Local\\Temp\\scoped_dir6712_1748131622"},"goog:chromeOptions":{"debuggerAddress":"localhost:56716"},"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platformName":"windows","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify","webauthn:extension:largeBlob":true,"webauthn:virtualAuthenticators":true},"sessionId":"a028f603c90cee6aeea0a342b98c2be8"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/a028f603c90cee6aeea0a342b98c2be8/url; $sData={"url":"http://demo.guru99.com/test/simple_context_menu.html"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_Navigate: {"value":null}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/a028f603c90cee6aeea0a342b98c2be8/element; $sData={"using":"xpath","value":"//button[contains(text(),'Double-Click Me To See Alert')]"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"5b43fe9d-19fe-4764-a41d-8d44e4920f5d"}}...
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"5b43fe9d-19fe-4764-a41d-8d44e4920f5d"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/a028f603c90cee6aeea0a342b98c2be8/actions; $sData={"actions":[{"id":"hover","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration":100,"x":0,"y":0,"type":"pointerMove","origin":{"ELEMENT":"5b43fe9d-19fe-4764-a41d-8d44e4920f5d","element-6066-11e4-a52e-4f735466cecf":"5b43fe9d-19fe-4764-a41d-8d44e4920f5d"}},{"button":0,"type":"pointerDown"},{"button":0,"type":"pointerUp"},{"button":0,"type":"pointerDown"},{"button":0,"type":"pointerUp"}]}]}]}
__WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"invalid argument: missing command parameters","stack...
__WD_Post ==> Invalid argument: {"value":{"error":"invalid argument","message":"invalid argument: missing command parameters","stacktrace":"Backtrace:\n\tOrdinal0 [0x0056C013+2474003]\n\tOrdinal0 [0x005029C1+2042305]\n\tOrdinal0 [0x00412F68+1060712]\n\tOrdinal0 [0x00455003+1331203]\n\tOrdinal0 [0x003F4F3F+937791]\n\tOrdinal0 [0x003F5446+939078]\n\tOrdinal0 [0x003F5721+939809]\n\tGetHandleVerifier [0x006F96FC+1590332]\n\tGetHandleVerifier [0x007A8614+2306900]\n\tGetHandleVerifier [0x005F9E93+543699]\n\tGetHandleVerifier [0x005F92CE+540686]\n\tOrdinal0 [0x005086BA+2066106]\n\tOrdinal0 [0x003F4CD0+937168]\n\tOrdinal0 [0x003F4688+935560]\n\tGetHandleVerifier [0x007D494C+2487948]\n\tBaseThreadInitThunk [0x753E0419+25]\n\tRtlGetAppContainerNamedObjectPath [0x772474ED+237]\n\tRtlGetAppContainerNamedObjectPath [0x772474BD+189]\n"}}
_WD_Action: {"value":{"error":"invalid argument","message":"invalid argument: missing command parameters","stacktrace":"Backtrace:\n\tOrdinal0 [0x0056C013+2474003]\n\tOrdinal0 [0x005029C1+2042305]\n\tOrdinal0 [0x00412F68+1060712]\n\tOrdinal0 [0x00455003+1331203]\n\tOrdinal0 [0x003F4F3F+937791]\n\tOrdinal0 [0x003F5446+939078]\n\tOrdinal0 [0x003F5721+939809]\n\tGetHandleVerifier [0x006F96FC+1590332]\n\tGetHandleVerifier [0x007A8614+2306900]\n\tGetHandleVerifier [0x005F9E93+543699]\n\tGetHandleVerifier [0x005F92CE+540686]\n\tOrdinal0 [0x005086BA+2066106]\n\tOrdinal0 [0x003F4CD0+937168]\n\tOrdinal0 [0x003F4688+935560]\n\tGetHandleVerifier [0x007D494C+2487948]\n\tBaseThreadInitThunk [0x753E0419+25]\n\tRtlGetAppContainerNamedObjectPath [0x772474ED+237]\n\tRtlGetAppContainerNamedObjectPath [0x772474BD+189]\n"}}
_WD_Action ==> Invalid argument: HTTP status = 400
_WD_ElementActionEx ==> Invalid argument
__WD_Post: URL=HTTP://127.0.0.1:9515/session/a028f603c90cee6aeea0a342b98c2be8/alert/accept; $sData={}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such alert","message":"no such alert\n  (Session info: chrome=90.0.4430.85)","...
__WD_Post ==> Webdriver Exception: {"value":{"error":"no such alert","message":"no such alert\n  (Session info: chrome=90.0.4430.85)","stacktrace":"Backtrace:\n\tOrdinal0 [0x0056C013+2474003]\n\tOrdinal0 [0x005029C1+2042305]\n\tOrdinal0 [0x00412E30+1060400]\n\tOrdinal0 [0x0040CABB+1034939]\n\tOrdinal0 [0x00422841+1124417]\n\tOrdinal0 [0x0045687C+1337468]\n\tOrdinal0 [0x00422356+1123158]\n\tOrdinal0 [0x004566DB+1337051]\n\tOrdinal0 [0x00433427+1192999]\n\tOrdinal0 [0x004342EE+1196782]\n\tOrdinal0 [0x00434279+1196665]\n\tGetHandleVerifier [0x006F96FC+1590332]\n\tGetHandleVerifier [0x007A8614+2306900]\n\tGetHandleVerifier [0x005F9E93+543699]\n\tGetHandleVerifier [0x005F92CE+540686]\n\tOrdinal0 [0x005086BA+2066106]\n\tOrdinal0 [0x0050D1C8+2085320]\n\tOrdinal0 [0x0050D308+2085640]\n\tOrdinal0 [0x005167F3+2123763]\n\tBaseThreadInitThunk [0x753E0419+25]\n\tRtlGetAppContainerNamedObjectPath [0x772474ED+237]\n\tRtlGetAppContainerNamedObjectPath [0x772474BD+189]\n"}}
_WD_Alert: {"value":{"error":"no such alert","message":"no such alert\n  (Session info: chrome=90.0.4430.85)","stacktrace":"Backtrace:\n\tOrdinal0 [0x0056C013+2474003]\n\tOrdinal0 [0x005029C1+2042305]\n\tOrdinal0 [0x00412E30+1060400]\n\tOrdinal0 [0x0040CABB+1034939]\n\tOrdinal0 [0x00422841+1124417]\n\tOrdinal0 [0x0045687C+1337468]\n\tOrdinal0 [0x00422356+1123158]\n\tOrdinal0 [0x004566DB+1337051]\n\tOrdinal0 [0x00433427+1192999]\n\tOrdinal0 [0x004342EE+1196782]\n\tOrdinal0 [0x00434279+1196665]\n\tGetHandleVerifier [0x006F96FC+1590332]\n\tGetHandleVerifier [0x007A8614+2306900]\n\tGetHandleVerifier [0x005F9E93+543699]\n\tGetHandleVerifier [0x005F92CE+540686]\n\tOrdinal0 [0x005086BA+2066106]\n\tOrdinal0 [0x0050D1C8+2085320]\n\tOrdinal0 [0x0050D308+2085640]\n\tOrdinal0 [0x005167F3+2123763]\n\tBaseThreadInitThunk [0x753E0419+25]\n\tRtlGetAppContainerNamedObjectPath [0x772474ED+237]\n\tRtlGetAppContainerNamedObjectPath [0x772474BD+189]\n"}}
_WD_Alert ==> Webdriver Exception: {"value":{"error":"no such alert","message":"no such alert\n  (Session info: chrome=90.0.4430.85)","stacktrace":"Backtrace:\n\tOrdinal0 [0x0056C013+2474003]\n\tOrdinal0 [0x005029C1+2042305]\n\tOrdinal0 [0x00412E30+1060400]\n\tOrdinal0 [0x0040CABB+1034939]\n\tOrdinal0 [0x00422841+1124417]\n\tOrdinal0 [0x0045687C+1337468]\n\tOrdinal0 [0x00422356+1123158]\n\tOrdinal0 [0x004566DB+1337051]\n\tOrdinal0 [0x00433427+1192999]\n\tOrdinal0 [0x004342EE+1196782]\n\tOrdinal0 [0x00434279+1196665]\n\tGetHandleVerifier [0x006F96FC+1590332]\n\tGetHandleVerifier [0x007A8614+2306900]\n\tGetHandleVerifier [0x005F9E93+543699]\n\tGetHandleVerifier [0x005F92CE+540686]\n\tOrdinal0 [0x005086BA+2066106]\n\tOrdinal0 [0x0050D1C8+2085320]\n\tOrdinal0 [0x0050D308+2085640]\n\tOrdinal0 [0x005167F3+2123763]\n\tBaseThreadInitThunk [0x753E0419+25]\n\tRtlGetAppContainerNamedObjectPath [0x772474ED+237]\n\tRtlGetAppContainerNamedObjectPath [0x772474BD+189]\n"}}
+>10:39:52 AutoIt3.exe ended.rc:0
+>10:39:52 AutoIt3Wrapper Finished.

Regards

Reiner

Link to post
Share on other sites

Create an account or sign in to comment

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

Create an account

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

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By mLipok
      Recently I start wd_capabilities.au3 project on my side.
      I think this is time to share to AutoIt community.
      Check attached UDF: wd_capabilities.au3

      Here is a scratch example showing how to use them:
      #include "wd_helper.au3" #include "wd_capabilities.au3" _Example() Func _Example() ........ ........ ........ _WD_Capabilities_Build_Arguments(Null) ; CLEANUP ARGS _WD_Capabilities_Build_Arguments('--headless') _WD_Capabilities_Build_Arguments('start-maximized') _WD_Capabilities_Build_Arguments('disable-infobars') _WD_Capabilities_Build_Arguments('user-data-dir', 'C:\Users\' & @UserName & '\AppData\Local\Google\Chrome\User Data\Default') Local $s_WD_Capabilities_Arguments = _WD_Capabilities_Build_Arguments(Default) ; GET ARGS _WD_Capabilities_Build_Preferences(Null) ; CLEANUP PREFS If $s_Download_dir Then _WD_Capabilities_Build_Preferences('download.default_directory', $s_Download_dir) Local $s_WD_Capabilities_Preferences = _WD_Capabilities_Build_Preferences(Default) ; GET PREFS Local $s_Desired_Capabilities = _WD_Capabilities_Build_JSON('chrome', $s_WD_Capabilities_Arguments, $s_WD_Capabilities_Preferences) Local $WD_SESSION = _WD_CreateSession($s_Desired_Capabilities) ........ ........ ........ EndFunc  
      I plan to publish the code on GitHub.
      In the indefinite future, when the project becomes more functional, if @Danp2 accepts it, I hope it may be included in the main WebDriver UDF.

      I am waiting for yours feedback and help in the further development of this project.

      REMARK 1:
      As so far this UDF only supports GoogleChrome.
      Adding support for other browsers shouldn't be difficult, I just didn't need to.

      REMARK 2:
      For now, this project is working but still as a early BETA, so please do not discuss, ask questions, or post examples or snippets of code that pertain to any function of this UDF in other part of this forum, until it is found acceptable. Simply: discusion and tests only here in this topic.


      Regards,
      @mLipok
       
    • 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 Hermes
      I have Index.html where it contains a frame with a source "frame1.html". I can select/highlight elements in index.html but unable to select/highlight elements inside the frame with the src "frame1.html", the autoit output is throwing error:
      __WD_Post: URL=HTTP://127.0.0.1:9515/session/2143396006437be4005db3b84acc1496/element/8be1c3c4-5bb1-42b1-8cde-7954765cbc61/element; $sData={"using":"css selector","value":"frameset:nth-of-type(1)"} __WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\... __WD_Post ==> No match: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"css selector\",\"selector\":\"frameset:nth-of-type(1)\"}\n (Session info: chrome=90.0.4430.212)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00FCE7D3+124883]\n\tOrdinal0 [0x00FCE7B1+124849]\n\tGetHandleVerifier [0x01218688+193832]\n\tGetHandleVerifier [0x0123C478+340760]\n\tGetHandleVerifier [0x012361F1+315537]\n\tGetHandleVerifier [0x012516BA+427354]\n\tGetHandleVerifier [0x01236176+315414]\n\tGetHandleVerifier [0x0125174A+427498]\n\tGetHandleVerifier [0x0125D6EB+476555]\n\tGetHandleVerifier [0x0125154B+426987]\n\tGetHandleVerifier [0x01234FFD+310941]\n\tGetHandleVerifier [0x01235D8E+314414]\n\tGetHandleVerifier [0x01235D19+314297]\n\tGetHandleVerifier [0x012F31EC+1089676]\n\tGetHandleVerifier [0x012F17C9+1082985]\n\tGetHandleVerifier [0x012F13A3+1081923]\n\tGetHandleVerifier [0x013ED9FD+2115741]\n\tOrdinal0 [0x0111B82E+1488942]\n\tOrdinal0 [0x010B5A7D+1071741]\n\tOrdinal0 [0x010B559B+1070491]\n\tOrdinal0 [0x010B54B1+1070257]\n\tOrdinal0 [0x010EFF53+1310547]\n\tBaseThreadInitThunk [0x770662C4+36]\n\tRtlSubscribeWnfStateChangeNotification [0x776B1B69+1081]\n\tRtlSubscribeWnfStateChangeNotification [0x776B1B34+1028]\n"}} Auto IT Script:
      #Include "wd_core.au3" #Include "wd_helper.au3" Local $sDesiredCapabilities, $sSession SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, 'index.html') _WD_LoadWait($sSession) Local $index = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "frameset:nth-of-type(1)") Local $index1 = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "frameset:nth-of-type(1)", $index) Local $index2 = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "frame:nth-of-type(1)", $index1) Local $index3 = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "frameset:nth-of-type(1)", $index2) _WD_HighlightElement($sSession, $index2, 1) _WD_HighlightElement($sSession, $index3, 1) _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":["start-maximized","disable-infobars"]}}}}' EndFunc ;==>SetupChrome  

      frame1.html index.html
    • By Hermes
      Hi, sometimes when I run my script in GUI (SciTe Editor) or as an executable file, the chrome driver launches but the chrome browser does not but when I re-run the script again - chrome driver launches and so does the browser. Here is the error that I'm getting:
      __WD_Post: StatusCode=0; ResponseText=WinHTTP request timed out before Webdriver... __WD_Post ==> Send / Recv error: WinHTTP request timed out before Webdriver _WD_CreateSession: WinHTTP request timed out before Webdriver _WD_CreateSession ==> Webdriver Exception: HTTP status = 0 Just wondering if there's a way to re-launch both the driver and browser without having to rerun the script/executable.
       
       
    • By SkysLastChance
      I am using web driver and xpaths to automate chrome. 
      I am able to edit everything I need to until I get these pop ups. Then when I try to find the xpath it act like it does not exist. 
      This code below is working to find input fields on the main page of the site. But, if I try the same thing for ones in the popover it will not find it. 😕
      $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//*[substring(@id, string-length(@id) - string-length('_3') + 1 ) = '_3']") _WD_ElementAction($sSession, $sElement, 'value', "TEST") Here is the html

      Any idea why it is not finding the element inside these pop overs?
       
       
      HTML:
       
×
×
  • Create New...