Jump to content

WebDriver UDF (W3C compliant version) - 2024/09/21


Danp2
 Share

Recommended Posts

2 hours ago, danylarson said:

I had to change the path 

You also took out the StringReplace, which is why you are now receiving that error. You need to either --

  • Replace the backslashes with slashes, or
  • Escape the backslash characters by adding a second backslash

Edit: You could also try removing the "binary" entry all together and see if the Webdriver will automatically locate your installation of Edge

Edited by Danp2
Link to comment
Share on other sites

@Danp2

It Works 

Here is the correct function to add to the demo :  
 

Func SetupEdge()

    _WD_Option('Driver', 'msedgedriver.exe')
    _WD_Option('Port', 9515)

    _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\edge.log"')

    $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"ms:edgeOptions": {"binary": "' & 'c:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}}}}'

EndFunc   ;==>SetupEdge

Great Thanks for your fast answers and patience 

Link to comment
Share on other sites

Dear Dan !
I want use 2 profile .and multithread . (i use cpro)
But all config same port :9515 .
Sometime it working ok . sometime not  :( .
how can i change port for profile 2? or make something for it working?  
Thanks dan

xxxxxxxxxxx

Link to comment
Share on other sites

Hello,
I want to open FireFox with a profile already created. I know the syntax is "-profile", "path / to / profile". This may open FireFox but cannot connect to it (Timeout after 60 seconds). I found out that it was related to port-marionette, but I could not be processed. I heard this was removed from FireFox but one of my friends did it with "Python", and I didn't share it. Looking forward to hearing from you soon.
Sorry, English of me not good. I use Google Translater.

Func SetupGecko()
_WD_Option('Driver', 'geckodriver.exe')
_WD_Option('DriverParams', '--log trace')
_WD_Option('Port', 4444)

$sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true,"moz:firefoxOptions":{"args":["-profile", "C:/Users/<user>/AppData/Local/Temp/rust_mozprofile.UGIMyfYbwKx0"]}}}' ;
EndFunc

 

Edited by hoangvu0905
Link to comment
Share on other sites

On 12/28/2019 at 11:05 PM, Danp2 said:

I believe that this one has worked for me in past testing --

$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["--user-data-dir=C:\\Users\\' & @UserName & '\\AppData\\Local\\Google\\Chrome\\User Data\\", "--profile-directory=Default"]}}}}'

 

great, please give me the same example on firefox browser, i can't make it work on firefox

Link to comment
Share on other sites

8 hours ago, VodkaDiva said:

I want use 2 profile .and multithread . (i use cpro)
But all config same port :9515

You can specify a different "listening" port number for the Webdriver like this --

_WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log" --port=<PORT>')

where you replace <PORT> with the desired port number.

You will also need to tell the UDF the new port number --

_WD_Option('Port', <PORT>)

Autoit doesn't support multithreading. I suggest that you provide a more detailed description of your project so that we can better assist you.

Link to comment
Share on other sites

Sorry ,
I want to open a firefox window, install the addon "https://addons.mozilla.org/en-US/firefox/addon/block-website/" (I already have the * .xpi file). I know it is possible to open a firefox, then copy the file into the extensions folder but it is quite time consuming.
Can I install it using the command of webdriver ?

Link to comment
Share on other sites

  • 3 weeks later...

hello i would like to know if it is possible to simulate a click of a smartphone, in use chrome/Firefox with inspect, consol > toogle device toolbar

 

$click = "//xpathblablablal....']"
_WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, $click, "", 3000)
$clickButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, $click)
_WD_ElementAction($sSession, $clickButton, 'click')

with the browser it works but when I use simulate smartphone click, don't work....

Link to comment
Share on other sites

  • Danp2 changed the title to WebDriver UDF (W3C compliant version) - 2024/09/21
  • Melba23 pinned this topic

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
 Share

×
×
  • Create New...