Jump to content

WebDriver UDF - Help & Support (II)


Danp2
 Share

Recommended Posts

 @Danp2,

I copied chromedriver executable to the script dir and adjusted _WD_Option to point to it.

Now I've got:

_WDStartup: OS:    WIN_81 WIN32_NT 9600 
_WDStartup: AutoIt:    3.3.14.5
_WDStartup: WD.au3:    0.2.0.6
_WDStartup: WinHTTP:    1.6.4.1
_WDStartup: Driver:    C:\Temp\Programacion\A3\WEB Browser\00-WebDriver UDF\chromedriver.exe
_WDStartup: Params:    --log-path="C:\Temp\Programacion\A3\WEB Browser\00-WebDriver UDF\chrome.log"
_WDStartup: Port:    9515
__WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}}
__WD_Post: StatusCode=500; ResponseText={"value":{"error":"session not created","message":"session not created: This version of ChromeDriver only supports Chrome version 81","stacktrace":"Backtrace:\n\tOrdinal0 [0x01205F73+2449267]\n\tOrdinal0 [0x01138361+1606497]\n\tOrdinal0 [0x0102F969+522601]\n\tOrdinal0 [0x00FC05F3+67059]\n\tOrdinal0 [0x00FBCD92+52626]\n\tOrdinal0 [0x00FDC127+180519]\n\tOrdinal0 [0x00FDBF2D+180013]\n\tOrdinal0 [0x00FD9E5B+171611]\n\tOrdinal0 [0x00FC1DD8+73176]\n\tOrdinal0 [0x00FC2E50+77392]\n\tOrdinal0 [0x00FC2DE9+77289]\n\tOrdinal0 [0x0114D8D7+1693911]\n\tGetHandleVerifier [0x012A4036+522726]\n\tGetHandleVerifier [0x012A3D74+522020]\n\tGetHandleVerifier [0x012B9187+609079]\n\tGetHandleVerifier [0x012A48A6+524886]\n\tOrdinal0 [0x01145CBC+1662140]\n\tOrdinal0 [0x0114F23B+1700411]\n\tOrdinal0 [0x0114F3A3+1700771]\n\tOrdinal0 [0x01165215+1790485]\n\tBaseThreadInitThunk [0x77426A14+36]\n\tRtlInitializeExceptionChain [0x77E4ADCF+143]\n\tRtlInitializeExceptionChain [0x77E4AD9A+90]\n"}}
__WD_Post ==> Timeout: {"value":{"error":"session not created","message":"session not created: This version of ChromeDriver only supports Chrome version 81","stacktrace":"Backtrace:\n\tOrdinal0 [0x01205F73+2449267]\n\tOrdinal0 [0x01138361+1606497]\n\tOrdinal0 [0x0102F969+522601]\n\tOrdinal0 [0x00FC05F3+67059]\n\tOrdinal0 [0x00FBCD92+52626]\n\tOrdinal0 [0x00FDC127+180519]\n\tOrdinal0 [0x00FDBF2D+180013]\n\tOrdinal0 [0x00FD9E5B+171611]\n\tOrdinal0 [0x00FC1DD8+73176]\n\tOrdinal0 [0x00FC2E50+77392]\n\tOrdinal0 [0x00FC2DE9+77289]\n\tOrdinal0 [0x0114D8D7+1693911]\n\tGetHandleVerifier [0x012A4036+522726]\n\tGetHandleVerifier [0x012A3D74+522020]\n\tGetHandleVerifier [0x012B9187+609079]\n\tGetHandleVerifier [0x012A48A6+524886]\n\tOrdinal0 [0x01145CBC+1662140]\n\tOrdinal0 [0x0114F23B+1700411]\n\tOrdinal0 [0x0114F3A3+1700771]\n\tOrdinal0 [0x01165215+1790485]\n\tBaseThreadInitThunk [0x77426A14+36]\n\tRtlInitializeExceptionChain [0x77E4ADCF+143]\n\tRtlInitializeExceptionChain [0x77E4AD9A+90]\n"}}
_WD_CreateSession: {"value":{"error":"session not created","message":"session not created: This version of ChromeDriver only supports Chrome version 81","stacktrace":"Backtrace:\n\tOrdinal0 [0x01205F73+2449267]\n\tOrdinal0 [0x01138361+1606497]\n\tOrdinal0 [0x0102F969+522601]\n\tOrdinal0 [0x00FC05F3+67059]\n\tOrdinal0 [0x00FBCD92+52626]\n\tOrdinal0 [0x00FDC127+180519]\n\tOrdinal0 [0x00FDBF2D+180013]\n\tOrdinal0 [0x00FD9E5B+171611]\n\tOrdinal0 [0x00FC1DD8+73176]\n\tOrdinal0 [0x00FC2E50+77392]\n\tOrdinal0 [0x00FC2DE9+77289]\n\tOrdinal0 [0x0114D8D7+1693911]\n\tGetHandleVerifier [0x012A4036+522726]\n\tGetHandleVerifier [0x012A3D74+522020]\n\tGetHandleVerifier [0x012B9187+609079]\n\tGetHandleVerifier [0x012A48A6+524886]\n\tOrdinal0 [0x01145CBC+1662140]\n\tOrdinal0 [0x0114F23B+1700411]\n\tOrdinal0 [0x0114F3A3+1700771]\n\tOrdinal0 [0x01165215+1790485]\n\tBaseThreadInitThunk [0x77426A14+36]\n\tRtlInitializeExceptionChain [0x77E4ADCF+143]\n\tRtlInitializeExceptionChain [0x77E4AD9A+90]\n"}}
_WD_CreateSession ==> Webdriver Exception: HTTP status = 500
__WD_Delete: URL=HTTP://127.0.0.1:9515/session/
__WD_Delete: StatusCode=200; ResponseText={"value":null}
_WD_DeleteSession: {"value":null}

 

and chrome.log is the following:

[1584744550.326][INFO]: Starting ChromeDriver 81.0.4044.69 (6813546031a4bc83f717a2ef7cd4ac6ec1199132-refs/branch-heads/4044@{#776}) on port 9515
[1584744550.327][INFO]: Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1584744550.754][INFO]: [83a4dce5a212461287ff592387e07bca] COMMAND InitSession {
   "capabilities": {
      "alwaysMatch": {
         "goog:chromeOptions": {
            "w3c": true
         }
      }
   }
}
[1584744550.788][INFO]: Populating Preferences file: {
   "alternate_error_pages": {
      "enabled": false
   },
   "autofill": {
      "enabled": false
   },
   "browser": {
      "check_default_browser": false
   },
   "distribution": {
      "import_bookmarks": false,
      "import_history": false,
      "import_search_engine": false,
      "make_chrome_default_for_user": false,
      "skip_first_run_ui": true
   },
   "dns_prefetching": {
      "enabled": false
   },
   "profile": {
      "content_settings": {
         "pattern_pairs": {
            "https://*,*": {
               "media-stream": {
                  "audio": "Default",
                  "video": "Default"
               }
            }
         }
      },
      "default_content_setting_values": {
         "geolocation": 1
      },
      "default_content_settings": {
         "geolocation": 1,
         "mouselock": 1,
         "notifications": 1,
         "popups": 1,
         "ppapi-broker": 1
      },
      "password_manager_enabled": false
   },
   "safebrowsing": {

Link to comment
Share on other sites

Best thing to do is grab the latest version on GitHub, which contains some necessary updates.

https://github.com/dragana-r/autoit-winhttp

Edit: To be clear, you don't want to download the 1.6.4.1 release, which is several years old. You want to download the latest source from the master branch.

Edited by Danp2
Link to comment
Share on other sites

<input class="select2-search__field" type="search" tabindex="0" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox">

This is a dropdown box i want to click then write some text then select the first highlighted result appeared. 

 

Here is my code

$lgnButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//span[@id='select2-headerLoginAsUserSelect-container']")
_WD_ElementAction($sSession, $lgnButton, 'click')
_WD_LoadWait($sSession, 3000)
$lgnButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@class='select2-search__field']")
_WD_ElementAction($sSession, $lgnButton, 'value', "farha")

May you please help? 
I get that error 

__WD_Post: URL=HTTP://127.0.0.1:9515/session/bd9c04d592ff2369746c0a3bf8c51e08/element/7572756e-7c6e-451d-b6cf-f6713aa65780/value; $sData={"id":"7572756e-7c6e-451d-b6cf-f6713aa65780", "text":"farha"}
__WD_Post: StatusCode=400; ResponseText={"value":{"error":"element not interactable","message":"element not interactable\n  (Session info: 
_WD_ElementAction: {"value":{"error":"element not interactable","message":"element not interactable\n  (Session info: c...
_WD_ElementAction ==> Webdriver Exception: {"value":{"error":"element not interactable","message":"element not interactable\n  (Session info:

 

Link to comment
Share on other sites

Is it possible to start the Browser in 'application mode'? (with argument --app, or --app-id xxxx)

For example, I have a web application, similar WhatsApp Web. I added this Website to "Apps" in Chrome. So I have a separate Icon in the task list, which is very helpful. Now I would like to start this "Application" (which is actually a normal website) with AutoIt and Webdriver, so i can automate the login process afterwards.

Many thanks!   

Link to comment
Share on other sites

6 minutes ago, Retaki said:

How can i retrieve value from element? 

Like i want to make sure if the selected element having the value i want or no? 

Also how can i know if the _WD_FindElement has found the required element? like true/false? 

Link to comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...