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

 

 

Share this post


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

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Every think is fine after update.


Thank you very much

Reiner

 

 

Share this post


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 Hermes
      Hi, I have a site that has the following elements below: 
      <div>More element here</div> <div>More element here</div> <div>More element here</div> When I do this in Auto It:
      Local $oSelectDiv = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "div") _WD_HighlightElement($sSession, $oSelectDiv, 1) I also tried to add [3], but it doesnt seems to work:
      Local $oSelectDiv = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "div[3]") _WD_HighlightElement($sSession, $oSelectDiv, 1) It always highlight the first one, but I am trying to highlight the 3rd in the list. Is there anyway to select the 3rd div without having to add any class/id in the divs, and without using XPATH? The structure of the elements in that site were built that way.
    • 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 TheOne23
      Hi Danp2,
       
      May I seek your a help and assistance why the page to download the chrome driver version 89 is not accessible.
      Getting below error page:

       
      Thanks in advance.
      TheOne23
    • By Hermes
      I have an html table that displays data along with an excel spreadsheet that has the same data as the html table. I am wanting to only match the Title column in my html table with the Title column in my Excel spreadsheet. If the titles match, click on the Edit hyperlink and continue to loop to next row. The issue I'm experience is its not matching correctly. So far  i've written the codes below:
      <table border="1" class="test"> <tr> <th> UniqueID</th> <th> Title</th> <th> UserID</th> <th> Address</th> <th> Gender </th> </tr> <tr> <td> 1 </td> <td> Title1 </td> <td> 12345 </td> <td> Manila </td> <td> <span> Male </span> </td> </tr> <tr> <td align="center" colspan="5"> <a href="#" class="testlink">Edit</a> </td> </tr> <tr> <td> 2 </td> <td> Title2 </td> <td> 67891 </td> <td> Valenzuela </td> <td> <span> Female </span> </td> </tr> <tr> <td align="center" colspan="5" > <a href="#" class="testlink">Edit</a> </td> </tr> <tr> <td> 3 </td> <td> Title3 </td> <td> 88888 </td> <td> Ohio </td> <td> <span> Male </span> </td> </tr> <tr> <td align="center" colspan="5" > <a href="#" class="testlink">Edit</a> </td> </tr> <tr> <td> 4 </td> <td> Title4 </td> <td> 77777 </td> <td> California </td> <td> <span> Female </span> </td> </tr> <tr> <td align="center" colspan="5" > <a href="#" class="testlink">Edit</a> </td> </tr> <tr> <td> 5 </td> <td> Title5 </td> <td> 33333 </td> <td> Arizona </td> <td> <span> Male </span> </td> </tr> <tr> <td align="center" colspan="5" > <a href="#" class="testlink">Edit</a> </td> </tr> </table> #Include "Chrome.au3" #Include "wd_core.au3" #Include "wd_helper.au3" #Include "Excel.au3" #Include "_HtmlTable2Array.au3" #Include "Array.au3" Local $sDesiredCapabilities, $sSession SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_LoadWait($sSession) _WD_Navigate($sSession, "index.html") Sleep(6000) Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oExcel, "test.xlsx") ; Get the table element $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//table[@class='test']") ; Retrieve HTML $sHTML = _WD_ElementAction($sSession, $sElement, "Property", "outerHTML") ;Local $aTable = _HtmlTableGetWriteToArray($sHTML) Local $aArray1 = _Excel_RangeRead($oWorkbook,1,$oWorkbook.ActiveSheet.Usedrange.Columns("B:B")) Local $aArray2 = _HtmlTableGetWriteToArray($sHTML) ;_ArrayDisplay($aArray1) ;_ArrayDisplay($aArray2) For $i = UBound($aArray1) - 1 To 0 step - 1 For $j = UBound($aArray2) - 1 to 0 step - 1 If $aArray1[$i][1] == $aArray2[$j][1] Then _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//a[contains(@class,'testlink') or contains(text(),'Edit')]") $test1 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//a[contains(@class,'testlink') or contains(text(),'Edit')]") _WD_ElementAction($sSession, $test1, 'click') ;_ArrayDisplay($aArray1) ;_ArrayDelete($aArray1 , $i) ;exitloop EndIf Next Next _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 Would appreciate if anyone can provide tips, or point me in the right direction in doing it.
       
      test.xlsx
    • By goku200
      I'm having some issues with writing to column C when an element is found. It works on C2 but it does not continue to C3, C4, C5, etc..... I'm wanting to write "test" if the element //input[@id='username'] is found  $someUser = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='username']"). I have attached my HTML and Excel file along with my AutoIt code below:
      #Include "wd_core.au3" #Include "wd_helper.au3" #Include "wd_core.au3" #Include "File.au3" #Include "Array.au3" #Include "Excel.au3" Local $sDesiredCapabilities, $sSession _WD_Startup() $Ssession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://127.0.0.1/test.html") _WD_LoadWait($sSession) Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oExcel, "C:\Users\<Username>\Downloads\test.xlsx") Local $aArrayTest1 = _Excel_RangeRead($oWorkbook, 1, $oWorkbook.ActiveSheet.Usedrange.Columns("A:A")) Local $aArrayTest2 = _Excel_RangeRead($oWorkbook, 1, $oWorkbook.ActiveSheet.Usedrange.Columns("B:B")) For $i = 0 To UBound($aArrayTest1) - 1 _WD_Navigate($Ssession, $aArrayTest1[$i]) _WD_LoadWait($sSession) $someUser = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='username']") _WD_SetElementValue($sSession, $someUser, $aArrayTest2[$i]) Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@type='submit'][@value='Submit']") _WD_ElementAction($sSession, $sElement, 'click') _WD_LoadWait($sSession) Sleep(5000) If $someUser Then Local $aArray2D[2] = ["test"] _Excel_RangeWrite($oWorkbook, $oWorkbook.ActiveSheet, $aArray2D, "C2") EndIf Next 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  
      test.html test.xlsx
×
×
  • Create New...