danp2 / au3webdriver Goto Github PK
View Code? Open in Web Editor NEWWeb Driver UDF for AutoIt
License: MIT License
Web Driver UDF for AutoIt
License: MIT License
This line --
https://github.com/Danp2/WebDriver/blob/3057014125c81c3f52e9a23451aa4b1efd2730e9/wd_helper.au3#L1290
changes the value of $bForce, essentially forcing an update even if the calling routine set $bForce = Null, indicating that the function should check for an update without actually performing the update.
This should be fixed so that the Null value is maintained / honored.
There is a difference in how additional arguments are passed to the web driver based on the browser being used.
The wd_demo provides an example of how to pass acceptInsecureCerts to the Firefox driver.
A similar example should be made available for the chrome function as well.
I will raise a PR for this soon.
Hi, Danp2!
First of all, I'd like to appreciate your effort for this nice library.
I'm now developing a simple automation tool by using chrome webdriver, and everything is almost ok.
But the chrome always take the focus to itself while processing action, so I feel uncomfortable when I want to do some other works while running the script.
I found that the built-in functions of IE has no problem like this.
So my question is,
Is possible to make the chrome work in background like _IE functions?
I look forward to your reply.
Thank you.
According to documentation ChromeDriver allows to load extencions in headless mode.
https://sites.google.com/a/chromium.org/chromedriver/extensions
ChromeOptions options = new ChromeOptions();
options.addArguments("load-extension=/path/to/extension");
ChromeDriver driver = new ChromeDriver(options);
How can I accomplish same result with AutoIT?
_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":[ "--profile-directory=Default","load-extension=\extencsion"]}}}}'
snippet was my starting point, also _WD_Options was one of varaints, but no result.
What is correct method to tell chromedriver that I need to load an extencion?
It looks like nothing is returned when using _WD_Screenshot with $nOutputType = 3... I think that $sResult was supposed to be set to $sResponse under Case 3
is this following description :
; Failure - Returns one of the following values:
; |$_WD_STATUS_Invalid (0) - Browser context is invalid
; |$_WD_ERROR_Exception
wrong or proper ?
$_WD_ERROR_Exception should not be returned as value but as @error
Hello all
Hope you all well
i faced This issue
https://ibb.co/60dHRJZ
(https://user-images.githubusercontent.com/94099046/141244890-4aa7aec7-6f8f-4772-967a-84d33c9dedac.png)
When i try use The compiled exe on windows 7 but it`s work on windows 10
and when run it (F5) as Script on windows 7 it`s work good .
i don't know the reason !
Hi,
Chrome 83.
The SessionId is not stored in [Value]
anymore
https://github.com/Danp2/WebDriver/blob/2f4d8cce692ac66b6c16a345c5466204a9a6deaf/wd_core.au3#L431
_WD_WaitElement
can replace the redundant _WD_FindElement
call if it returns the element instead of 1
on success.
In wd_helper.au3
all usage of _WD_ExecuteScript() should be reviewed to use: $vValueMode and proper @error returning
I will do this by proposing PR, as for now this Issue is only a reminder for me
as a project
Per @TheDcoder on forum --
I would like to request adding the
binary
options to the vendor-specific options (similar tow3c
), it can be used to set the path of the binary executable in Chrome Driver like so:_WD_CapabilitiesAdd('binary', 'C:\Software\Chromium\bin\chrome.exe')
__WD_CloseDriver doesn't work after rewrite if chromedriver path not default. Example:
_WD_Option("Driver", "ChromeDriver\chromedriver.exe")
After the script exit. Checking the task manager
I looked under the hood of the closing function to find out what the problem is, it seems that the new code does not return the process id if it is not the default path. Example:
$sAction
; Default "hover" action
I will do this in future
I will do this in future
currently this is just a reminder, I will propose new PR soon
As I said in title, in function: _WD_Attach() the returned @error $_WD_ERROR_Success will never happen because the Else part will be used.
Current detection appears incorrect. @error is 3 after call to _WinHttpSimpleSSLRequest, indicating 3 - could not receive response
If $iErr = $_WD_ERROR_Success And $sNodeName = 'select' Then
I will do this in a future.
We should look for a better way to implement this that doesn't involve hardcoding function names. I think we could make this data driven by adding a column to $aDemoSuite. Also, it would make more sense to me to pass the browser name instead of the control ID. This would prevent the need from having code like $aBrowsers[_GUICtrlComboBox_GetCurSel($idBrowsers)][0]
in multiple routines.
Originally posted by @Danp2 in #154 (comment)
in wd_core.au3
we can use _WD_ElementAction
to click with:
Case 'clear', 'click'
$sResponse = __WD_Post($_WD_BASE_URL & ":" & $_WD_PORT & "/session/" & $sSession & "/element/" & $sElement & "/" & $sCommand, '{"id":"' & $sElement & '"}')
$iErr = @error
in wd_helper.au3
we can use _WD_ElementActionEx
with DOUBLECLICK
:
which will be processed by:
$sResponse = __WD_Post($sURL, $sOption)
The question is whether, in your experience, WebDriver handles clicks differently in these two cases?
For example, are there problems with one case and not with another?
Thus can we add to _WD_ElementActionEx
not only DOUBLECLICK
but also CLICK
?
Or should we treat that there is already CLICKANDHOLD
?
Does it make sense?
using wd_demo.au3
in DemoAlerts()
on Chrome
and MSEdge
this part
; Set value of text field
_WD_Alert($sSession, 'sendtext', 'new text')
dosen't work.
Any idea why ?
After checking it looks like more adequte will be using _WD_ElementActionEx
.
What you think about ?
The variable $sErr is unused in the latest release (v0.3.0.1) in _WD_Window, _WD_FindElement, and _WD_ElementAction. When running with the strictest Au3Check parameters -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 -v3, a warning is generated
The syntax of _WD_FrameLeave says it doesn't accept any arguments currently, should be updated to this...
;#FUNCTION#===================================================================================================================
; Name ..........: _WD_FrameLeave
; Description ...: This will leave the current frame, to its parent, not necessarily the Top, for subsequent WebDriver operations.
; Syntax ........: _WD_FrameLeave($sSession)
; Parameters ....: $sSession - Session ID from _WDCreateSession
; Return values .: Success True
; Failure - WD Response error message (E.g. "chrome not reachable")
; Author ........: Decibel
; Modified ......: 2018-04-27
; Remarks .......: ChromeDriver and GeckoDriver respond differently for a successful operation
; Related .......:
; Link ..........: https://www.w3.org/TR/webdriver/#switch-to-parent-frame
; Example .......: No
;===============================================================================================================================
(took me waaay to long to realize that I could triple backticks to make a code block :D )
Originally reported here ==> https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/?do=findComment&comment=1415354
Was thought to be fixed in https://github.com/Danp2/WebDriver/releases/tag/0.1.0.17
While I will admit some fault here, _WD_UpdateDriver doesn't handle any COM errors resulting from unzipping the downloaded driver. For example, try unzipping to a non-existent directory.
I see a couple ways to fix this:
Happy to submit a pull request if you'd like, just let me know your preference :)
This is a little un-intuitive... when I pass True to _WD_ConsoleVisible, I would expect that the console would be visible, not hidden.
In _WD_FindElement
in case when $sStartNodeID = Default
>> $sStartNodeID = ""
$sBaseCmd = ($bShadowRoot) ? "/shadow/" : "/element/"
$sBaseCmd &= $sStartNodeID
.........
$sCmd = '/element' & (($bMultiple) ? 's' : '')
.........
__WD_Post($_WD_BASE_URL & ":" & $_WD_PORT & "/session/" & $sSession & $sBaseCmd & $sCmd, ........
can occurs such scenario where $sBaseCmd & $sCmd
will be /shadow//element
or /element//element
Is this correct that //
follow each other?
If this is an real issue and should be fixed, then I can propose fix for this.
This is a placeholder for future discussions on adding examples to the UDF.
For starters --
From the latest geckodriver release notes --
Introduced the new boolean capability moz:debuggerAddress that can be used
to opt-in to the experimental Chrome DevTools Protocol (CDP) implementation.
A string capability with the same name will be returned by NewSession,
which contains the host:port combination of the HTTP server that can be
used to query for websockets of available targets.
Details on moz:debuggerAddress can be found here.
$sFile
is unused after storing the result of the regular expression replacement in __WD_CloseDriver (v 0.3.0.6)
From here,
I tried the example code with chrome and received error when testing timeouts 'SetTimeout unknown error: 'ms' must be a double'.
This doesn't appear to work with multiple sessions running. It returns the value of the response from the last session created.
Also, this causes $sSession and $sFuncName to go unused in the function :) Not sure why the commented out code, but I'm guessing this is a bit of a WIP? It claims to return a dictionary object, but returns a string as far as I can tell.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.