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

@Danp2

Little update about this issue.

I tried to run it with these desired capabilities.

'{"capabilities":{"alwaysMatch":{"chromeOptions":{"addExtensions":"C:\Users\KarlMueller\Desktop\Project CHROME\sso.crx","w3c":true,"enablePassThrough":false}}}}'

But I get this error.

WDStartup: OS:  WIN_10 WIN32_NT 17763 
_WDStartup: AutoIt: 3.3.14.5
_WDStartup: WD.au3: 0.1.0.21
_WDStartup: Driver: chromedriver.exe
_WDStartup: Params: --log-path="C:\Users\KarlMueller\Desktop\Project CHROME\chrome.log"
_WDStartup: Port:   9515
__WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities":{"alwaysMatch":{"chromeOptions":{"addExtensions":"C:\Users\KarlMueller\Desktop\Project CHROME\sso.crx","w3c":true,"enablePassThrough":false}}}}
__WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"invalid argument: missing command parameters","stacktrace":"Backtrace:\n\tOrdinal0 [0x010BA903+1550595]\n\tOrdinal0 [0x0103A701+1025793]\n\tOrdinal0 [0x00FBC6E5+509669]\n\tOrdinal0 [0x00F676FC+161532]\n\tOrdinal0 [0x00F673CA+160714]\n\tOrdinal0 [0x00F4221E+8734]\n\tOrdinal0 [0x00F42606+9734]\n\tOrdinal0 [0x00F42C80+11392]\n\tOrdinal0 [0x010542C7+1131207]\n\tGetHandleVerifier [0x011570FD+523789]\n\tGetHandleVerifier [0x01156E90+523168]\n\tGetHandleVerifier [0x0115E1E7+552695]\n\tGetHandleVerifier [0x011578FA+525834]\n\tOrdinal0 [0x0104B7FC+1095676]\n\tOrdinal0 [0x00F42053+8275]\n\tOrdinal0 [0x00F41DA7+7591]\n\tGetHandleVerifier [0x014BA3BC+4075724]\n\tBaseThreadInitThunk [0x772A0419+25]\n\tRtlGetAppContainerNamedObjectPath [0x778C662D+237]\n\tRtlGetAppContainerNamedObjectPath [0x778C65FD+189]\n"}}
_WD_CreateSession: {"value":{"error":"invalid argument","message":"invalid argument: missing command parameters","stacktrace":"Backtrace:\n\tOrdinal0 [0x010BA903+1550595]\n\tOrdinal0 [0x0103A701+1025793]\n\tOrdinal0 [0x00FBC6E5+509669]\n\tOrdinal0 [0x00F676FC+161532]\n\tOrdinal0 [0x00F673CA+160714]\n\tOrdinal0 [0x00F4221E+8734]\n\tOrdinal0 [0x00F42606+9734]\n\tOrdinal0 [0x00F42C80+11392]\n\tOrdinal0 [0x010542C7+1131207]\n\tGetHandleVerifier [0x011570FD+523789]\n\tGetHandleVerifier [0x01156E90+523168]\n\tGetHandleVerifier [0x0115E1E7+552695]\n\tGetHandleVerifier [0x011578FA+525834]\n\tOrdinal0 [0x0104B7FC+1095676]\n\tOrdinal0 [0x00F42053+8275]\n\tOrdinal0 [0x00F41DA7+7591]\n\tGetHandleVerifier [0x014BA3BC+4075724]\n\tBaseThreadInitThunk [0x772A0419+25]\n\tRtlGetAppContainerNamedObjectPath [0x778C662D+237]\n\tRtlGetAppContainerNamedObjectPath [0x778C65FD+189]\n"}}
_WD_CreateSession ==> Webdriver Exception: invalid argument: missing command parameters
__WD_Post: URL=HTTP://127.0.0.1:9515/session//url; $sData={"url":"https://telekom.de/"}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOrdinal0 [0x010BA903+1550595]\n\tOrdinal0 [0x0103A701+1025793]\n\tOrdinal0 [0x00FBC58E+509326]\n\tOrdinal0 [0x00F50FB9+69561]\n\tOrdinal0 [0x00F68DD7+167383]\n\tOrdinal0 [0x00F677F2+161778]\n\tOrdinal0 [0x00F673CA+160714]\n\tOrdinal0 [0x00F4221E+8734]\n\tOrdinal0 [0x00F42606+9734]\n\tOrdinal0 [0x00F42C80+11392]\n\tOrdinal0 [0x010542C7+1131207]\n\tGetHandleVerifier [0x011570FD+523789]\n\tGetHandleVerifier [0x01156E90+523168]\n\tGetHandleVerifier [0x0115E1E7+552695]\n\tGetHandleVerifier [0x011578FA+525834]\n\tOrdinal0 [0x0104B7FC+1095676]\n\tOrdinal0 [0x00F42053+8275]\n\tOrdinal0 [0x00F41DA7+7591]\n\tGetHandleVerifier [0x014BA3BC+4075724]\n\tBaseThreadInitThunk [0x772A0419+25]\n\tRtlGetAppContainerNamedObjectPath [0x778C662D+237]\n\tRtlGetAppContainerNamedObjectPath [0x778C65FD+189]\n"}}
_WD_Navigate: {"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOrdinal0 [0x010BA903+1550595]\n\tOrdinal0 [0x0103A701+1025793]\n\tOrdinal0 [0x00FBC58E+509326]\n\tOrdinal0 [0x00F50FB9+69561]\n\tOrdinal0 [0x00F68DD7+167383]\n\tOrdinal0 [0x00F677F2+161778]\n\tOrdinal0 [0x00F673CA+160714]\n\tOrdinal0 [0x00F4221E+8734]\n\tOrdinal0 [0x00F42606+9734]\n\tOrdinal0 [0x00F42C80+11392]\n\tOrdinal0 [0x010542C7+1131207]\n\tGetHandleVerifier [0x011570FD+523789]\n\tGetHandleVerifier [0x01156E90+523168]\n\tGetHandleVerifier [0x0115E1E7+552695]\n\tGetHandleVerifier [0x011578FA+525834]\n\tOrdinal0 [0x0104B7FC+1095676]\n\tOrdinal0 [0x00F42053+8275]\n\tOrdinal0 [0x00F41DA7+7591]\n\tGetHandleVerifier [0x014BA3BC+4075724]\n\tBaseThreadInitThunk [0x772A0419+25]\n\tRtlGetAppContainerNamedObjectPath [0x778C662D+237]\n\tRtlGetAppContainerNamedObjectPath [0x778C65FD+189]\n"}}
+>12:03:54 AutoIt3.exe ended.rc:0

 

Link to post
Share on other sites
1 hour ago, rkskaras said:

Is it possible to start Chrome WebDriver with an extension? I tried to add "addExtensions" to $sDesiredCapabilities  but unfortunately, I don't know how. Can you help me with it?

This isn't something I've done, so YMMV with this feedback. I don't believe that "addExtensions" is applicable here since were manually building the DesiredCapacities string. Therefore, I suggest that you try something like this --

'{"capabilities":{"alwaysMatch":{"chromeOptions":{"Extensions":{"C:\Users\KarlMueller\Desktop\Project CHROME\sso.crx"},"w3c":true,"enablePassThrough":false}}}}'

 

Link to post
Share on other sites
3 minutes ago, Danp2 said:

This isn't something I've done, so YMMV with this feedback. I don't believe that "addExtensions" is applicable here since were manually building the DesiredCapacities string. Therefore, I suggest that you try something like this --

'{"capabilities":{"alwaysMatch":{"chromeOptions":{"Extensions":{"C:\Users\KarlMueller\Desktop\Project CHROME\sso.crx"},"w3c":true,"enablePassThrough":false}}}}'

 

Thank you for reply.

But it is not working :/ 

 

I still get this error.

_WDStartup: OS: WIN_10 WIN32_NT 17763 
_WDStartup: AutoIt: 3.3.14.5
_WDStartup: WD.au3: 0.1.0.21
_WDStartup: Driver: chromedriver.exe
_WDStartup: Params: 
_WDStartup: Port:   9515
__WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities":{"alwaysMatch":{"chromeOptions":{"Extensions":{"C:\Users\KarlMueller\Desktop\Project CHROME\sso.crx"},"w3c":true,"enablePassThrough":false}}}}
__WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"invalid argument: missing command parameters","stacktrace":"Backtrace:\n\tOrdinal0 [0x010BA903+1550595]\n\tOrdinal0 [0x0103A701+1025793]\n\tOrdinal0 [0x00FBC6E5+509669]\n\tOrdinal0 [0x00F676FC+161532]\n\tOrdinal0 [0x00F673CA+160714]\n\tOrdinal0 [0x00F4221E+8734]\n\tOrdinal0 [0x00F42606+9734]\n\tOrdinal0 [0x00F42C80+11392]\n\tOrdinal0 [0x010542C7+1131207]\n\tGetHandleVerifier [0x011570FD+523789]\n\tGetHandleVerifier [0x01156E90+523168]\n\tGetHandleVerifier [0x0115E1E7+552695]\n\tGetHandleVerifier [0x011578FA+525834]\n\tOrdinal0 [0x0104B7FC+1095676]\n\tOrdinal0 [0x00F42053+8275]\n\tOrdinal0 [0x00F41DA7+7591]\n\tGetHandleVerifier [0x014BA3BC+4075724]\n\tBaseThreadInitThunk [0x772A0419+25]\n\tRtlGetAppContainerNamedObjectPath [0x778C662D+237]\n\tRtlGetAppContainerNamedObjectPath [0x778C65FD+189]\n"}}
_WD_CreateSession: {"value":{"error":"invalid argument","message":"invalid argument: missing command parameters","stacktrace":"Backtrace:\n\tOrdinal0 [0x010BA903+1550595]\n\tOrdinal0 [0x0103A701+1025793]\n\tOrdinal0 [0x00FBC6E5+509669]\n\tOrdinal0 [0x00F676FC+161532]\n\tOrdinal0 [0x00F673CA+160714]\n\tOrdinal0 [0x00F4221E+8734]\n\tOrdinal0 [0x00F42606+9734]\n\tOrdinal0 [0x00F42C80+11392]\n\tOrdinal0 [0x010542C7+1131207]\n\tGetHandleVerifier [0x011570FD+523789]\n\tGetHandleVerifier [0x01156E90+523168]\n\tGetHandleVerifier [0x0115E1E7+552695]\n\tGetHandleVerifier [0x011578FA+525834]\n\tOrdinal0 [0x0104B7FC+1095676]\n\tOrdinal0 [0x00F42053+8275]\n\tOrdinal0 [0x00F41DA7+7591]\n\tGetHandleVerifier [0x014BA3BC+4075724]\n\tBaseThreadInitThunk [0x772A0419+25]\n\tRtlGetAppContainerNamedObjectPath [0x778C662D+237]\n\tRtlGetAppContainerNamedObjectPath [0x778C65FD+189]\n"}}
_WD_CreateSession ==> Webdriver Exception: invalid argument: missing command parameters
__WD_Post: URL=HTTP://127.0.0.1:9515/session//url; $sData={"url":"https://bi-portal.telekom.de/cognos/bi/"}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOrdinal0 [0x010BA903+1550595]\n\tOrdinal0 [0x0103A701+1025793]\n\tOrdinal0 [0x00FBC58E+509326]\n\tOrdinal0 [0x00F50FB9+69561]\n\tOrdinal0 [0x00F68DD7+167383]\n\tOrdinal0 [0x00F677F2+161778]\n\tOrdinal0 [0x00F673CA+160714]\n\tOrdinal0 [0x00F4221E+8734]\n\tOrdinal0 [0x00F42606+9734]\n\tOrdinal0 [0x00F42C80+11392]\n\tOrdinal0 [0x010542C7+1131207]\n\tGetHandleVerifier [0x011570FD+523789]\n\tGetHandleVerifier [0x01156E90+523168]\n\tGetHandleVerifier [0x0115E1E7+552695]\n\tGetHandleVerifier [0x011578FA+525834]\n\tOrdinal0 [0x0104B7FC+1095676]\n\tOrdinal0 [0x00F42053+8275]\n\tOrdinal0 [0x00F41DA7+7591]\n\tGetHandleVerifier [0x014BA3BC+4075724]\n\tBaseThreadInitThunk [0x772A0419+25]\n\tRtlGetAppContainerNamedObjectPath [0x778C662D+237]\n\tRtlGetAppContainerNamedObjectPath [0x778C65FD+189]\n"}}
_WD_Navigate: {"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOrdinal0 [0x010BA903+1550595]\n\tOrdinal0 [0x0103A701+1025793]\n\tOrdinal0 [0x00FBC58E+509326]\n\tOrdinal0 [0x00F50FB9+69561]\n\tOrdinal0 [0x00F68DD7+167383]\n\tOrdinal0 [0x00F677F2+161778]\n\tOrdinal0 [0x00F673CA+160714]\n\tOrdinal0 [0x00F4221E+8734]\n\tOrdinal0 [0x00F42606+9734]\n\tOrdinal0 [0x00F42C80+11392]\n\tOrdinal0 [0x010542C7+1131207]\n\tGetHandleVerifier [0x011570FD+523789]\n\tGetHandleVerifier [0x01156E90+523168]\n\tGetHandleVerifier [0x0115E1E7+552695]\n\tGetHandleVerifier [0x011578FA+525834]\n\tOrdinal0 [0x0104B7FC+1095676]\n\tOrdinal0 [0x00F42053+8275]\n\tOrdinal0 [0x00F41DA7+7591]\n\tGetHandleVerifier [0x014BA3BC+4075724]\n\tBaseThreadInitThunk [0x772A0419+25]\n\tRtlGetAppContainerNamedObjectPath [0x778C662D+237]\n\tRtlGetAppContainerNamedObjectPath [0x778C65FD+189]\n"}}
+>13:51:51 AutoIt3.exe ended.rc:0

Can it be because of I am using WebDriver version 78.0.3904.70 on Google Chrome version 78.0.3904.87  ?

Link to post
Share on other sites
6 minutes ago, Danp2 said:

@rkskaras The format of DesiredCapabilities is obviously incorrect. I gave a shot at assisting you to fix it, but obviously I was wrong.

Let us know if you come up with a working example. :thumbsup:

:D 

I don't know.

I tried 

{"capabilities":{"alwaysMatch":{"chromeOptions":{"Extensions":"sso.crx","w3c":true,"enablePassThrough":false}}}}

and

'{"capabilities":{"alwaysMatch":{"chromeOptions":{"Extensions":"C:\\Users\\KarlMueller\\Desktop\\Project CHROME\\sso.crx","w3c":true,"enablePassThrough":false}}}}'

and also

'{"capabilities":{"alwaysMatch":{"chromeOptions":{"Extensions":"C://Users//KarlMueller//Desktop//Project CHROME//sso.crx","w3c":true,"enablePassThrough":false}}}}'

I know that the Format is now okay. But it still does not work 

Link to post
Share on other sites

I would suggest to use "goog:chromeOptions" instead of "chromeOptions" and add "excludeSwitches": ["enable-automation"] in the options.

Since I don't have a crx flle, I tested loading extension folder and it worked OK, even though a balloon popped up warning not to use an extension when Chrome is in developer mode. My test capabilities are as below:

$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": ["enable-automation"], "useAutomationExtension": false, ' & _
'"args": ["start-maximized", "load-extension=C:\\users\\cycho\\appdata\\local\\google\\chrome\\user data\\default\\extensions\\pkedcjkdefgpdelpbcmbmeomcjbeemfm\\7819.902.0.1_0"] }}}}'

The extension folder is the folder where manifest.json file for the extension is located.

Link to post
Share on other sites
1 hour ago, CYCho said:

I would suggest to use "goog:chromeOptions" instead of "chromeOptions" and add "excludeSwitches": ["enable-automation"] in the options.

Since I don't have a crx flle, I tested loading extension folder and it worked OK, even though a balloon popped up warning not to use an extension when Chrome is in developer mode. My test capabilities are as below:

$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": ["enable-automation"], "useAutomationExtension": false, ' & _
'"args": ["start-maximized", "load-extension=C:\\users\\cycho\\appdata\\local\\google\\chrome\\user data\\default\\extensions\\pkedcjkdefgpdelpbcmbmeomcjbeemfm\\7819.902.0.1_0"] }}}}'

The extension folder is the folder where manifest.json file for the extension is located.

Wow, Thank you very much! This worked like a charm :) 

 

Link to post
Share on other sites

@Danp2 Can I narrow down the search by doing something like this? 

$wSaveBI = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//li[@id='toolactions_SAVE-tbb'@changed_by_user='False']")

This does not work by the way.  

Basically I am clicking on an element to save my progress but I am wanting to double-check if it was actually saved or not. And the only way to do, I have found (I looked into many possible ways of testing if it was clicked or not), is to narrow the FindElement. 

If the element is clicked or not it has the same id (and everything else is the same. Class and all), but the @changed_by_user is different. (not clicked = false clicked = true)

Is there a way to do something like this?

Link to post
Share on other sites

@Danp2 

15 hours ago, Danp2 said:

@nooneclose This is really an xpath locator question, but I believe something like this should work --

"//li[@id='toolactions_SAVE-tbb' and @changed_by_user='False']"

 

It didn't work. 

I found some documentation on Xpath locator. :)  

If I get it to work I will post the code :D 

Edited by nooneclose
Found sources had to change my questions
Link to post
Share on other sites

Here is the working code for my issue. (Issue was how do I code my script to test if data was properly sent. The button that saves doesn't change and the only difference on the page at all is that buttons element class changes from on to off) Thanks, @Danp2 for telling and showing me Xpath.

Here are the elements I had to work with: (first one is when the save button is unclicked. The second is when its clicked)

<a role="button" id="toolactions_SAVE-tbb_anchor" onkeydown="itemAKey(event,this)" title="Save Work Order CTRL+ALT+S" hotkey="S" eventtype="SAVE" class="on" <img role="button" tabindex="-1" id="toolactions_SAVE-tbb_image" src="nav_icon_save.gif" alt="Save Work Order CTRL+ALT+S" draggable="false"></a>
 

<a role="button" id="toolactions_SAVE-tbb_anchor" onkeydown="itemAKey(event,this)" title="Save Work Order CTRL+ALT+S" hotkey="S" eventtype="SAVE" class="off opacity_20"><img role="button" tabindex="-1" id="toolactions_SAVE-tbb_image" src="nav_icon_save.gif" alt="Save Work Order CTRL+ALT+S" draggable="false"></a>
 

Here is the working code that I used in a do until loop. :D 

Local $wSaveBI = ""
Local $wSavedI = ""

; Loop until the data is saved
Do
    $wSaveBI = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//a[@id='toolactions_SAVE-tbb_anchor' and @class='on']")

    _WD_ElementAction($sSession, $wSaveBI, 'click')
    Sleep(2000)

    $wSavedI = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//a[@id='toolactions_SAVE-tbb_anchor' and contains(@class,'off')]")

    ;ConsoleWrite("Test: " & $wSavedI & @CRLF)

Until $wSavedI <> ""

 

Edited by nooneclose
grammar
Link to post
Share on other sites
1 hour ago, Danp2 said:

@nooneclose You could look into using _WD_WaitElement, which handles the looping for you. :thumbsup:

@Danp2 What are you talking about Willis? You telling me I could have avoided a lot of looping? I'm sad and happy all at the same time. 

I will try this thank you.

Edited by nooneclose
Found the documentation
Link to post
Share on other sites

Here are the command I use

WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='files[]' and @id='inputFile']", 0, 500, True)
$Upload = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='files[]' and @id='inputFile']")
,_WD_ElementAction($sSession, $Upload, 'click')

and here is the debugging part 

__WD_Post: URL=HTTP://127.0.0.1:17556/session/BAC28C55-EE1C-4967-B64D-D7879AB55E49/element; $sData={"using":"xpath","value":"//input[@name='files[]' and @id='inputFile']"}
__WD_Post: StatusCode=200; ResponseText={"value":{"ELEMENT":"efefb6e7-95fa-433f-8e9f-bedfeec2d220","element-6066-11e4-a52e-4f735466cecf":"efefb6e7-95fa-433f-8e9f-bedfeec2d220"}}
_WD_FindElement: {"value":{"ELEMENT":"efefb6e7-95fa-433f-8e9f-bedfeec2d220","element-6066-11e4-a52e-4f735466cecf":"efefb6e7-95fa-433f-8e9f-bedfeec2d220"}}
__WD_Get: URL=HTTP://127.0.0.1:17556/session/BAC28C55-EE1C-4967-B64D-D7879AB55E49/element/efefb6e7-95fa-433f-8e9f-bedfeec2d220/displayed
__WD_Get: StatusCode=500; $iResult = 0; $sResponseText=Unknown error...
_WD_ElementAction: Unknown error...

and nothing happen with element action

It seems that the input file only accept drag and drop or clicking on the left or right button to open file dialog 
 


 

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 TTE26
      For the past two days I've been reading all Wiki pages, installed all the demos etc. but I am still unable to do this simple workflow
      1. I want to use WebDriver UDF to open Chrome (Set chrome option arguments - Window Size, Pixel ratio, device type and platform name, user-agent.)
      2. On new Tab I want to read the tab Title and save it into a TXT file.
      3. I need to save the Session ID with my previosly set Capabilities into a file.
      4. I want to close the chrome window.
      Then
      5. I want to open Chrome again, but with my previosly saved Session ID and Capabilities list from the file.
      6. And minimaze the window state.
      7. After 30 seconds, close the chrome.
      I would really appreciate for the WebDriver UDF Helper file, to have also basic code examples, for non coders. For example how to open a windwow etc., save sessions, etc.
      Anyway, if someone could help me get started and help me with this workflow, that would be much appreaciated. 😔
    • By lapoelkan12
      hi i try to use webdriver  i download it and  download json and  winhttp i try to run it  but  return error
       error: __WinHttpVer(): undefined function.
              Local $sWinHttpVer = __WinHttpVer()
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
       
       

    • 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 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.
       
×
×
  • Create New...