Jump to content

WebDriver UDF - Help & Support (III)


Danp2
 Share

Recommended Posts

Latest update just released. See below for change log.

Quote

    v0.5.1.0
    - Changed: _WD_GetElementFromPoint
        - Sets @Extended to shown context changed
        - Additional error checking
    - Changed (_WD_ExecuteScript): Add support for return of additional subnodes
    - Added: $_WD_JSON_* constants
    - Chore: Update various functions to use $_WD_JSON_* constants
    - Changed (_WD_GetBrowserVersion): Returns "0" on failure instead of ""             *** Script breaking change ***
    - Changed (_WD_GetWebDriverVersion): Returns "0" on failure instead of "None"         *** Script breaking change ***
    - Changed: _WD_UpdateDriver
        - Added checks for valid installation directory
        - Added check for existing 32/64 bit driver
        - Fixed $bForce / $KEYWORD_NULL implementation
        - Improved version comparison
        - Improved zip extraction
        - Fixed regex used with geckodriver
    - Changed (_WD_Screenshot): Improved error handling
    - Fixed (_WD_GetShadowRoot, _WD_SelectFiles, _WD_SetTimeouts): Correctly initialize return value

 

Link to comment
Share on other sites

Hi @Danp2 I have the very first problem ever. I can't run wd_demo. 

My autoit version: 3.3.14.5 & SciTE version: Version 4.1.2

I'm using release 0.5.1.0 from Github. I also have WinHttp.au3 and Json.au3 in the folder too: 

image.thumb.png.d98d1c303db26195ad396ed3aded667c.png

 

I only change the Browser option as Edge or Chrome. After running the wd_demo, I have the below output: 

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\wd_demo.au3" /UserParams    
+>12:13:31 Starting AutoIt3Wrapper v.19.102.1901.0 SciTE v.4.1.2.0   Keyboard:00000409  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\T00722811\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\T00722811\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.5)  from:C:\Program Files (x86)\AutoIt3  input:D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\wd_demo.au3
+>12:13:32 AU3Check ended.rc:0
>Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\wd_demo.au3"    
+>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
! @ScriptLineNumber = 297

! _WD_Capabilities: API START: 499
- $_WD_CAPS__API: Rows= 1
- $_WD_CAPS__API: Cols= 12
alwaysMatch|||-1||ms:edgeOptions||-1||||0

! _WD_Capabilities: API END: 499


! _WD_Capabilities: JSON START: 499
{
    "capabilities":{
        "alwaysMatch":{
            "ms:edgeOptions":{
                "excludeSwitches":[
                    "enable-automation"
                ]
            }
        }
    }
}
! _WD_Capabilities: JSON END: 499

_WD_IsLatestRelease: True
_WD_IsLatestRelease ==> Success
_WD_Startup: OS:    WIN_10 WIN32_NT 19043 
_WD_Startup: AutoIt:    3.3.14.5
_WD_Startup: WD.au3:    0.5.1.0 (Up to date)
_WD_Startup: WinHTTP:   1.6.4.2
_WD_Startup: Driver:    msedgedriver.exe
_WD_Startup: Params:    --verbose --log-path="D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\msedge.log"
_WD_Startup: Port:  9515
_WD_Startup ==> General Error: Error launching web driver!
+>12:13:41 AutoIt3.exe ended.rc:0
+>12:13:41 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 9.685

 

1. I didn't modify anything in the code nor in the demo. I "think" my browsers are up to date too. What could I be missing? 

2. I tried to open the help file (chm), but the content is empty. I only see the functions on the left, but there's no description on the right. 

Thanks in advance

image.thumb.png.a80e6cb456de76de99cf590897f9c05b.png

 

TY.

Link to comment
Share on other sites

18 minutes ago, taylansan said:

I only change the Browser option as Edge or Chrome. After running the wd_demo, I have the below output: 

In the output you posted, it's looking for the actual webdriver (msedgedriver.exe). Have you installed that in your working directory?

Quote

I tried to open the help file (chm), but the content is empty. I only see the functions on the left, but there's no description on the right. 

You'll need to unblock the file. Details copied from here --

Quote

Please try this step and let us know if it works:

1.     Right click on the .CHM you want to open and click on Properties.

2.     Under the General tab, check the option called Unblock.

3.     Click on Apply and OK.

 

Link to comment
Share on other sites

Hello @Danp2

I wanted to click the "Subscriptions" in the Youtube page. As a first step, I inspected the page and found the details: 

image.thumb.png.a5b3318955165135efdc619bdee8cce3.png

 

Screenshot cannot show properly, this is the details of the element: 

<a id="endpoint" tabindex="-1" class="yt-simple-endpoint style-scope ytd-mini-guide-entry-renderer" title="Subscriptions" href="/feed/subscriptions">
  <yt-icon id="icon" class="guide-icon style-scope ytd-mini-guide-entry-renderer"><svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" class="style-scope yt-icon" style="pointer-events: none; display: block; width: 100%; height: 100%;"><g class="style-scope yt-icon"><path d="M10,18v-6l5,3L10,18z M17,3H7v1h10V3z M20,6H4v1h16V6z M22,9H2v12h20V9z M3,10h18v10H3V10z" class="style-scope yt-icon"></path></g></svg><!--css-build:shady--></yt-icon>
  <span class="title style-scope ytd-mini-guide-entry-renderer">Subscriptions</span>
  <tp-yt-paper-tooltip animation-delay="0" offset="4" position="right" class="style-scope ytd-mini-guide-entry-renderer" role="tooltip" tabindex="-1" hidden="" style="--paper-tooltip-delay-in:0ms;"><!--css-build:shady--><div id="tooltip" class="style-scope tp-yt-paper-tooltip hidden">
  
    Subscriptions
  
</div>
</tp-yt-paper-tooltip>
  <yt-interaction class="style-scope ytd-mini-guide-entry-renderer"><!--css-build:shady--><div class="stroke style-scope yt-interaction"></div><div class="fill style-scope yt-interaction"></div></yt-interaction>
</a>

 

Without knowing too much, I check that:

  • It starts with "a"
  • It has class named as "yt-simple-endpoint style-scope ytd-mini-guide-entry-renderer"
  • It has title as "Subscriptions" 

 

So, I created my code, filling all these informations: 

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


$sDesiredCapabilities = SetupChrome()
_WD_Startup()
$sSession = _WD_CreateSession($sDesiredCapabilities)


_WD_Navigate($sSession, "https://www.youtube.com")

$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//a[class='yt-simple-endpoint style-scope ytd-mini-guide-entry-renderer' and title='Subscriptions']")
_WD_ElementAction($sSession, $sElement, 'click')


MsgBox(0,"","")
_WD_DeleteSession($sSession)
_WD_Shutdown()


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

;~  Local $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": [ "enable-automation"]}}}}'
    _WD_CapabilitiesStartup()
    _WD_CapabilitiesAdd('alwaysMatch', 'chrome')
    _WD_CapabilitiesAdd('w3c', True)
    _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation')
    _WD_CapabilitiesDump(@ScriptLineNumber) ; dump current Capabilities setting to console - only for testing in this demo
    Local $sDesiredCapabilities = _WD_CapabilitiesGet()
    Return $sDesiredCapabilities
EndFunc   ;==>SetupChrome

 

When I look at my $sElement, it seemed like it's too big, and I'm not sure if the browser can find the element I wrote in the path. Yet it didn't: 

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\00 my wd.au3" /UserParams    
+>00:00:30 Starting AutoIt3Wrapper v.19.102.1901.0 SciTE v.4.1.2.0   Keyboard:00000409  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\T00722811\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\T00722811\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.5)  from:C:\Program Files (x86)\AutoIt3  input:D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\00 my wd.au3
+>00:00:30 AU3Check ended.rc:0
>Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\00 my wd.au3"    
+>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
! @ScriptLineNumber = 297

! _WD_Capabilities: API START: 32
- $_WD_CAPS__API: Rows= 1
- $_WD_CAPS__API: Cols= 12
alwaysMatch|||-1||goog:chromeOptions||-1||||0

! _WD_Capabilities: API END: 32


! _WD_Capabilities: JSON START: 32
{
    "capabilities":{
        "alwaysMatch":{
            "goog:chromeOptions":{
                "w3c":true,
                "excludeSwitches":[
                    "enable-automation"
                ]
            }
        }
    }
}
! _WD_Capabilities: JSON END: 32

_WD_IsLatestRelease: True
_WD_IsLatestRelease ==> Success
_WD_Startup: OS:    WIN_10 WIN32_NT 19043 
_WD_Startup: AutoIt:    3.3.14.5
_WD_Startup: WD.au3:    0.5.1.0 (Up to date)
_WD_Startup: WinHTTP:   1.6.4.2
_WD_Startup: Driver:    chromedriver.exe
_WD_Startup: Params:    --verbose --log-path="D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\chrome.log"
_WD_Startup: Port:  9515
__WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={
    "capabilities":{
        "alwaysMatch":{
            "goog:chromeOptions":{
                "w3c":true,
                "excludeSwitches":[
                    "enable-automation"
                ]
            }
        }
    }
}
__WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"97.0....
_WD_CreateSession: {"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"97.0.4692.71","chrome":{"chromedriverVersion":"97.0.4692.71 (adefa7837d02a07a604c1e6eff0b3a09422ab88d-refs/branch-heads/4692@{#1247})","userDataDir":"C:\\Users\\T00722~1\\AppData\\Local\\Temp\\scoped_dir40888_615928999"},"goog:chromeOptions":{"debuggerAddress":"localhost:57086"},"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platformName":"windows","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify","webauthn:extension:credBlob":true,"webauthn:extension:largeBlob":true,"webauthn:virtualAuthenticators":true},"sessionId":"d5c403dd6f40c1ff1471f913cae480ab"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/d5c403dd6f40c1ff1471f913cae480ab/url; $sData={"url":"https://www.youtube.com"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_Navigate: {"value":null}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/d5c403dd6f40c1ff1471f913cae480ab/element; $sData={"using":"xpath","value":"//a[class='yt-simple-endpoint style-scope ytd-mini-guide-entry-renderer' and title='Subscriptions']"}
__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\":\"xpath\",\"selector\":\"//a[class='yt-simple-endpoint style-scope ytd-mini-guide-entry-renderer' and title='Subscriptions']\"}\n  (Session info: chrome=97.0.4692.71)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952E08+1060360]\n\tOrdinal0 [0x0097E49E+1238174]\n\tOrdinal0 [0x0097E69B+1238683]\n\tOrdinal0 [0x009A9252+1413714]\n\tOrdinal0 [0x00997B54+1342292]\n\tOrdinal0 [0x009A75FA+1406458]\n\tOrdinal0 [0x00997976+1341814]\n\tOrdinal0 [0x009736B6+1193654]\n\tOrdinal0 [0x00974546+1197382]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00A61518+2168088]\n\tOrdinal0 [0x00A61660+2168416]\n\tOrdinal0 [0x00A6B330+2208560]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}}
_WD_FindElement: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//a[class='yt-simple-endpoint style-scope ytd-mini-guide-entry-renderer' and title='Subscriptions']\"}\n  (Session info: chrome=97.0.4692.71)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952E08+1060360]\n\tOrdinal0 [0x0097E49E+1238174]\n\tOrdinal0 [0x0097E69B+1238683]\n\tOrdinal0 [0x009A9252+1413714]\n\tOrdinal0 [0x00997B54+1342292]\n\tOrdinal0 [0x009A75FA+1406458]\n\tOrdinal0 [0x00997976+1341814]\n\tOrdinal0 [0x009736B6+1193654]\n\tOrdinal0 [0x00974546+1197382]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00A61518+2168088]\n\tOrdinal0 [0x00A61660+2168416]\n\tOrdinal0 [0x00A6B330+2208560]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}}
_WD_FindElement ==> No match: HTTP status = 404
__WD_Post: URL=HTTP://127.0.0.1:9515/session/d5c403dd6f40c1ff1471f913cae480ab/element//click; $sData={"id":""}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"no such element: Element_id length is invalid\n  (Ses...
__WD_Post ==> No match: {"value":{"error":"no such element","message":"no such element: Element_id length is invalid\n  (Session info: chrome=97.0.4692.71)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952E08+1060360]\n\tOrdinal0 [0x0097DC11+1235985]\n\tOrdinal0 [0x0097FC4E+1244238]\n\tOrdinal0 [0x00974ED6+1199830]\n\tOrdinal0 [0x00997B0C+1342220]\n\tOrdinal0 [0x00974984+1198468]\n\tOrdinal0 [0x00997C14+1342484]\n\tOrdinal0 [0x009A75FA+1406458]\n\tOrdinal0 [0x00997976+1341814]\n\tOrdinal0 [0x009736B6+1193654]\n\tOrdinal0 [0x00974546+1197382]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00A61518+2168088]\n\tOrdinal0 [0x00A61660+2168416]\n\tOrdinal0 [0x00A6B330+2208560]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}}
_WD_ElementAction: {"value":{"error":"no such element","message":"no such element: Element_id length is invalid\n  (Ses...
_WD_ElementAction ==> No match: {"value":{"error":"no such element","message":"no such element: Element_id length is invalid\n  (Session info: chrome=97.0.4692.71)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952E08+1060360]\n\tOrdinal0 [0x0097DC11+1235985]\n\tOrdinal0 [0x0097FC4E+1244238]\n\tOrdinal0 [0x00974ED6+1199830]\n\tOrdinal0 [0x00997B0C+1342220]\n\tOrdinal0 [0x00974984+1198468]\n\tOrdinal0 [0x00997C14+1342484]\n\tOrdinal0 [0x009A75FA+1406458]\n\tOrdinal0 [0x00997976+1341814]\n\tOrdinal0 [0x009736B6+1193654]\n\tOrdinal0 [0x00974546+1197382]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00A61518+2168088]\n\tOrdinal0 [0x00A61660+2168416]\n\tOrdinal0 [0x00A6B330+2208560]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}}
__WD_Delete: URL=HTTP://127.0.0.1:9515/session/d5c403dd6f40c1ff1471f913cae480ab
__WD_Delete: StatusCode=200; ResponseText={"value":null}...
_WD_DeleteSession: {"value":null}
+>00:03:21 AutoIt3.exe ended.rc:0
+>00:03:21 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 171.2

 

In the output, I found this: _WD_FindElement ==> No match: HTTP status = 404

Now I know, I couldn't address the correct thing correctly in the find element. But I don't know how to address this. 

If I just type the address, yeah it will work. But I wanted to manipulate a mouse click on that item. How can I do that?

 

TY.

Link to comment
Share on other sites

I didn't know SelectorsHub, this really helps now. After installing it, something came to my eye that the driver (chromedriver) starts a completely new Chrome without taking any extensions or bookmarks. 

 

This questions is not related to the code, it's somehow related to the driver. If you don't reply, it's fine too. 

 

This is just double-clicking Chrome, I can see my bookmarks and extensions: 

image.png.f57171a3be7aab6cddefbf2f3179a0f0.png

 

But when I run Chrome using chromedriver, it acts like a completely new and untouched browser; no bookmarks and no extensions from the original: 

image.png.8076bf20c58ee8fe0400fad78ccb427b.png

 

After installing SelectorsHub in Chrome launched by chromedriver and closing it, then re-launching another chromedriver: I can't see SelectorsHub anymore either.

How can I force chromedriver to run Chrome with the existing settings (with the bookmarks + extensions)? 

TY.

Link to comment
Share on other sites

HI @taylansan,

I think @Danp2 is referring to wiki > WebDriver > FAQ #3.
In case you do have more questions about XPath selectors/locators (when SelectorsHub shouldn't be enough or precise enough), I offer my help. Because I deal with it almost every day at work 😉 .

Best regards
Sven

________________
Stay innovative!

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Link to comment
Share on other sites

Today I found an interesting demo page:

https://stqatools.com/demo/index.php

It can be handy for developing examples, practice, and solving problems.

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

Hi @mLipok,

that's funny 😁 , because I also do have this page https://demoqa.com/ in my favorites to share some demos to team members at work for educational purposes of how to automated different web elements. I will add your suggested page too, thanks.
 

Quote

It can be handy for developing examples, practice, and solving problems.

I guess you think of using this page for the wd_demo.au3 examples? Absolutely. When I will have more time, I will come up with an pull request regarding this 😀 .

Best regards
Sven

________________
Stay innovative!

Edited by SOLVE-SMART

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Link to comment
Share on other sites

On 1/2/2022 at 5:24 AM, mLipok said:

So the main question is why such usage:

_WD_PrintToPdf($sSession, '{"pageWidth": 29.70, "pageHeight": 42.00}')

does not change the print parameters and thus the PDF file has incorrect page size.

Any body know how to fix this ?

 

I check deeply https://www.w3.org/TR/webdriver/#print-page
And I found solution.

Here is full full set of possible options as a JSON string:

{
    "page":{
            "width": 29.70
            ,"height": 42.00
        }
    ,"margin":{
            "top": 2
            ,"bottom": 2
            ,"left": 2
            ,"right": 2
        }
    ,"scale": 0.5
    ,"orientation":"landscape"
    ,"shrinkToFit": true
    ,"background": true
    ,"pageRanges": [1, "1-1"]
}


btw.
Just now I'm working on examples for wd_demo.au3 and in next step an FAQ in Wiki.

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

Hi, I'm trying to use Webdriver with the current user profile. I tried these: 

$sDesiredCapabilities = SetupChrome2()
_WD_Startup()
_WD_Navigate($sSession, "https://www.youtube.com")

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

    _WD_CapabilitiesStartup()
    _WD_CapabilitiesAdd('alwaysMatch', 'chrome')
    _WD_CapabilitiesAdd('w3c', True)
_WD_CapabilitiesAdd('args', 'user-data-dir', 'C:\Users\' & @UserName & '\AppData\Local\Google\Chrome\User Data\Default') ;This is Attempt1
_WD_CapabilitiesAdd('args', '--profile-directory', Default) ;This is Attempt1
    _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation')
    _WD_CapabilitiesDump(@ScriptLineNumber) ; dump current Capabilities setting to console - only for testing in this demo
    Local $sDesiredCapabilities = _WD_CapabilitiesGet()
    Return $sDesiredCapabilities
EndFunc   ;==>SetupChrome

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

    $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["--user-data-dir=C:\\Users\\' & @UserName & '\\AppData\\Local\\Google\\Chrome\\User Data\\", "--profile-directory=Default"]}}}}' ;This is Attempt2 = It's from WIKI
    Return $sDesiredCapabilities
EndFunc   ;==>SetupChrome

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

    $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["user-data-dir=C:\\Users\\' & @UserName & '\\AppData\\Local\\Google\\Chrome\\User Data\\", "--profile-directory=Default"], "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false }}}}' ;This is Attempt3 = I found from the previous posts
    Return $sDesiredCapabilities
EndFunc   ;==>SetupChrome

 

As you can see, I have 3 attemps: 

  1. I added some parameters in _WD_CapabilitiesAdd: I can navigate to Youtube, but the profile didn't work
  2. I just copied WIKI profile  wiki > WebDriver > FAQ #3: Chrome opened with my profile, but I couldn't navigate to Youtube
  3. I copied Capabilities from other users in the forum: Chrome opened with my profile, but I couldn't navigate to Youtube

 

The output of 2 and 3 seemed very likely to each other. This is the output of 2, which I copied from WIKI: 

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\00 my wd.au3" /UserParams    
+>00:55:15 Starting AutoIt3Wrapper v.19.102.1901.0 SciTE v.4.1.2.0   Keyboard:00000409  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\T00722811\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\T00722811\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.5)  from:C:\Program Files (x86)\AutoIt3  input:D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\00 my wd.au3
+>00:55:15 AU3Check ended.rc:0
>Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\00 my wd.au3"    
+>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
_WD_IsLatestRelease: True
_WD_IsLatestRelease ==> Success
_WD_Startup: OS:    WIN_10 WIN32_NT 19043 
_WD_Startup: AutoIt:    3.3.14.5
_WD_Startup: WD.au3:    0.5.1.0 (Up to date)
_WD_Startup: WinHTTP:   1.6.4.2
_WD_Startup: Driver:    chromedriver.exe
_WD_Startup: Params:    --verbose --log-path="D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\chrome.log"
_WD_Startup: Port:  9515
__WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["--user-data-dir=C:\\Users\\T00722811\\AppData\\Local\\Google\\Chrome\\User Data\\", "--profile-directory=Default"]}}}}
__WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"invalid argument: user data directory is already in ...
__WD_Post ==> Invalid argument: {"value":{"error":"invalid argument","message":"invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952E08+1060360]\n\tOrdinal0 [0x0096E75C+1173340]\n\tOrdinal0 [0x0096AFC1+1159105]\n\tOrdinal0 [0x0099C22F+1360431]\n\tOrdinal0 [0x0099BE9A+1359514]\n\tOrdinal0 [0x00997976+1341814]\n\tOrdinal0 [0x009736B6+1193654]\n\tOrdinal0 [0x00974546+1197382]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00A61518+2168088]\n\tOrdinal0 [0x00A61660+2168416]\n\tOrdinal0 [0x00A6B330+2208560]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}}
_WD_CreateSession: {"value":{"error":"invalid argument","message":"invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952E08+1060360]\n\tOrdinal0 [0x0096E75C+1173340]\n\tOrdinal0 [0x0096AFC1+1159105]\n\tOrdinal0 [0x0099C22F+1360431]\n\tOrdinal0 [0x0099BE9A+1359514]\n\tOrdinal0 [0x00997976+1341814]\n\tOrdinal0 [0x009736B6+1193654]\n\tOrdinal0 [0x00974546+1197382]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00A61518+2168088]\n\tOrdinal0 [0x00A61660+2168416]\n\tOrdinal0 [0x00A6B330+2208560]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}}
_WD_CreateSession ==> Webdriver Exception: HTTP status = 400
__WD_Post: URL=HTTP://127.0.0.1:9515/session//url; $sData={"url":"https://www.youtube.com"}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOr...
__WD_Post ==> Invalid session ID: {"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952CD0+1060048]\n\tOrdinal0 [0x00973190+1192336]\n\tOrdinal0 [0x00997A50+1342032]\n\tOrdinal0 [0x00995A18+1333784]\n\tOrdinal0 [0x009955B9+1332665]\n\tOrdinal0 [0x009352A7+938663]\n\tOrdinal0 [0x009357C3+939971]\n\tOrdinal0 [0x00935B0A+940810]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00935032+938034]\n\tOrdinal0 [0x00934A38+936504]\n\tGetHandleVerifier [0x00D2F50C+2495788]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}}
_WD_Navigate: {"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952CD0+1060048]\n\tOrdinal0 [0x00973190+1192336]\n\tOrdinal0 [0x00997A50+1342032]\n\tOrdinal0 [0x00995A18+1333784]\n\tOrdinal0 [0x009955B9+1332665]\n\tOrdinal0 [0x009352A7+938663]\n\tOrdinal0 [0x009357C3+939971]\n\tOrdinal0 [0x00935B0A+940810]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00935032+938034]\n\tOrdinal0 [0x00934A38+936504]\n\tGetHandleVerifier [0x00D2F50C+2495788]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}}
_WD_Navigate ==> Invalid session ID: HTTP status = 404
__WD_Delete: URL=HTTP://127.0.0.1:9515/session/
__WD_Delete: StatusCode=200; ResponseText={"value":null}...
_WD_DeleteSession: {"value":null}
+>00:55:19 AutoIt3.exe ended.rc:0
+>00:55:19 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 4.337

 

It's telling me to remove user-data-dir parameter. If I remove it, I can navigate but I can't use my profile. 

What did I do wrong that in Attempt 2 that my profile is loaded, but I couldn't navigate? 

 

 

TY.

Link to comment
Share on other sites

 

10 hours ago, mLipok said:

Here is full full set of possible options as a JSON string:

Firefox / Gecko doesn't like numbers in "pageRanges", .. so single page should be enclosed in quotes:

{
    "page":{
            "width": 29.70
            ,"height": 42.00
        }
    ,"margin":{
            "top": 2
            ,"bottom": 2
            ,"left": 2
            ,"right": 2
        }
    ,"scale": 0.5
    ,"orientation":"landscape"
    ,"shrinkToFit": true
    ,"background": true
    ,"pageRanges": ["1", "1-1"]
}

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

8 hours ago, taylansan said:

_WD_CreateSession: {"value":{"error":"invalid argument","message":"invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir"

You can't use the user profile for a webdriver session if it is already in use by another instance of Chrome.

Link to comment
Share on other sites

Hi,

i need some help, I tried to search in the Forum and after a lot of searching I couldn't find the answer.

"https://demo.guru99.com/test/newtours/register.php" i tried to find how I could select the option country menu and select Brazil.

And then a [TAB] and go to the username, but my solution is not working.

_WD_ElementOptionSelect($sSession, $_WD_LOCATOR_ByXPath, "//select[@name='country']")
send("BRAZIL")
send("{TAB}")

The only thing that happens is that my URL in the browser changes in BRAZIL en after that Google.com is there is results from BRAZIL ( https://www.google.com/search?q=BRAZIL)

It looks like the focus is not on my site .....


    

Link to comment
Share on other sites

  • Danp2 changed the title to WebDriver UDF (W3C compliant version) - 01/31/2022

Hi @Danp2,

first of all, thanks for the notification 👍 . I do have two suggestions which could improve the transparency about the project and changes.

  • Let us create a CHANGELOG.md file for the GitHub project and refer to it for the future notifications/updates.
  • Let us use Semantic Versioning to fit better in common versioning expectations.

If you as creator, the other contributors and also the community don't mind, I would prepare a pull request which could be reviewed 😅 .
If you Dan think, to open a GitHub Issue first would be better, I also will do so.


Best regards
Sven

________________
Stay innovative!

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Link to comment
Share on other sites

  • Danp2 changed the title to WebDriver UDF (W3C compliant version) - 07/29/2022
  • 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...