<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.autoitscript.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Danp2</id>
	<title>AutoIt Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.autoitscript.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Danp2"/>
	<link rel="alternate" type="text/html" href="https://www.autoitscript.com/wiki/Special:Contributions/Danp2"/>
	<updated>2026-04-12T13:45:30Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14804</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14804"/>
		<updated>2022-10-10T11:38:14Z</updated>

		<summary type="html">&lt;p&gt;Danp2: /* Translate IE UDF to WebDriver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2022/01/25)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF (AutoIt)] by Ward and Jos&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF (AutoIt)] by trancexx or [https://github.com/dragana-r/autoit-winhttp autoit-winhttp (GitHub)]&lt;br /&gt;
* [https://github.com/Danp2/au3WebDriver/releases/latest WebDriver UDF (GitHub)] by Danp2&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/chromium.org/driver/downloads Google] || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] ||  &lt;br /&gt;
|-&lt;br /&gt;
| Firefox || [https://github.com/mozilla/geckodriver/releases/latest GitHub] || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases/latest GitHub] || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status Firefox]&lt;br /&gt;
* [https://github.com/operasoftware/operachromiumdriver Opera]: &amp;quot;&#039;&#039;OperaChromiumDriver is a WebDriver implementation derived from ChromeDriver and adapted by Opera&#039;&#039;&amp;quot;. That&#039;s why I think it has at least the same limitations as ChromeDriver.&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
=== Technical terms ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2022/02/12)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
	 &lt;br /&gt;
You will encounter the following technical terms when working with the WebDriver UDF.&amp;lt;br&amp;gt;&lt;br /&gt;
These terms are not unique to the UDF, so you will find just the general description in this section.&lt;br /&gt;
How to use these terms with the WebDriver UDF can be found in the FAQ.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; CDP (Chrome DevTools Protocol) : Is a [https://chromedevtools.github.io/devtools-protocol/ protocol] that allows for tools to instrument, inspect, debug and profile Chromium, Chrome and other [https://en.wikipedia.org/wiki/Blink_(browser_engine) Blink]-based browsers.&lt;br /&gt;
&lt;br /&gt;
; CSS Selector : Please see &#039;&#039;&#039;Selector&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
; Locator Strategy : A Locator strategy describes the method to use to search elements. This includes Linktext, Partial Linktext, Tag Name, CSS selector, XPath selector.&lt;br /&gt;
&lt;br /&gt;
; Marionette : Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.&amp;lt;br&amp;gt;Marionette consists of two parts: a server which takes requests and executes them in Gecko (the Marionette server ships with Firefox), and a client (the Marionette client ships with the GeckoDriver exe). The client sends commands to the server and the server executes the command inside the browser.&amp;lt;br&amp;gt;For details please [https://firefox-source-docs.mozilla.org/testing/marionette/Intro.html visit this site].&lt;br /&gt;
&lt;br /&gt;
; Selector : Selectors are patterns used to select the element(s) you want to process. They are used by &amp;lt;br&amp;gt;CSS (see [https://www.w3schools.com/css/css_selectors.asp this link for Beginners] or [https://www.w3.org/TR/CSS21/selector.html this link for Advanced)] and&amp;lt;br&amp;gt;[https://www.w3schools.com/xml/xpath_syntax.asp XPath] (see [https://www.w3schools.com/xml/xml_xpath.asp this link for Beginners] and [https://www.w3.org/TR/1999/REC-xpath-19991116/ this link for Advanced]).&lt;br /&gt;
&lt;br /&gt;
; ShadowRoot : The ShadowRoot interface of the Shadow DOM API is the root node of a DOM sub tree that is rendered separately from a document&#039;s main DOM tree.&amp;lt;br&amp;gt;For details please [https://dom.spec.whatwg.org/#interface-shadowroot visit this site].&lt;br /&gt;
&lt;br /&gt;
; XPath : XPath is a language for navigating in XML documents. XPath is a major element in the XSLT standard and includes over 200 built-in functions.&lt;br /&gt;
&lt;br /&gt;
; XQuery : XQuery is a language for querying XML documents.&amp;lt;br&amp;gt;For details please [https://www.w3schools.com/xml/xml_xquery.asp visit this site].&lt;br /&gt;
&lt;br /&gt;
; XSLT : XSLT is a language for transforming XML documents.&amp;lt;br&amp;gt;For details please [https://www.w3schools.com/xml/xml_xslt.asp visit this site].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2022/02/02)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To automate your browser the following installation steps are needed:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** wd_Core.au3, wd_helper.au3 , wd_cdp.au3 , wd_capabilities.au3 from the WebDriver UDF&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory (with WD_Demo.au3):&lt;br /&gt;
** chromedriver.exe (Chrome)&lt;br /&gt;
** geckodriver.exe (Firefox)&lt;br /&gt;
** msedgedriver.exe (Edge - Chromium) or MicrosoftWebDriver.exe (Edge - EdgeHTML)&lt;br /&gt;
** or use &amp;quot;Update&amp;quot; option by choosing one of ComboBox option in WD_Demo.au3&lt;br /&gt;
* Run WD_Demo.au3 and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\ ...&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;, ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function reference ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2021/12/09)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The functions are now documented in the CHM help file that comes with the UDF.&lt;br /&gt;
&lt;br /&gt;
== Capabilities ==&lt;br /&gt;
WebDriver capabilities are used to communicate the features supported by a given implementation. The local end may use capabilities to define which features it requires the remote end to satisfy when creating a new session. Likewise, the remote end uses capabilities to describe the full feature set for a session. &amp;lt;br&amp;gt;&lt;br /&gt;
Details can be found at [[WebDriver_Capabilities|WebDriver Capabilities (sub page)]].&lt;br /&gt;
&lt;br /&gt;
== Browser related functionality ==&lt;br /&gt;
=== Google Chrome ===&lt;br /&gt;
ChromeDriver supports &amp;quot;Chrome DevTools Protocol&amp;quot; (CDP) commands (for an explanation of the term and related links please see the [[WebDriver#Used_Terms|Used Terms]] section).&amp;lt;br&amp;gt;&lt;br /&gt;
Details can be found in the CHM Help file that comes with the UDF.&lt;br /&gt;
&lt;br /&gt;
=== Translate IE UDF to WebDriver ===&lt;br /&gt;
{{WIP}}&lt;br /&gt;
Internet Explorer is no longer supported by Microsoft. Therefore, it may be necessary to rewrite existing scripts for other browsers using the WebDriver UDF.&lt;br /&gt;
Below you will find a mapping of the functions of the IE UDF to the functions of the WebDriver UDF.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! IE function !! WebDriver function !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| _IEAction || _WD_ElementAction + _WD_ElementActionEx || &lt;br /&gt;
|-&lt;br /&gt;
| _IEAttach || _WD_Attach || &lt;br /&gt;
_WD_Attach: &#039;&#039;&#039;Attach to&#039;&#039;&#039; existing browser &#039;&#039;&#039;tab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Attaching to running browser instance/session is much more difficult. [https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/?tab=comments#comment-1498168 Examples can be found here].&lt;br /&gt;
|-&lt;br /&gt;
| _IEBodyReadHTML || _WD_GetSource || &lt;br /&gt;
|-&lt;br /&gt;
| _IEBodyReadText || _WD_ExecuteScript($sSession, &#039;return document.body.innerText&#039;,Default,Default, $_WD_JSON_Value) || &lt;br /&gt;
|-&lt;br /&gt;
| _IEBodyWriteHTML || _WD_ExecuteScript($s_Session, &amp;quot;document.body.outerHTML=&#039;&amp;quot; &amp;amp; $sHTML &amp;amp; &amp;quot;&#039;&amp;quot;) || &lt;br /&gt;
|-&lt;br /&gt;
| _IECreate || _WD_CreateSession || &lt;br /&gt;
|-&lt;br /&gt;
| _IECreateEmbedded || N/A || &lt;br /&gt;
|-&lt;br /&gt;
| _IEDocGetObj || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEDocInsertHTML || ||  &lt;br /&gt;
|-&lt;br /&gt;
| _IEDocInsertText || || &lt;br /&gt;
|- || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEDocReadHTML || _WD_GetSource || &lt;br /&gt;
|-&lt;br /&gt;
| _IEDocWriteHTML || _WD_ExecuteScript($s_Session, &amp;quot;document.open();document.write(&amp;quot; &amp;amp; $sHTML &amp;amp; &amp;quot;);document.close();&amp;quot;) || https://stackoverflow.com/a/11984907/5314940&lt;br /&gt;
|-&lt;br /&gt;
| _IEErrorNotify || N/A || you can set debug level for example:  $_WD_DEBUG = $_WD_DEBUG_Full&lt;br /&gt;
|-&lt;br /&gt;
| _IEFormElementCheckBoxSelect || _WD_ElementActionEx || _WD_FindElement + _WD_ElementActionEx($sSession, $sElement, &amp;quot;check&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| _IEFormElementGetCollection || _WD_FindElement || &lt;br /&gt;
|-&lt;br /&gt;
| _IEFormElementGetObjByName || _WD_GetElementByName || &lt;br /&gt;
|-&lt;br /&gt;
| _IEFormElementGetValue || _WD_ElementAction || _WD_FindElement + _WD_ElementAction($sSession, $sSelectElement, &amp;quot;value&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| _IEFormElementOptionSelect || _WD_ElementSelectAction + _WD_ElementOptionSelect || &lt;br /&gt;
|-&lt;br /&gt;
| _IEFormElementRadioSelect || _WD_ElementSelectAction || &lt;br /&gt;
|-&lt;br /&gt;
| _IEFormElementSetValue || _WD_SetElementValue || &lt;br /&gt;
|-&lt;br /&gt;
| _IEFormGetCollection || _WD_FindElement || &lt;br /&gt;
|-&lt;br /&gt;
| _IEFormGetObjByName || _WD_GetElementByName || &lt;br /&gt;
|-&lt;br /&gt;
| _IEFormImageClick || _WD_ElementAction || _WD_FindElement + _WD_ElementAction($sSession, $sElement, &amp;quot;click&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| _IEFormReset || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEFormSubmit || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEFrameGetCollection || _WD_FrameList || _WD_FrameList($sSession, True)&lt;br /&gt;
|-&lt;br /&gt;
| _IEFrameGetObjByName || _WD_GetElementByName + _WD_FrameEnter || &lt;br /&gt;
|-&lt;br /&gt;
| _IEGetObjById || _WD_GetElementById || &lt;br /&gt;
|-&lt;br /&gt;
| _IEGetObjByName || _WD_GetElementByName || &lt;br /&gt;
|-&lt;br /&gt;
| _IEHeadInsertEventScript || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEImgClick || _WD_ElementAction || _WD_FindElement + _WD_ElementAction($sSession, $sElement, &amp;quot;click&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| _IEImgGetCollection || _WD_FindElement || &lt;br /&gt;
|-&lt;br /&gt;
| _IEIsFrameSet || || &lt;br /&gt;
|-&lt;br /&gt;
| _IELinkClickByIndex || _WD_ElementAction || _WD_FindElement + _WD_ElementAction($sSession, $sElement, &amp;quot;click&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| _IELinkClickByText || _WD_LinkClickByText || &lt;br /&gt;
|-&lt;br /&gt;
| _IELinkGetCollection || _WD_FindElement || &lt;br /&gt;
|-&lt;br /&gt;
| _IELoadWait || _WD_LoadWait || &lt;br /&gt;
|-&lt;br /&gt;
| _IELoadWaitTimeout || _WD_SetTimeouts || &lt;br /&gt;
|-&lt;br /&gt;
| _IENavigate || _WD_Navigate || &lt;br /&gt;
|-&lt;br /&gt;
| _IEPropertyGet || _WD_ElementAction || _WD_FindElement + _WD_ElementAction($sSession, $sElement, &#039;property&#039;, &#039;nodeName&#039;)&lt;br /&gt;
|-&lt;br /&gt;
| _IEPropertySet || _WD_ExecuteScript || _WD_FindElement + ......&lt;br /&gt;
|-&lt;br /&gt;
| _IEQuit || _WD_DeleteSession ||&lt;br /&gt;
|-&lt;br /&gt;
| _IETableGetCollection || _WD_FindElement || &lt;br /&gt;
|-&lt;br /&gt;
| _IETableWriteToArray || _WD_GetTable || _WD_FindElement + _WD_GetTable( ......&lt;br /&gt;
|-&lt;br /&gt;
| _IETagNameAllGetCollection || _WD_FindElement || &lt;br /&gt;
|-&lt;br /&gt;
| _IETagNameGetCollection || _WD_FindElement || &lt;br /&gt;
|-&lt;br /&gt;
| _IE_Example || N/A || Take a look at  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look at  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || _WD_Option(&#039;version&#039;) || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/07/06)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
==== WinHTTP UDF ====&lt;br /&gt;
Make sure that you are running at least version 1.6.4.2 (currently unreleased, but can be obtained [https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3 here]).&lt;br /&gt;
==== Chrome ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugChrome1&amp;quot;&amp;gt;Chrome does not start and the DOS window for chromedriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugChrome1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Chrome and does not display the DOS window for chromedriver.&amp;lt;br&amp;gt;When you manually run the chromedriver in a DOS window you get message &amp;quot;[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied.&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the chrome driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\chromedriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugFirefox1&amp;quot;&amp;gt;Firefox does not start and the DOS window for geckodriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugFirefox1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Firefox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the gecko driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\geckodriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2022/03/24)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ1&amp;quot;&amp;gt;1. How to connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in [https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/?do=findComment&amp;amp;comment=1498168 this post].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ2&amp;quot;&amp;gt;2. How to hide the webdriver console&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I hide the webdriver console?&amp;lt;br&amp;gt;A: The console can be completely hidden from the start by adding the following line near the beginning of your script:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error&amp;lt;/syntaxhighlight&amp;gt;You can also control the visibility of the console with the function _WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ3&amp;quot;&amp;gt;3. How to utilize an existing user profile&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Can I use an existing user profile instead of the default behavior of using a new one?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration, with each browser using a different method to implement. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;:[&amp;quot;--user-data-dir=C:\\Users\\&#039; &amp;amp; @UserName &amp;amp; &#039;\\AppData\\Local\\Google\\Chrome\\User Data\\&amp;quot;, &amp;quot;--profile-directory=Default&amp;quot;]}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;MS Edge&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;ms:edgeOptions&amp;quot;: {&amp;quot;args&amp;quot;: [&amp;quot;user-data-dir=C:\\Users\\&#039; &amp;amp; @UserName &amp;amp; &#039;\\AppData\\Local\\Microsoft\\Edge\\User Data\\&amp;quot;, &amp;quot;profile-directory=Default&amp;quot;]}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;:{&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;moz:firefoxOptions&amp;quot;: {&amp;quot;args&amp;quot;: [&amp;quot;-profile&amp;quot;, &amp;quot;&#039; &amp;amp; GetDefaultFFProfile() &amp;amp; &#039;&amp;quot;],&amp;quot;log&amp;quot;: {&amp;quot;level&amp;quot;: &amp;quot;trace&amp;quot;}}}}}&#039;&lt;br /&gt;
&lt;br /&gt;
Func GetDefaultFFProfile()&lt;br /&gt;
	Local $sDefault, $sProfilePath = &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
	Local $sProfilesPath = StringReplace(@AppDataDir, &#039;\&#039;, &#039;/&#039;) &amp;amp; &amp;quot;/Mozilla/Firefox/&amp;quot;&lt;br /&gt;
	Local $sFilename = $sProfilesPath &amp;amp; &amp;quot;profiles.ini&amp;quot;&lt;br /&gt;
	Local $aSections = IniReadSectionNames ($sFilename)&lt;br /&gt;
&lt;br /&gt;
	If Not @error Then&lt;br /&gt;
		For $i = 1 To $aSections[0]&lt;br /&gt;
			$sDefault = IniRead($sFilename, $aSections[$i], &#039;Default&#039;, &#039;0&#039;)&lt;br /&gt;
&lt;br /&gt;
			If $sDefault = &#039;1&#039; Then&lt;br /&gt;
				$sProfilePath = $sProfilesPath &amp;amp; IniRead($sFilename, $aSections[$i], &amp;quot;Path&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
				ExitLoop&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	Return $sProfilePath&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will also likely need to specify the marionette port:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&#039;DriverParams&#039;, &#039;--marionette-port 2828&#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ4&amp;quot;&amp;gt;4. How to specify location of browser executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch a browser installed in a non-standard location?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\chrome.exe&amp;quot; }}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;desiredCapabilities&amp;quot;:{&amp;quot;javascriptEnabled&amp;quot;:true,&amp;quot;nativeEvents&amp;quot;:true,&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;moz:firefoxOptions&amp;quot;:{&amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\firefox.exe&amp;quot;}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;Alternate Firefox method:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_Option(&#039;DriverParams&#039;, &#039;--binary &amp;quot;C:\Program Files\Mozilla Firefox\firefox.exe&amp;quot; --log trace &#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ5&amp;quot;&amp;gt;5. How to maximize the browser window&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ5&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to maximize the browser window?&amp;lt;br&amp;gt;A: Simply call the following function:&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Window($sSession, &amp;quot;Maximize&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Make sure to call _WD_Window after the session has been created with _WD_CreateSession.&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ6&amp;quot;&amp;gt;6. How to specify location of WebDriver executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ6&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch the WebDriver executable from a specific location?&amp;lt;br&amp;gt;A: This is controlled by function &amp;quot;_WD_Option&amp;quot;. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\local\WebDriver\WebDriver.exe&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ7&amp;quot;&amp;gt;7. How to retrieve the values of a drop-down list&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ7&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How to retrieve the values of a drop-down list (&amp;lt;Select&amp;gt; tag)?&amp;lt;br&amp;gt;A1: Here&#039;s a simple way to do it:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$sText = _WD_ElementAction($sSession, $sElement, &#039;property&#039;, &#039;innerText&#039;)&lt;br /&gt;
$aOptions = StringSplit ( $sText, @LF,  $STR_NOCOUNT)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;xxx&#039; is the name of the drop-down list.&lt;br /&gt;
&amp;lt;br&amp;gt;A2: This can now be accomplished using the function _WD_ElementSelectAction:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$aOptions = _WD_ElementSelectAction ($sSession, $sElement, &#039;options&#039;)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ8&amp;quot;&amp;gt;8. How to run the browser in headless mode (hidden mode)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ8&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How do I run the browser in &amp;quot;headless&amp;quot; mode?&amp;lt;br&amp;gt;A: This is controlled by the Capabilities string that is passed to _WD_CreateSession. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;: [&amp;quot;--headless&amp;quot;, &amp;quot;--allow-running-insecure-content&amp;quot;] }}}}&#039; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ9&amp;quot;&amp;gt;9. How to configure the UDF to call a user-defined Sleep function&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ9&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Q: How to configure the UDF to call a user-defined Sleep function, and interact with _WD_WaitElement() and _WD_LoadWait() to make the script more responsive?&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A: Try to use: _WD_Option(&amp;quot;Sleep&amp;quot;) . Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;ButtonConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;GuiComboBoxEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WindowsConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;quot;wd_helper.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Global $idAbortTest&lt;br /&gt;
Global $WD_SESSION&lt;br /&gt;
_Example()&lt;br /&gt;
&lt;br /&gt;
Func _Example()&lt;br /&gt;
	SetupChrome()&lt;br /&gt;
&lt;br /&gt;
	; Create a GUI with various controls.&lt;br /&gt;
	Local $hGUI = GUICreate(&amp;quot;Example&amp;quot;)&lt;br /&gt;
	Local $idTest = GUICtrlCreateButton(&amp;quot;Test&amp;quot;, 10, 370, 85, 25)&lt;br /&gt;
	$idAbortTest = GUICtrlCreateButton(&amp;quot;Abort&amp;quot;, 150, 370, 85, 25)&lt;br /&gt;
&lt;br /&gt;
	; Display the GUI.&lt;br /&gt;
	GUISetState(@SW_SHOW, $hGUI)&lt;br /&gt;
&lt;br /&gt;
	ConsoleWrite(&amp;quot;- TESTING&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
	Local $sFilePath = _WriteTestHtml()&lt;br /&gt;
&lt;br /&gt;
	; Loop until the user exits.&lt;br /&gt;
	While 1&lt;br /&gt;
		Switch GUIGetMsg()&lt;br /&gt;
			Case $idTest&lt;br /&gt;
				_WD_Navigate($WD_SESSION, $sFilePath)&lt;br /&gt;
				_WD_WaitElement($WD_SESSION, $_WD_LOCATOR_ByXPath, &#039;//a[contains(text(),&amp;quot;TEST&amp;quot;)]&#039;, 100, 30 * 1000) ; timeout = 50 seconds&lt;br /&gt;
				ConsoleWrite(&amp;quot;---&amp;gt; @error=&amp;quot; &amp;amp; @error &amp;amp; &amp;quot;  @extended=&amp;quot; &amp;amp; @extended &amp;amp; _&lt;br /&gt;
						&amp;quot; : after _WD_WaitElement()&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
			Case $GUI_EVENT_CLOSE&lt;br /&gt;
				ExitLoop&lt;br /&gt;
&lt;br /&gt;
		EndSwitch&lt;br /&gt;
	WEnd&lt;br /&gt;
&lt;br /&gt;
	; Delete the previous GUI and all controls.&lt;br /&gt;
	GUIDelete($hGUI)&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;_Example&lt;br /&gt;
&lt;br /&gt;
Func _My_Sleep($iDelay)&lt;br /&gt;
	Local $hTimer = TimerInit() ; Begin the timer and store the handle in a variable.&lt;br /&gt;
	Do&lt;br /&gt;
		Switch GUIGetMsg()&lt;br /&gt;
			Case $GUI_EVENT_CLOSE&lt;br /&gt;
				ConsoleWrite(&amp;quot;! USER EXIT&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
				Exit&lt;br /&gt;
			Case $idAbortTest&lt;br /&gt;
				Return SetError($_WD_ERROR_UserAbort)&lt;br /&gt;
		EndSwitch&lt;br /&gt;
	Until TimerDiff($hTimer) &amp;gt; $iDelay&lt;br /&gt;
EndFunc   ;==&amp;gt;_My_Sleep&lt;br /&gt;
&lt;br /&gt;
Func _WriteTestHtml($sFilePath = @ScriptDir &amp;amp; &amp;quot;\TestFile.html&amp;quot;)&lt;br /&gt;
	FileDelete($sFilePath)&lt;br /&gt;
	Local Const $sHtml = _&lt;br /&gt;
			&amp;quot;&amp;lt;html lang=&#039;en&#039;&amp;gt;&amp;quot; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&amp;quot;    &amp;lt;head&amp;gt;&amp;quot; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&amp;quot;        &amp;lt;meta charset=&#039;utf-8&#039;&amp;gt;&amp;quot; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&amp;quot;        &amp;lt;title&amp;gt;TESTING&amp;lt;/title&amp;gt;&amp;quot; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&amp;quot;    &amp;lt;/head&amp;gt;&amp;quot; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&amp;quot;    &amp;lt;body&amp;gt;&amp;quot; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&amp;quot;        &amp;lt;div id=&#039;MyLink&#039;&amp;gt;Waiting&amp;lt;/div&amp;gt;&amp;quot; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&amp;quot;    &amp;lt;/body&amp;gt;&amp;quot; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&amp;quot;    &amp;lt;script type=&#039;text/javascript&#039;&amp;gt;&amp;quot; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&amp;quot;    setTimeout(function()&amp;quot; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&amp;quot;    {&amp;quot; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&amp;quot;        // Delayed code in here&amp;quot; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&amp;quot;        document.getElementById(&#039;MyLink&#039;).innerHTML=&#039;&amp;lt;a&amp;gt;TESTING&amp;lt;/a&amp;gt;&#039;;&amp;quot; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&amp;quot;    }, 20000); // 20000 = 20 seconds&amp;quot; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&amp;quot;    &amp;lt;/script&amp;gt;&amp;quot; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&amp;quot;&amp;lt;/html&amp;gt;&amp;quot;&lt;br /&gt;
	FileWrite($sFilePath, $sHtml)&lt;br /&gt;
	Return &amp;quot;file:///&amp;quot; &amp;amp; StringReplace($sFilePath, &amp;quot;\&amp;quot;, &amp;quot;/&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_WriteTestHtml&lt;br /&gt;
&lt;br /&gt;
Func SetupChrome()&lt;br /&gt;
	_WD_Startup()&lt;br /&gt;
	_WD_Option(&#039;Driver&#039;, &#039;chromedriver.exe&#039;)&lt;br /&gt;
	_WD_Option(&#039;Port&#039;, 9515)&lt;br /&gt;
	_WD_Option(&#039;HTTPTimeouts&#039;, True)&lt;br /&gt;
	_WD_Option(&#039;DefaultTimeout&#039;, 40001)&lt;br /&gt;
	_WD_Option(&#039;DriverParams&#039;, &#039;--verbose --log-path=&amp;quot;&#039; &amp;amp; @ScriptDir &amp;amp; &#039;\chrome.log&amp;quot;&#039;)&lt;br /&gt;
	_WD_Option(&amp;quot;Sleep&amp;quot;, _My_Sleep)&lt;br /&gt;
&lt;br /&gt;
	Local $sCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;excludeSwitches&amp;quot;: [ &amp;quot;enable-automation&amp;quot;]}}}}&#039;&lt;br /&gt;
	$WD_SESSION = _WD_CreateSession($sCapabilities)&lt;br /&gt;
	_WD_Timeouts($WD_SESSION, 40002)&lt;br /&gt;
EndFunc   ;==&amp;gt;SetupChrome&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ10&amp;quot;&amp;gt;10. How to keep my WebDriver environment up-to-date&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ10&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Q: How can I keep my WebDriver environment up-to-date?&amp;lt;br&amp;gt;&lt;br /&gt;
A: You have to check the following components:&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;WebDriver UDF:&amp;lt;/b&amp;gt; Function _WD_IsLatestRelease compares local UDF version to latest release on Github. Returns True if the local UDF version is the latest, otherwise False. If you need to update the UDF you have to download it manually.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;WebDriver Exe:&amp;lt;/b&amp;gt; Function _WD_UpdateDriver checks or updates the Web Driver with newer version, if available.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Browser:&amp;lt;/b&amp;gt; Function _WD_GetBrowserVersion returns the version number of the specified browser. If you need to update the Browser you have to download and install it by hand.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ11&amp;quot;&amp;gt;11. How to use &amp;quot;Locator strategy&amp;quot; and &amp;quot;Selectors&amp;quot;?&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ11&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Q: How to use &amp;quot;Locator strategies&amp;quot; and how to find &amp;quot;Selectors&amp;quot;?&amp;lt;br&amp;gt;&lt;br /&gt;
A: This UDF supports all locators defined in the Webdriver specifications. Below is a listing of predefined constants:&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Locator strategy !! Description how to use &amp;quot;Selector&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| $_WD_LOCATOR_ByCSSSelector || CSS Selector string (see this [https://www.w3schools.com/css/css_selectors.asp site]). In CSS, pattern matching rules determine which style rules apply to elements in the HTML DOM document tree.&lt;br /&gt;
|-&lt;br /&gt;
| $_WD_LOCATOR_ByXPath || XPath string (see this [https://www.w3schools.com/xml/xml_xpath.asp site]). XPath is a language for addressing parts of an XML document.&lt;br /&gt;
|-&lt;br /&gt;
| $_WD_LOCATOR_ByLinkText || String with exact text of &amp;lt;a&amp;gt; element, which should be used to locate the proper &amp;lt;a&amp;gt; element.&lt;br /&gt;
|-&lt;br /&gt;
| $_WD_LOCATOR_ByPartialLinkText || String with partial text of &amp;lt;a&amp;gt; element, which should be used to locate the proper &amp;lt;a&amp;gt; element.&lt;br /&gt;
|-&lt;br /&gt;
| $_WD_LOCATOR_ByTagName || String that matches the desired element tag name, for example &amp;quot;button&amp;quot; is tag name of this element: &amp;lt;button name=&amp;quot;ClickMe&amp;quot;&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Q: How can I check XPath and CSSSelector in the Browser?&amp;lt;br&amp;gt;&lt;br /&gt;
A: &#039;&#039;&#039;Work in progress....&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
A: Take a look on this link: [https://developer.chrome.com/docs/devtools/dom/ Get Started With Viewing And Changing The DOM]&amp;lt;br&amp;gt;&lt;br /&gt;
A: Take a look on this link: [https://www.selenium.dev/documentation/webdriver/elements/locators/ Locator strategies]&amp;lt;br&amp;gt;&lt;br /&gt;
A: Take a look on this link: [https://testerlive.wordpress.com/2016/07/02/how-to-search-by-xpathcss-in-chrome-developer-tools/ How to search by Xpath/Css in Chrome Developer Tools?]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ12&amp;quot;&amp;gt;12. How to download PDF file automatically?&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ12&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Q: How to avoid browsers asking what to do with a file after clicking the &amp;quot;Download&amp;quot; button on a website?&amp;lt;br&amp;gt;&lt;br /&gt;
A: In FireFox you should add additional capabilites settings:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;prefs&amp;quot;, &amp;quot;pdfjs.disabled&amp;quot;, True)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;prefs&amp;quot;, &amp;quot;browser.download.folderList&amp;quot;, 2)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;prefs&amp;quot;, &amp;quot;browser.download.dir&amp;quot;, $s_Download_dir)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;prefs&amp;quot;, &amp;quot;browser.helperApps.neverAsk.saveToDisk&amp;quot;, &amp;quot;application/pdf,application/octet-stream&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;prefs&amp;quot;, &amp;quot;browser.helperApps.neverAsk.openFile&amp;quot;, &amp;quot;application/pdf,application/octet-stream&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;prefs&amp;quot;, &amp;quot;browser.download.useDownloadDir&amp;quot;, True)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;prefs&amp;quot;, &amp;quot;browser.download.alwaysOpenPanel&amp;quot;, False)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ13&amp;quot;&amp;gt;13. How to setup session with proxy?&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ13&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Q: How to automate websites behind proxy?&amp;lt;br&amp;gt;&lt;br /&gt;
A: Take a look on:&lt;br /&gt;
&lt;br /&gt;
https://www.autoitscript.com/forum/topic/205553-webdriver-udf-help-support-iii/?do=findComment&amp;amp;comment=1498049&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
https://www.autoitscript.com/forum/topic/205553-webdriver-udf-help-support-iii/?do=findComment&amp;amp;comment=1498085&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ14&amp;quot;&amp;gt;14. How to add capabilities options for &#039;&#039;&#039;&amp;quot;goog:chromeOptions&amp;quot;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;quot;ms:edgeOptions&amp;quot;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;quot;moz:firefoxOptions&amp;quot;&#039;&#039;&#039;?&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ14&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Q: How to add options for &#039;&#039;&#039;&amp;quot;goog:chromeOptions&amp;quot;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;quot;ms:edgeOptions&amp;quot;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;quot;moz:firefoxOptions&amp;quot;&#039;&#039;&#039; ?&amp;lt;br&amp;gt;&lt;br /&gt;
A: WORK IN PROGRESS: https://github.com/Danp2/au3WebDriver/pull/263&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ15&amp;quot;&amp;gt;15. How to change user-agent?&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ15&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Q: How to change user-agent?&amp;lt;br&amp;gt;&lt;br /&gt;
A: Example for chrome:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;args&amp;quot;, &amp;quot;user-agent&amp;quot;, &amp;quot;Mozilla/5.0 (Windows NT 10.0; Win&amp;quot; &amp;amp; StringReplace(@OSArch, &amp;quot;X&amp;quot;, &amp;quot;&amp;quot;) &amp;amp; &amp;quot;; &amp;quot; &amp;amp; @CPUArch &amp;amp; &amp;quot;) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/&amp;quot; &amp;amp; _WD_GetBrowserVersion(&amp;quot;chrome&amp;quot;) &amp;amp; &amp;quot; Safari/537.36&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A: Example for firefox:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;args&amp;quot;, &amp;quot;user-agent&amp;quot;, &amp;quot;Mozilla/5.0 (Windows NT 10.0; Win&amp;quot; &amp;amp; StringReplace(@OSArch, &amp;quot;X&amp;quot;, &amp;quot;&amp;quot;) &amp;amp; &amp;quot;; &amp;quot; &amp;amp; @CPUArch &amp;amp; &amp;quot;) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/&amp;quot; &amp;amp; _WD_GetBrowserVersion(&amp;quot;firefox&amp;quot;) &amp;amp; &amp;quot; Safari/537.36&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ16&amp;quot;&amp;gt;16. How to enable/disable logging into webdriver console?&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ16&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Q: How to enable/disable logging into webdriver console?&amp;lt;br&amp;gt;&lt;br /&gt;
A: Example for chrome:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;excludeSwitches&amp;quot;, &amp;quot;enable-logging&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;excludeSwitches&amp;quot;, &amp;quot;disable-logging&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ17&amp;quot;&amp;gt;17. How to work with frames in Firefox?&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ17&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Q: How to work with frames in Firefox?&amp;lt;br&amp;gt;&lt;br /&gt;
A: https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
The following tools will help you to automate your browser:&lt;br /&gt;
* [https://autonomiq.io/deviq-chropath.html ChroPath]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Makes finding an element by XPath, ID or CSS incredibly easy (Chrome, Firefox, Opera)&lt;br /&gt;
* [https://selectorshub.com/ SelectorsHub]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Next Gen XPath tool to generate, write and verify the XPath and cssSelectors (All browsers)&lt;br /&gt;
* [https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE] plugin: helps to save web page content as single MHTML file (Firefox, [https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof Save Page WE for Chrome])&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2022/02/12)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* AutoIt WebDriver discussion threads:&lt;br /&gt;
** &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-01312022/ WebDriver UDF (W3C compliant version)]&#039;&#039;&#039; by @Danp2&lt;br /&gt;
** &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/ WebDriver UDF - Help &amp;amp; Support]&#039;&#039;&#039; by @Danp2&lt;br /&gt;
** &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/ WebDriver UDF - Help &amp;amp; Support (II)]&#039;&#039;&#039; by @Danp2&lt;br /&gt;
** &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/205553-webdriver-udf-help-support-iii/ WebDriver UDF - Help &amp;amp; Support (III)]&#039;&#039;&#039; by @Danp2&lt;br /&gt;
** &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/208640-webdriver-udf-help-support-iv/ WebDriver UDF - Help &amp;amp; Support (IV)]&#039;&#039;&#039; by @Danp2&lt;br /&gt;
** &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201283-im-creating-a-webdriver-tutorial I&#039;m creating a WebDriver tutorial]&#039;&#039;&#039; by @Water&lt;br /&gt;
** &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/ WebDriver example scripts collection]&#039;&#039;&#039; by @Water&lt;br /&gt;
** &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/ Webdriver, Websockets, and Chrome DevTools Protocol]&#039;&#039;&#039; by @Danp2&lt;br /&gt;
&lt;br /&gt;
* WebDriver Exe documentation:&lt;br /&gt;
** [https://sites.google.com/chromium.org/driver/ Chrome]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver Edge]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium Edge Chromium]&lt;br /&gt;
** [https://firefox-source-docs.mozilla.org/testing/geckodriver/ Firefox]&lt;br /&gt;
** [https://selenium.dev/documentation/en/webdriver/ Opera (Selenium)]&lt;br /&gt;
&lt;br /&gt;
* Other useful links:&lt;br /&gt;
** [https://github.com/jlipps/simple-wd-spec/ The W3C WebDriver Spec: A Simplified Guide]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14672</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14672"/>
		<updated>2021-12-26T14:53:08Z</updated>

		<summary type="html">&lt;p&gt;Danp2: /* FAQ */ Add MS Edge profile example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2021/06/18)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF (AutoIt)] by Ward and Jos&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF (AutoIt)] by trancexx or [https://github.com/dragana-r/autoit-winhttp autoit-winhttp (GitHub)]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF (GitHub)] by Danp2&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 92.0.4515.43 / &amp;lt;br&amp;gt; 2021.06.11 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 91.0.864.53 / &amp;lt;br&amp;gt; 2021.06.17 || &lt;br /&gt;
|-&lt;br /&gt;
| Firefox || [https://github.com/mozilla/geckodriver/releases GitHub] || 0.29.1 / &amp;lt;br&amp;gt; 2021.04.09 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases/latest GitHub] || 91.0.4472.77 / &amp;lt;br&amp;gt; 2021.06.09 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status Firefox]&lt;br /&gt;
* [https://github.com/operasoftware/operachromiumdriver Opera]: &amp;quot;&#039;&#039;OperaChromiumDriver is a WebDriver implementation derived from ChromeDriver and adapted by Opera&#039;&#039;&amp;quot;. That&#039;s why I think it has at least the same limitations as ChromeDriver.&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
=== Used Terms ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2021/07/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
	 &lt;br /&gt;
You will find the following terms when using WebDriver. We try to shed some light onto this subject here:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; CDP (Chrome DevTools Protocol)&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Is a [https://chromedevtools.github.io/devtools-protocol/ protocol] that allows for tools to instrument, inspect, debug and profile Chromium, Chrome and other [https://en.wikipedia.org/wiki/Blink_(browser_engine) Blink]-based browsers.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Marionette&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette consists of two parts: a server which takes requests and executes them in Gecko (the Marionette server ships with Firefox), and a client (the Marionette client ships with the GeckoDriver exe). The client sends commands to the server and the server executes the command inside the browser.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://firefox-source-docs.mozilla.org/testing/marionette/Intro.html visit this site].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ShadowRoot&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The ShadowRoot interface of the Shadow DOM API is the root node of a DOM sub tree that is rendered separately from a document&#039;s main DOM tree.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://dom.spec.whatwg.org/#interface-shadowroot visit this site].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/09/27)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To automate your browser the following installation steps are needed:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3, wd_helper.au3 , wd_cdp.au3 , wd_capabilities.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory (with WD_Demo.au3):&lt;br /&gt;
** chromedriver.exe (Chrome)&lt;br /&gt;
** geckodriver.exe (Firefox)&lt;br /&gt;
** msedgedriver.exe (Edge - Chromium) or MicrosoftWebDriver.exe (Edge - EdgeHTML)&lt;br /&gt;
* Run WD_Demo.au3 and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\ ...&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;, ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function reference ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2021/12/09)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The functions are now documented in the CHM help file that comes with the UDF.&lt;br /&gt;
&lt;br /&gt;
== Capabilities ==&lt;br /&gt;
WebDriver capabilities are used to communicate the features supported by a given implementation. The local end may use capabilities to define which features it requires the remote end to satisfy when creating a new session. Likewise, the remote end uses capabilities to describe the full feature set for a session. &amp;lt;br&amp;gt;&lt;br /&gt;
Details can be found at [[WebDriver_Capabilities|WebDriver Capabilities (sub page)]].&lt;br /&gt;
&lt;br /&gt;
== Browser related functionality ==&lt;br /&gt;
=== Google Chrome ===&lt;br /&gt;
ChromeDriver supports &amp;quot;Chrome DevTools Protocol&amp;quot; (CDP) commands (for an explanation of the term and related links please see the [[WebDriver#Used_Terms|Used Terms]] section).&amp;lt;br&amp;gt;&lt;br /&gt;
Details can be found in the CHM Help file that comes with the UDF.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/07/06)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
==== WinHTTP UDF ====&lt;br /&gt;
Make sure that you are running at least version 1.6.4.2 (currently unreleased, but can be obtained [https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3 here]).&lt;br /&gt;
==== Chrome ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugChrome1&amp;quot;&amp;gt;Chrome does not start and the DOS window for chromedriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugChrome1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Chrome and does not display the DOS window for chromedriver.&amp;lt;br&amp;gt;When you manually run the chromedriver in a DOS window you get message &amp;quot;[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied.&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the chrome driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\chromedriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugFirefox1&amp;quot;&amp;gt;Firefox does not start and the DOS window for geckodriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugFirefox1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Firefox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the gecko driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\geckodriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2021/12/10)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ1&amp;quot;&amp;gt;1. How to connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ2&amp;quot;&amp;gt;2. How to hide the webdriver console&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I hide the webdriver console?&amp;lt;br&amp;gt;A: The console can be completely hidden from the start by adding the following line near the beginning of your script:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error&amp;lt;/syntaxhighlight&amp;gt;You can also control the visibility of the console with the function _WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ3&amp;quot;&amp;gt;3. How to utilize an existing user profile&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Can I use an existing user profile instead of the default behavior of using a new one?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration, with each browser using a different method to implement. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;:[&amp;quot;--user-data-dir=C:\\Users\\&#039; &amp;amp; @UserName &amp;amp; &#039;\\AppData\\Local\\Google\\Chrome\\User Data\\&amp;quot;, &amp;quot;--profile-directory=Default&amp;quot;]}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;MS Edge&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;ms:edgeOptions&amp;quot;: {&amp;quot;args&amp;quot;: [&amp;quot;user-data-dir=C:\\Users\\&#039; &amp;amp; @UserName &amp;amp; &#039;\\AppData\\Local\\Microsoft\\Edge\\User Data\\&amp;quot;, &amp;quot;profile-directory=Default&amp;quot;]}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;:{&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;moz:firefoxOptions&amp;quot;: {&amp;quot;args&amp;quot;: [&amp;quot;-profile&amp;quot;, &amp;quot;&#039; &amp;amp; GetDefaultFFProfile() &amp;amp; &#039;&amp;quot;],&amp;quot;log&amp;quot;: {&amp;quot;level&amp;quot;: &amp;quot;trace&amp;quot;}}}}}&#039;&lt;br /&gt;
&lt;br /&gt;
Func GetDefaultFFProfile()&lt;br /&gt;
	Local $sDefault, $sProfilePath = &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
	Local $sProfilesPath = StringReplace(@AppDataDir, &#039;\&#039;, &#039;/&#039;) &amp;amp; &amp;quot;/Mozilla/Firefox/&amp;quot;&lt;br /&gt;
	Local $sFilename = $sProfilesPath &amp;amp; &amp;quot;profiles.ini&amp;quot;&lt;br /&gt;
	Local $aSections = IniReadSectionNames ($sFilename)&lt;br /&gt;
&lt;br /&gt;
	If Not @error Then&lt;br /&gt;
		For $i = 1 To $aSections[0]&lt;br /&gt;
			$sDefault = IniRead($sFilename, $aSections[$i], &#039;Default&#039;, &#039;0&#039;)&lt;br /&gt;
&lt;br /&gt;
			If $sDefault = &#039;1&#039; Then&lt;br /&gt;
				$sProfilePath = $sProfilesPath &amp;amp; IniRead($sFilename, $aSections[$i], &amp;quot;Path&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
				ExitLoop&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	Return $sProfilePath&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will also likely need to specify the marionette port:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&#039;DriverParams&#039;, &#039;--marionette-port 2828&#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ4&amp;quot;&amp;gt;4. How to specify location of browser executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch a browser installed in a non-standard location?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\chrome.exe&amp;quot; }}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;desiredCapabilities&amp;quot;:{&amp;quot;javascriptEnabled&amp;quot;:true,&amp;quot;nativeEvents&amp;quot;:true,&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;moz:firefoxOptions&amp;quot;:{&amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\firefox.exe&amp;quot;}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;Alternate Firefox method:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_Option(&#039;DriverParams&#039;, &#039;--binary &amp;quot;C:\Program Files\Mozilla Firefox\firefox.exe&amp;quot; --log trace &#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ5&amp;quot;&amp;gt;5. How to maximize the browser window&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ5&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to maximize the browser window?&amp;lt;br&amp;gt;A: Simply call the following function:&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Window($sSession, &amp;quot;Maximize&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Make sure to call _WD_Window after the session has been created with _WD_CreateSession.&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ6&amp;quot;&amp;gt;6. How to specify location of WebDriver executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ6&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch the WebDriver executable from a specific location?&amp;lt;br&amp;gt;A: This is controlled by function &amp;quot;_WD_Option&amp;quot;. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\local\WebDriver\WebDriver.exe&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ7&amp;quot;&amp;gt;7. How to retrieve the values of a drop-down list&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ7&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How to retrieve the values of a drop-down list (&amp;lt;Select&amp;gt; tag)?&amp;lt;br&amp;gt;A1: Here&#039;s a simple way to do it:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$sText = _WD_ElementAction($sSession, $sElement, &#039;property&#039;, &#039;innerText&#039;)&lt;br /&gt;
$aOptions = StringSplit ( $sText, @LF,  $STR_NOCOUNT)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;xxx&#039; is the name of the drop-down list.&lt;br /&gt;
&amp;lt;br&amp;gt;A2: This can now be accomplished using the function _WD_ElementSelectAction:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$aOptions = _WD_ElementSelectAction ($sSession, $sElement, &#039;options&#039;)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ8&amp;quot;&amp;gt;8. How to run the browser in headless mode&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ8&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How do I run the browser in &amp;quot;headless&amp;quot; mode?&amp;lt;br&amp;gt;A: This is controlled by the Capabilities string that is passed to _WD_CreateSession. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;: [&amp;quot;--headless&amp;quot;, &amp;quot;--allow-running-insecure-content&amp;quot;] }}}}&#039; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ9&amp;quot;&amp;gt;9. How to configure the UDF to call a user-defined Sleep function&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ9&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Q: How to configure the UDF to call a user-defined Sleep function, and interact with _WD_WaitElement() and _WD_LoadWait() to make the script more responsive?&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A: Try to use: _WD_Option(&amp;quot;Sleep&amp;quot;) . Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;ButtonConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;GuiComboBoxEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WindowsConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;quot;wd_helper.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Global $idAbortTest&lt;br /&gt;
Global $WD_SESSION&lt;br /&gt;
_Example()&lt;br /&gt;
&lt;br /&gt;
Func _Example()&lt;br /&gt;
	SetupChrome()&lt;br /&gt;
&lt;br /&gt;
	; Create a GUI with various controls.&lt;br /&gt;
	Local $hGUI = GUICreate(&amp;quot;Example&amp;quot;)&lt;br /&gt;
	Local $idTest = GUICtrlCreateButton(&amp;quot;Test&amp;quot;, 10, 370, 85, 25)&lt;br /&gt;
	$idAbortTest = GUICtrlCreateButton(&amp;quot;Abort&amp;quot;, 150, 370, 85, 25)&lt;br /&gt;
&lt;br /&gt;
	; Display the GUI.&lt;br /&gt;
	GUISetState(@SW_SHOW, $hGUI)&lt;br /&gt;
&lt;br /&gt;
	ConsoleWrite(&amp;quot;- TESTING&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
	Local $sFilePath = _WriteTestHtml()&lt;br /&gt;
&lt;br /&gt;
	; Loop until the user exits.&lt;br /&gt;
	While 1&lt;br /&gt;
		Switch GUIGetMsg()&lt;br /&gt;
			Case $idTest&lt;br /&gt;
				_WD_Navigate($WD_SESSION, $sFilePath)&lt;br /&gt;
				_WD_WaitElement($WD_SESSION, $_WD_LOCATOR_ByXPath, &#039;//a[contains(text(),&amp;quot;TEST&amp;quot;)]&#039;, 100, 30 * 1000) ; timeout = 50 seconds&lt;br /&gt;
				ConsoleWrite(&amp;quot;---&amp;gt; @error=&amp;quot; &amp;amp; @error &amp;amp; &amp;quot;  @extended=&amp;quot; &amp;amp; @extended &amp;amp; _&lt;br /&gt;
						&amp;quot; : after _WD_WaitElement()&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
			Case $GUI_EVENT_CLOSE&lt;br /&gt;
				ExitLoop&lt;br /&gt;
&lt;br /&gt;
		EndSwitch&lt;br /&gt;
	WEnd&lt;br /&gt;
&lt;br /&gt;
	; Delete the previous GUI and all controls.&lt;br /&gt;
	GUIDelete($hGUI)&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;_Example&lt;br /&gt;
&lt;br /&gt;
Func _My_Sleep($iDelay)&lt;br /&gt;
	Local $hTimer = TimerInit() ; Begin the timer and store the handle in a variable.&lt;br /&gt;
	Do&lt;br /&gt;
		Switch GUIGetMsg()&lt;br /&gt;
			Case $GUI_EVENT_CLOSE&lt;br /&gt;
				ConsoleWrite(&amp;quot;! USER EXIT&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
				Exit&lt;br /&gt;
			Case $idAbortTest&lt;br /&gt;
				Return SetError($_WD_ERROR_UserAbort)&lt;br /&gt;
		EndSwitch&lt;br /&gt;
	Until TimerDiff($hTimer) &amp;gt; $iDelay&lt;br /&gt;
EndFunc   ;==&amp;gt;_My_Sleep&lt;br /&gt;
&lt;br /&gt;
Func _WriteTestHtml($sFilePath = @ScriptDir &amp;amp; &amp;quot;\TestFile.html&amp;quot;)&lt;br /&gt;
	FileDelete($sFilePath)&lt;br /&gt;
	Local Const $sHtml = _&lt;br /&gt;
			&#039;&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;&#039; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&#039;    &amp;lt;head&amp;gt;&#039; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&#039;        &amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;&#039; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&#039;        &amp;lt;title&amp;gt;TESTING&amp;lt;/title&amp;gt;&#039; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&#039;    &amp;lt;/head&amp;gt;&#039; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&#039;    &amp;lt;body&amp;gt;&#039; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&#039;        &amp;lt;div id=&amp;quot;MyLink&amp;quot;&amp;gt;Waiting&amp;lt;/div&amp;gt;&#039; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&#039;    &amp;lt;/body&amp;gt;&#039; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&#039;    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&#039; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&#039;    setTimeout(function()&#039; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&#039;    {&#039; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&#039;        // Delayed code in here&#039; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&#039;        document.getElementById(&amp;quot;MyLink&amp;quot;).innerHTML=&amp;quot;&amp;lt;a&amp;gt;TESTING&amp;lt;/a&amp;gt;&amp;quot;;&#039; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&#039;    }, 20000); // 20000 = 20 seconds&#039; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&#039;    &amp;lt;/script&amp;gt;&#039; &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
			&#039;&amp;lt;/html&amp;gt;&#039;&lt;br /&gt;
	FileWrite($sFilePath, $sHtml)&lt;br /&gt;
	Return &amp;quot;file:///&amp;quot; &amp;amp; StringReplace($sFilePath, &amp;quot;\&amp;quot;, &amp;quot;/&amp;quot;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_WriteTestHtml&lt;br /&gt;
&lt;br /&gt;
Func SetupChrome()&lt;br /&gt;
	_WD_Startup()&lt;br /&gt;
	_WD_Option(&#039;Driver&#039;, &#039;chromedriver.exe&#039;)&lt;br /&gt;
	_WD_Option(&#039;Port&#039;, 9515)&lt;br /&gt;
	_WD_Option(&#039;HTTPTimeouts&#039;, True)&lt;br /&gt;
	_WD_Option(&#039;DefaultTimeout&#039;, 40001)&lt;br /&gt;
	_WD_Option(&#039;DriverParams&#039;, &#039;--verbose --log-path=&amp;quot;&#039; &amp;amp; @ScriptDir &amp;amp; &#039;\chrome.log&amp;quot;&#039;)&lt;br /&gt;
	_WD_Option(&amp;quot;Sleep&amp;quot;, _My_Sleep)&lt;br /&gt;
&lt;br /&gt;
	Local $sCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;excludeSwitches&amp;quot;: [ &amp;quot;enable-automation&amp;quot;]}}}}&#039;&lt;br /&gt;
	$WD_SESSION = _WD_CreateSession($sCapabilities)&lt;br /&gt;
	_WD_Timeouts($WD_SESSION, 40002)&lt;br /&gt;
EndFunc   ;==&amp;gt;SetupChrome&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ10&amp;quot;&amp;gt;10. How to keep my WebDriver environment up-to-date&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ10&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Q: How can I keep my WebDriver environment up-to-date?&amp;lt;br&amp;gt;&lt;br /&gt;
A: You have to check the following components:&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;WebDriver UDF:&amp;lt;/b&amp;gt; Function _WD_IsLatestRelease compares local UDF version to latest release on Github. Returns True if the local UDF version is the latest, otherwise False. If you need to update the UDF you have to download it manually.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;WebDriver Exe:&amp;lt;/b&amp;gt; Function _WD_UpdateDriver checks or updates the Web Driver with newer version, if available.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Browser:&amp;lt;/b&amp;gt; Function _WD_GetBrowserVersion returns the version number of the specified browser. If you need to update the Browser you have to download and install it by hand.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
The following tools will help you to automate your browser:&lt;br /&gt;
* [https://autonomiq.io/deviq-chropath.html ChroPath]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Makes finding an element by XPath, ID or CSS incredibly easy (Chrome, Firefox, Opera)&lt;br /&gt;
* [https://selectorshub.com/ SelectorsHub]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Next Gen XPath tool to generate, write and verify the XPath and cssSelectors (All browsers)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/01)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* AutoIt WebDriver threads:&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019 Example Scripts]&#039;&#039;&#039; forum - WebDriver UDF (W3C compliant version)&lt;br /&gt;
** Danp2&#039;s closed thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/ General Help and Support]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (this is part I)&lt;br /&gt;
** Danp2&#039;s closed thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/ General Help and Support II]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (II) &lt;br /&gt;
** Danp2&#039;s active thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/205553-webdriver-udf-help-support-iii/ General Help and Support III]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (III) &lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201283-im-creating-a-webdriver-tutorial General Help and Support]&#039;&#039;&#039; forum - Discussion about this Wiki Page&lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/ Example Scripts]&#039;&#039;&#039; forum - WebDriver example scripts collection&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/index.php?showtopic=206278 AutoIt Projects and Collaboration]&#039;&#039;&#039; forum - Webdriver, Websockets, and Chrome DevTools Protocol&lt;br /&gt;
&lt;br /&gt;
* WebDriver Exe documentation:&lt;br /&gt;
** [https://sites.google.com/a/chromium.org/chromedriver/ Chrome]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver Edge]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium Edge Chromium]&lt;br /&gt;
** [https://firefox-source-docs.mozilla.org/testing/geckodriver/ Firefox]&lt;br /&gt;
** [https://selenium.dev/documentation/en/webdriver/ Opera]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14516</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14516"/>
		<updated>2021-06-04T14:09:13Z</updated>

		<summary type="html">&lt;p&gt;Danp2: /* Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2021/02/07)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF (AutoIt)] by Ward and Jos&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF (AutoIt)] by trancexx or [https://github.com/dragana-r/autoit-winhttp autoit-winhttp (GitHub)]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF (GitHub)] by Danp2&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 89.0.4389.23 / &amp;lt;br&amp;gt; 2021.01.28 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 90.0.789.0 / &amp;lt;br&amp;gt; 2021.02.05 || &lt;br /&gt;
|-&lt;br /&gt;
| Firefox || [https://github.com/mozilla/geckodriver/releases GitHub] || 0.29 / &amp;lt;br&amp;gt; 2021.01.14 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases/latest GitHub] || 88.0.4324.104 / &amp;lt;br&amp;gt; 2021.02.03 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status Firefox]&lt;br /&gt;
* [https://github.com/operasoftware/operachromiumdriver Opera]: &amp;quot;&#039;&#039;OperaChromiumDriver is a WebDriver implementation derived from ChromeDriver and adapted by Opera&#039;&#039;&amp;quot;. That&#039;s why I think it has at least the same limitations as ChromeDriver.&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
=== Used Terms ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/08)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
	 &lt;br /&gt;
You will find the following terms when using WebDriver. We try to shed some light onto this subject here:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Marionette&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette consists of two parts: a server which takes requests and executes them in Gecko (the Marionette server ships with Firefox), and a client (the Marionette client ships with the GeckoDriver exe). The client sends commands to the server and the server executes the command inside the browser.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://firefox-source-docs.mozilla.org/testing/marionette/Intro.html visit this site].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ShadowRoot&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The ShadowRoot interface of the Shadow DOM API is the root node of a DOM subtree that is rendered separately from a document&#039;s main DOM tree.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://dom.spec.whatwg.org/#interface-shadowroot visit this site].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/09/27)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To automate your browser the following installation steps are needed:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory (with WD_Demo.au3):&lt;br /&gt;
** chromedriver.exe (Chrome)&lt;br /&gt;
** geckodriver.exe (Firefox)&lt;br /&gt;
** msedgedriver.exe (Edge - Chromium) or MicrosoftWebDriver.exe (Edge - EdgeHTML)&lt;br /&gt;
* Run WD_Demo.au3 and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\ ...&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;, ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function reference ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2021/02/07 - based on version 0.4.0.1)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WD_CORE ===&lt;br /&gt;
The WD_Core.au3 file holds functions to implement the Webdriver W3C document.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Action || Perform various interactions with the web driver session || Use one of the following values for parameter $sCommand:&lt;br /&gt;
 &#039;&#039;actions&#039;&#039;,&lt;br /&gt;
 &#039;&#039;back&#039;&#039;,&lt;br /&gt;
 &#039;&#039;forward&#039;&#039;,&lt;br /&gt;
 &#039;&#039;refresh&#039;&#039;,&lt;br /&gt;
 &#039;&#039;title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;url&#039;&#039;.&lt;br /&gt;
For command &#039;&#039;actions&#039;&#039;: Pass the actions to be set using parameter $sOption. If $sOption is empty then the set actions will be removed.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Alert || Respond to user prompt || Use one of the following actions to respond to the user prompt:&lt;br /&gt;
 &#039;&#039;accept&#039;&#039;,&lt;br /&gt;
 &#039;&#039;dismiss&#039;&#039;,&lt;br /&gt;
 &#039;&#039;gettext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;sendtext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;status&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Cookies || Gets, sets, or deletes the session&#039;s cookies || Use one of the following commands: &lt;br /&gt;
 &#039;&#039;get&#039;&#039; (Gets a single cookie),&lt;br /&gt;
 &#039;&#039;getall&#039;&#039; (Gets all cookies),&lt;br /&gt;
 &#039;&#039;add&#039;&#039; (Sets a single cookie),&lt;br /&gt;
 &#039;&#039;delete&#039;&#039; (Deletes a single cookie).&lt;br /&gt;
|-&lt;br /&gt;
| _WD_CreateSession|| Request new session from web driver || Define the capabilities of the browser with this function&lt;br /&gt;
|-&lt;br /&gt;
| _WD_DeleteSession || Delete existing session || Closes the session created by _WD_CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementAction || Perform action on designated element || Use one of the following actions:&lt;br /&gt;
 &#039;&#039;Active&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Attribute&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Clear&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Click&#039;&#039;,&lt;br /&gt;
 &#039;&#039;CompLabel&#039;&#039;(Get element&#039;s computed label),&lt;br /&gt;
 &#039;&#039;CompRole&#039;&#039; (Get element&#039;s computed role),&lt;br /&gt;
 &#039;&#039;CSS&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Displayed&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Enabled&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Name&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Property&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Rect&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Screenshot&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Selected&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Shadow&#039;&#039; (Get element&#039;s shadow root),&lt;br /&gt;
 &#039;&#039;Text&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Value&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Clear&#039;&#039;, &#039;&#039;Click&#039;&#039; and &#039;&#039;Value&#039;&#039; use POST to modify or process the element. All other actions use GET to retrieve data from the element&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteScript || Execute Javascipt commands || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FindElement|| Find element(s) by designated strategy || You can specify whether the function should only return the first find or all of them&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetSource || Get page source || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Navigate || Navigate to the designated URL || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Option || Sets and get options for the web driver UDF || The following options can be used:&lt;br /&gt;
 &#039;&#039;BaseURL&#039;&#039; (IP address used for web driver communication),&lt;br /&gt;
 &#039;&#039;BinaryFormat&#039;&#039; (format used to store binary data),&lt;br /&gt;
 &#039;&#039;Console&#039;&#039; (define destination for console output),&lt;br /&gt;
 &#039;&#039;Driver&#039;&#039; (set the full path name to web driver executable),&lt;br /&gt;
 &#039;&#039;DriverParams&#039;&#039; (parameters to pass to web driver executable),&lt;br /&gt;
 &#039;&#039;Port&#039;&#039; (port used for web driver communication).&lt;br /&gt;
If no value is passed to be set the current value is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Shutdown || Kill the web driver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Startup || Launch the designated web driver console app || The PID for the WebDriver console is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Status || Get current web driver state || Returns a raw JSON response from the web driver&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Timeouts || Set or retrieve the session timeout parameters || Specify the type and value of the timeout like this: &#039;{&amp;quot;type&amp;quot;:value}&#039;. Example: &#039;{&amp;quot;pageLoad&amp;quot;:2000}&#039;&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Window || Perform interactions related to the current window || One of the following actions:&lt;br /&gt;
 &#039;&#039;close&#039;&#039; (close current tab),&lt;br /&gt;
 &#039;&#039;frame&#039;&#039; (switch to frame),&lt;br /&gt;
 &#039;&#039;fullscreen&#039;&#039; (set window to fullscreen),&lt;br /&gt;
 &#039;&#039;handles&#039;&#039; (get all window handles),&lt;br /&gt;
 &#039;&#039;maximize&#039;&#039; (maximize window),&lt;br /&gt;
 &#039;&#039;minimize&#039;&#039; (minimize window), &lt;br /&gt;
 &#039;&#039;parent&#039;&#039; (switch to parent frame),&lt;br /&gt;
 &#039;&#039;rect&#039;&#039; (get or set the window&#039;s size &amp;amp; position),&lt;br /&gt;
 &#039;&#039;screenshot&#039;&#039; (take screenshot of window),&lt;br /&gt;
 &#039;&#039;switch&#039;&#039; (switch to designated tab),&lt;br /&gt;
 &#039;&#039;window&#039;&#039; (get current tab&#039;s window handle).&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== WD_HELPER ===&lt;br /&gt;
The WD_Helper.au3 file holds functions to help you automate a web site.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Attach || Attach to existing browser tab || Use one of the following search modes:&lt;br /&gt;
 &#039;&#039;HTML&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;URL&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ConsoleVisible || Control visibility of the webdriver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_DownloadFile || Download file and save to disk || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementActionEx || Perform advanced action on desginated element || Use one of the following commands:&lt;br /&gt;
 &#039;&#039;hover&#039;&#039;, &lt;br /&gt;
 &#039;&#039;doubleclick&#039;&#039;, &lt;br /&gt;
 &#039;&#039;rightclick&#039;&#039;,&lt;br /&gt;
 &#039;&#039;clickandhold&#039;&#039;,&lt;br /&gt;
 &#039;&#039;hide&#039;&#039;,&lt;br /&gt;
 &#039;&#039;show&#039;&#039;.&lt;br /&gt;
 &#039;&#039;childcount&#039;&#039;.&lt;br /&gt;
 &#039;&#039;modifierclick&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementOptionSelect || Find and click on an option from a Select element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementSelectAction || Perform action on designated Select element || Use one of the following commands:&lt;br /&gt;
 &#039;&#039;options&#039;&#039;,&lt;br /&gt;
 &#039;&#039;value&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteCdpCommand || ChromeDriver specific function to execute &amp;quot;Chrome DevTools Protocol&amp;quot; (CDP) commands ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameEnter || Will enter the specified frame for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameLeave || Will leave the current frame, to its parent, not necessarily the Top, for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementById || Locate element by id ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementByName || Locate element by name ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementFromPoint || Retrieves reference to element descriped by x/y coordinate || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetFrameCount || Returns how many frames/iframes are in your current window/frame || It will not traverse to nested frames&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetMouseElement || Retrieves reference to element below mouse pointer || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetShadowRoot || Retrieves the shadow root of an element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetTable || Return all elements of a table ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElement || Will highlight the specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElements || Will highlight multiple elements passed as an array || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsLatestRelease || Compares local UDF version to latest release on Github || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsWindowTop || Returns a boolean of the session being at the top level, or in a frame(s) || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_jQuerify || Inject jQuery library into current session || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LastHTTPResult || Return the result of the last WinHTTP request || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LinkClickByText || Simulate a mouse click on a link with text matching the provided string || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LoadWait || Wait for a browser page load to complete before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_NewTab || Create new tab using Javascript ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_PrintToPDF || Print the current tab in paginated PDF format ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Screenshot || Will return a screenshot of the browser window or a specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SelectFiles || Select files for uploading to a website || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetElementValue || Set value of designated element ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetTimeouts || User friendly function to set webdriver session timeouts ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_UpdateDriver || Replace web driver with newer version, if available || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_WaitElement || Wait for a element to be found in the current tab before returning || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/07/06)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
==== WinHTTP UDF ====&lt;br /&gt;
Make sure that you are running at least version 1.6.4.2 (currently unreleased, but can be obtained [https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3 here]).&lt;br /&gt;
==== Chrome ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugChrome1&amp;quot;&amp;gt;Chrome does not start and the DOS window for chromedriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugChrome1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Chrome and does not display the DOS window for chromedriver.&amp;lt;br&amp;gt;When you manually run the chromedriver in a DOS window you get message &amp;quot;[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied.&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the chrome driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\chromedriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugFirefox1&amp;quot;&amp;gt;Firefox does not start and the DOS window for geckodriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugFirefox1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Firefox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the gecko driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\geckodriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/10/11)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ1&amp;quot;&amp;gt;1. How to connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ2&amp;quot;&amp;gt;2. How to hide the webdriver console&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I hide the webdriver console?&amp;lt;br&amp;gt;A: The console can be completely hidden from the start by adding the following line near the beginning of your script:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error&amp;lt;/syntaxhighlight&amp;gt;You can also control the visibility of the console with the function _WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ3&amp;quot;&amp;gt;3. How to utilize an existing user profile&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Can I use an existing user profile instead of the default behavior of using a new one?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration, with each browser using a different method to implement. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;:[&amp;quot;--user-data-dir=C:\\Users\\&#039; &amp;amp; @UserName &amp;amp; &#039;\\AppData\\Local\\Google\\Chrome\\User Data\\&amp;quot;, &amp;quot;--profile-directory=Default&amp;quot;]}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;:{&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;moz:firefoxOptions&amp;quot;: {&amp;quot;args&amp;quot;: [&amp;quot;-profile&amp;quot;, &amp;quot;&#039; &amp;amp; GetDefaultFFProfile() &amp;amp; &#039;&amp;quot;],&amp;quot;log&amp;quot;: {&amp;quot;level&amp;quot;: &amp;quot;trace&amp;quot;}}}}}&#039;&lt;br /&gt;
&lt;br /&gt;
Func GetDefaultFFProfile()&lt;br /&gt;
	Local $sDefault, $sProfilePath = &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
	Local $sProfilesPath = StringReplace(@AppDataDir, &#039;\&#039;, &#039;/&#039;) &amp;amp; &amp;quot;/Mozilla/Firefox/&amp;quot;&lt;br /&gt;
	Local $sFilename = $sProfilesPath &amp;amp; &amp;quot;profiles.ini&amp;quot;&lt;br /&gt;
	Local $aSections = IniReadSectionNames ($sFilename)&lt;br /&gt;
&lt;br /&gt;
	If Not @error Then&lt;br /&gt;
		For $i = 1 To $aSections[0]&lt;br /&gt;
			$sDefault = IniRead($sFilename, $aSections[$i], &#039;Default&#039;, &#039;0&#039;)&lt;br /&gt;
&lt;br /&gt;
			If $sDefault = &#039;1&#039; Then&lt;br /&gt;
				$sProfilePath = $sProfilesPath &amp;amp; IniRead($sFilename, $aSections[$i], &amp;quot;Path&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
				ExitLoop&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	Return $sProfilePath&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will also likely need to specify the marionette port:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&#039;DriverParams&#039;, &#039;--marionette-port 2828&#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ4&amp;quot;&amp;gt;4. How to specify location of browser executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch a browser installed in a non-standard location?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\chrome.exe&amp;quot; }}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;desiredCapabilities&amp;quot;:{&amp;quot;javascriptEnabled&amp;quot;:true,&amp;quot;nativeEvents&amp;quot;:true,&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;moz:firefoxOptions&amp;quot;:{&amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\firefox.exe&amp;quot;}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;Alternate Firefox method:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_Option(&#039;DriverParams&#039;, &#039;--binary &amp;quot;C:\Program Files\Mozilla Firefox\firefox.exe&amp;quot; --log trace &#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ5&amp;quot;&amp;gt;5. How to maximize the browser window&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ5&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to maximize the browser window?&amp;lt;br&amp;gt;A: Simply call the following function:&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Window($sSession, &amp;quot;Maximize&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Make sure to call _WD_Window after the session has been created with _WD_CreateSession.&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ6&amp;quot;&amp;gt;6. How to specify location of WebDriver executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ6&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch the WebDriver executable from a specific location?&amp;lt;br&amp;gt;A: This is controlled by function &amp;quot;_WD_Option&amp;quot;. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\local\WebDriver\WebDriver.exe&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ7&amp;quot;&amp;gt;7. How to retrieve the values of a drop-down list&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ7&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How to retrieve the values of a drop-down list (&amp;lt;Select&amp;gt; tag)?&amp;lt;br&amp;gt;A1: Here&#039;s a simple way to do it:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$sText = _WD_ElementAction($sSession, $sElement, &#039;property&#039;, &#039;innerText&#039;)&lt;br /&gt;
$aOptions = StringSplit ( $sText, @LF,  $STR_NOCOUNT)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;xxx&#039; is the name of the drop-down list.&lt;br /&gt;
&amp;lt;br&amp;gt;A2: This can now be accomplished using the function _WD_ElementSelectAction:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$aOptions = _WD_ElementSelectAction ($sSession, $sElement, &#039;options&#039;)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ8&amp;quot;&amp;gt;8. How to run the browser in headless mode&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ8&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How do I run the browser in &amp;quot;headless&amp;quot; mode?&amp;lt;br&amp;gt;A: This is controlled by the Capabilities string that is passed to _WD_CreateSession. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;: [&amp;quot;--headless&amp;quot;, &amp;quot;--allow-running-insecure-content&amp;quot;] }}}}&#039; &amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
The following tools will help you to automate your browser:&lt;br /&gt;
* [https://autonomiq.io/deviq-chropath.html ChroPath]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Makes finding an element by XPath, ID or CSS incredibly easy (Chrome, Firefox, Opera)&lt;br /&gt;
* [https://selectorshub.com/ SelectorsHub]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Next Gen XPath tool to generate, write and verify the XPath and cssSelectors (All browsers)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/01)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* AutoIt WebDriver threads:&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019 Example Scripts]&#039;&#039;&#039; forum - WebDriver UDF (W3C compliant version)&lt;br /&gt;
** Danp2&#039;s closed thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/ General Help and Support]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (this is part I)&lt;br /&gt;
** Danp2&#039;s closed thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/ General Help and Support II]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (II) &lt;br /&gt;
** Danp2&#039;s active thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/205553-webdriver-udf-help-support-iii/ General Help and Support III]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (III) &lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201283-im-creating-a-webdriver-tutorial General Help and Support]&#039;&#039;&#039; forum - Discussion about this Wiki Page&lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/ Example Scripts]&#039;&#039;&#039; forum - WebDriver example scripts collection&lt;br /&gt;
&lt;br /&gt;
* WebDriver Exe documentation:&lt;br /&gt;
** [https://sites.google.com/a/chromium.org/chromedriver/ Chrome]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver Edge]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium Edge Chromium]&lt;br /&gt;
** [https://firefox-source-docs.mozilla.org/testing/geckodriver/ Firefox]&lt;br /&gt;
** [https://selenium.dev/documentation/en/webdriver/ Opera]&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14506</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14506"/>
		<updated>2021-04-14T16:02:24Z</updated>

		<summary type="html">&lt;p&gt;Danp2: /* FAQ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2021/02/07)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF (AutoIt)] by Ward and Jos&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF (AutoIt)] by trancexx or [https://github.com/dragana-r/autoit-winhttp autoit-winhttp (GitHub)]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF (GitHub)] by Danp2&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 89.0.4389.23 / &amp;lt;br&amp;gt; 2021.01.28 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 90.0.789.0 / &amp;lt;br&amp;gt; 2021.02.05 || &lt;br /&gt;
|-&lt;br /&gt;
| Firefox || [https://github.com/mozilla/geckodriver/releases GitHub] || 0.29 / &amp;lt;br&amp;gt; 2021.01.14 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases/latest GitHub] || 88.0.4324.104 / &amp;lt;br&amp;gt; 2021.02.03 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status Firefox]&lt;br /&gt;
* [https://github.com/operasoftware/operachromiumdriver Opera]: &amp;quot;&#039;&#039;OperaChromiumDriver is a WebDriver implementation derived from ChromeDriver and adapted by Opera&#039;&#039;&amp;quot;. That&#039;s why I think it has at least the same limitations as ChromeDriver.&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
=== Used Terms ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/08)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
	 &lt;br /&gt;
You will find the following terms when using WebDriver. We try to shed some light onto this subject here:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Marionette&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette consists of two parts: a server which takes requests and executes them in Gecko (the Marionette server ships with Firefox), and a client (the Marionette client ships with the GeckoDriver exe). The client sends commands to the server and the server executes the command inside the browser.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://firefox-source-docs.mozilla.org/testing/marionette/Intro.html visit this site].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ShadowRoot&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The ShadowRoot interface of the Shadow DOM API is the root node of a DOM subtree that is rendered separately from a document&#039;s main DOM tree.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://dom.spec.whatwg.org/#interface-shadowroot visit this site].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/09/27)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To automate your browser the following installation steps are needed:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory (with WD_Demo.au3):&lt;br /&gt;
** chromedriver.exe (Chrome)&lt;br /&gt;
** geckodriver.exe (Firefox)&lt;br /&gt;
** msedgedriver.exe (Edge - Chromium) or MicrosoftWebDriver.exe (Edge - EdgeHTML)&lt;br /&gt;
* Run WD_Demo.au3 and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\ ...&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;, ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function reference ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2021/02/07 - based on version 0.4.0.1)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WD_CORE ===&lt;br /&gt;
The WD_Core.au3 file holds functions to implement the Webdriver W3C document.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Action || Perform various interactions with the web driver session || Use one of the following values for parameter $sCommand:&lt;br /&gt;
 &#039;&#039;actions&#039;&#039;,&lt;br /&gt;
 &#039;&#039;back&#039;&#039;,&lt;br /&gt;
 &#039;&#039;forward&#039;&#039;,&lt;br /&gt;
 &#039;&#039;refresh&#039;&#039;,&lt;br /&gt;
 &#039;&#039;title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;url&#039;&#039;.&lt;br /&gt;
For command &#039;&#039;actions&#039;&#039;: Pass the actions to be set using parameter $sOption. If $sOption is empty then the set actions will be removed.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Alert || Respond to user prompt || Use one of the following actions to respond to the user prompt:&lt;br /&gt;
 &#039;&#039;accept&#039;&#039;,&lt;br /&gt;
 &#039;&#039;dismiss&#039;&#039;,&lt;br /&gt;
 &#039;&#039;gettext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;sendtext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;status&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Cookies || Gets, sets, or deletes the session&#039;s cookies || Use one of the following commands: &lt;br /&gt;
 &#039;&#039;get&#039;&#039; (Gets a single cookie),&lt;br /&gt;
 &#039;&#039;getall&#039;&#039; (Gets all cookies),&lt;br /&gt;
 &#039;&#039;add&#039;&#039; (Sets a single cookie),&lt;br /&gt;
 &#039;&#039;delete&#039;&#039; (Deletes a single cookie).&lt;br /&gt;
|-&lt;br /&gt;
| _WD_CreateSession|| Request new session from web driver || Define the capabilities of the browser with this function&lt;br /&gt;
|-&lt;br /&gt;
| _WD_DeleteSession || Delete existing session || Closes the session created by _WD_CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementAction || Perform action on designated element || Use one of the following actions:&lt;br /&gt;
 &#039;&#039;Active&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Attribute&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Clear&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Click&#039;&#039;,&lt;br /&gt;
 &#039;&#039;CompLabel&#039;&#039;(Get element&#039;s computed label),&lt;br /&gt;
 &#039;&#039;CompRole&#039;&#039; (Get element&#039;s computed role),&lt;br /&gt;
 &#039;&#039;CSS&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Displayed&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Enabled&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Name&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Property&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Rect&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Screenshot&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Selected&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Shadow&#039;&#039; (Get element&#039;s shadow root),&lt;br /&gt;
 &#039;&#039;Text&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Value&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Clear&#039;&#039;, &#039;&#039;Click&#039;&#039; and &#039;&#039;Value&#039;&#039; use POST to modify or process the element. All other actions use GET to retrieve data from the element&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteScript || Execute Javascipt commands || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FindElement|| Find element(s) by designated strategy || You can specify whether the function should only return the first find or all of them&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetSource || Get page source || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Navigate || Navigate to the designated URL || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Option || Sets and get options for the web driver UDF || The following options can be used:&lt;br /&gt;
 &#039;&#039;BaseURL&#039;&#039; (IP address used for web driver communication),&lt;br /&gt;
 &#039;&#039;BinaryFormat&#039;&#039; (format used to store binary data),&lt;br /&gt;
 &#039;&#039;Console&#039;&#039; (define destination for console output),&lt;br /&gt;
 &#039;&#039;Driver&#039;&#039; (set the full path name to web driver executable),&lt;br /&gt;
 &#039;&#039;DriverParams&#039;&#039; (parameters to pass to web driver executable),&lt;br /&gt;
 &#039;&#039;Port&#039;&#039; (port used for web driver communication).&lt;br /&gt;
If no value is passed to be set the current value is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Shutdown || Kill the web driver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Startup || Launch the designated web driver console app || The PID for the WebDriver console is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Status || Get current web driver state || Returns a raw JSON response from the web driver&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Timeouts || Set or retrieve the session timeout parameters || Specify the type and value of the timeout like this: &#039;{&amp;quot;type&amp;quot;:value}&#039;. Example: &#039;{&amp;quot;pageLoad&amp;quot;:2000}&#039;&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Window || Perform interactions related to the current window || One of the following actions:&lt;br /&gt;
 &#039;&#039;close&#039;&#039; (close current tab),&lt;br /&gt;
 &#039;&#039;frame&#039;&#039; (switch to frame),&lt;br /&gt;
 &#039;&#039;fullscreen&#039;&#039; (set window to fullscreen),&lt;br /&gt;
 &#039;&#039;handles&#039;&#039; (get all window handles),&lt;br /&gt;
 &#039;&#039;maximize&#039;&#039; (maximize window),&lt;br /&gt;
 &#039;&#039;minimize&#039;&#039; (minimize window), &lt;br /&gt;
 &#039;&#039;parent&#039;&#039; (switch to parent frame),&lt;br /&gt;
 &#039;&#039;rect&#039;&#039; (get or set the window&#039;s size &amp;amp; position),&lt;br /&gt;
 &#039;&#039;screenshot&#039;&#039; (take screenshot of window),&lt;br /&gt;
 &#039;&#039;switch&#039;&#039; (switch to designated tab),&lt;br /&gt;
 &#039;&#039;window&#039;&#039; (get current tab&#039;s window handle).&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== WD_HELPER ===&lt;br /&gt;
The WD_Helper.au3 file holds functions to help you automate a web site.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Attach || Attach to existing browser tab || Use one of the following search modes:&lt;br /&gt;
 &#039;&#039;HTML&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;URL&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ConsoleVisible || Control visibility of the webdriver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_DownloadFile || Download file and save to disk || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementActionEx || Perform advanced action on desginated element || Use one of the following commands:&lt;br /&gt;
 &#039;&#039;doubleclick&#039;&#039;, &lt;br /&gt;
 &#039;&#039;hide&#039;&#039;,&lt;br /&gt;
 &#039;&#039;hover&#039;&#039;,&lt;br /&gt;
 &#039;&#039;rightclick&#039;&#039;,&lt;br /&gt;
 &#039;&#039;show&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementOptionSelect || Find and click on an option from a Select element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementSelectAction || Perform action on designated Select element || Use one of the following commands:&lt;br /&gt;
 &#039;&#039;options&#039;&#039;,&lt;br /&gt;
 &#039;&#039;value&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteCdpCommand || ChromeDriver specific function to execute &amp;quot;Chrome DevTools Protocol&amp;quot; (CDP) commands ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameEnter || Will enter the specified frame for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameLeave || Will leave the current frame, to its parent, not necessarily the Top, for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementById || Locate element by id ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementByName || Locate element by name ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementFromPoint || Retrieves reference to element descriped by x/y coordinate || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetFrameCount || Returns how many frames/iframes are in your current window/frame || It will not traverse to nested frames&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetMouseElement || Retrieves reference to element below mouse pointer || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetShadowRoot || Retrieves the shadow root of an element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetTable || Return all elements of a table ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElement || Will highlight the specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElements || Will highlight multiple elements passed as an array || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsLatestRelease || Compares local UDF version to latest release on Github || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsWindowTop || Returns a boolean of the session being at the top level, or in a frame(s) || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_jQuerify || Inject jQuery library into current session || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LastHTTPResult || Return the result of the last WinHTTP request || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LinkClickByText || Simulate a mouse click on a link with text matching the provided string || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LoadWait || Wait for a browser page load to complete before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_NewTab || Create new tab using Javascript ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_PrintToPDF || Print the current tab in paginated PDF format ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Screenshot || Will return a screenshot of the browser window or a specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SelectFiles || Select files for uploading to a website || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetElementValue || Set value of designated element ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetTimeouts || User friendly function to set webdriver session timeouts ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_UpdateDriver || Replace web driver with newer version, if available || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_WaitElement || Wait for a element to be found in the current tab before returning || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/07/06)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
==== WinHTTP UDF ====&lt;br /&gt;
Make sure that you are running at least version 1.6.4.2 (currently unreleased, but can be obtained [https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3 here]).&lt;br /&gt;
==== Chrome ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugChrome1&amp;quot;&amp;gt;Chrome does not start and the DOS window for chromedriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugChrome1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Chrome and does not display the DOS window for chromedriver.&amp;lt;br&amp;gt;When you manually run the chromedriver in a DOS window you get message &amp;quot;[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied.&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the chrome driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\chromedriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugFirefox1&amp;quot;&amp;gt;Firefox does not start and the DOS window for geckodriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugFirefox1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Firefox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the gecko driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\geckodriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/10/11)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ1&amp;quot;&amp;gt;1. How to connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ2&amp;quot;&amp;gt;2. How to hide the webdriver console&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I hide the webdriver console?&amp;lt;br&amp;gt;A: The console can be completely hidden from the start by adding the following line near the beginning of your script:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error&amp;lt;/syntaxhighlight&amp;gt;You can also control the visibility of the console with the function _WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ3&amp;quot;&amp;gt;3. How to utilize an existing user profile&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Can I use an existing user profile instead of the default behavior of using a new one?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration, with each browser using a different method to implement. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;:[&amp;quot;--user-data-dir=C:\\Users\\&#039; &amp;amp; @UserName &amp;amp; &#039;\\AppData\\Local\\Google\\Chrome\\User Data\\&amp;quot;, &amp;quot;--profile-directory=Default&amp;quot;]}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;:{&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;moz:firefoxOptions&amp;quot;: {&amp;quot;args&amp;quot;: [&amp;quot;-profile&amp;quot;, &amp;quot;&#039; &amp;amp; GetDefaultFFProfile() &amp;amp; &#039;&amp;quot;],&amp;quot;log&amp;quot;: {&amp;quot;level&amp;quot;: &amp;quot;trace&amp;quot;}}}}}&#039;&lt;br /&gt;
&lt;br /&gt;
Func GetDefaultFFProfile()&lt;br /&gt;
	Local $sDefault, $sProfilePath = &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
	Local $sProfilesPath = StringReplace(@AppDataDir, &#039;\&#039;, &#039;/&#039;) &amp;amp; &amp;quot;/Mozilla/Firefox/&amp;quot;&lt;br /&gt;
	Local $sFilename = $sProfilesPath &amp;amp; &amp;quot;profiles.ini&amp;quot;&lt;br /&gt;
	Local $aSections = IniReadSectionNames ($sFilename)&lt;br /&gt;
&lt;br /&gt;
	If Not @error Then&lt;br /&gt;
		For $i = 1 To $aSections[0]&lt;br /&gt;
			$sDefault = IniRead($sFilename, $aSections[$i], &#039;Default&#039;, &#039;0&#039;)&lt;br /&gt;
&lt;br /&gt;
			If $sDefault = &#039;1&#039; Then&lt;br /&gt;
				$sProfilePath = $sProfilesPath &amp;amp; IniRead($sFilename, $aSections[$i], &amp;quot;Path&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
				ExitLoop&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	Return $sProfilePath&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will also likely need to specify the marionette port:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&#039;DriverParams&#039;, &#039;--marionette-port 2828&#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ4&amp;quot;&amp;gt;4. How to specify location of browser executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch a browser installed in a non-standard location?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\chrome.exe&amp;quot; }}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;desiredCapabilities&amp;quot;:{&amp;quot;javascriptEnabled&amp;quot;:true,&amp;quot;nativeEvents&amp;quot;:true,&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;moz:firefoxOptions&amp;quot;:{&amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\firefox.exe&amp;quot;}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;Alternate Firefox method:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_Option(&#039;DriverParams&#039;, &#039;--binary &amp;quot;C:\Program Files\Mozilla Firefox\firefox.exe&amp;quot; --log trace &#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ5&amp;quot;&amp;gt;5. How to maximize the browser window&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ5&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to maximize the browser window?&amp;lt;br&amp;gt;A: Simply call the following function:&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Window($sSession, &amp;quot;Maximize&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Make sure to call _WD_Window after the session has been created with _WD_CreateSession.&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ6&amp;quot;&amp;gt;6. How to specify location of WebDriver executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ6&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch the WebDriver executable from a specific location?&amp;lt;br&amp;gt;A: This is controlled by function &amp;quot;_WD_Option&amp;quot;. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\local\WebDriver\WebDriver.exe&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ7&amp;quot;&amp;gt;7. How to retrieve the values of a drop-down list&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ7&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How to retrieve the values of a drop-down list (&amp;lt;Select&amp;gt; tag)?&amp;lt;br&amp;gt;A1: Here&#039;s a simple way to do it:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$sText = _WD_ElementAction($sSession, $sElement, &#039;property&#039;, &#039;innerText&#039;)&lt;br /&gt;
$aOptions = StringSplit ( $sText, @LF,  $STR_NOCOUNT)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;xxx&#039; is the name of the drop-down list.&lt;br /&gt;
&amp;lt;br&amp;gt;A2: This can now be accomplished using the function _WD_ElementSelectAction:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$aOptions = _WD_ElementSelectAction ($sSession, $sElement, &#039;options&#039;)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ8&amp;quot;&amp;gt;8. How to run the browser in headless mode&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ8&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How do I run the browser in &amp;quot;headless&amp;quot; mode?&amp;lt;br&amp;gt;A: This is controlled by the Capabilities string that is passed to _WD_CreateSession. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;: [&amp;quot;--headless&amp;quot;, &amp;quot;--allow-running-insecure-content&amp;quot;] }}}}&#039; &amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
The following tools will help you to automate your browser:&lt;br /&gt;
* [https://autonomiq.io/deviq-chropath.html ChroPath]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Makes finding an element by XPath, ID or CSS incredibly easy (Chrome, Firefox, Opera)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/01)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* AutoIt WebDriver threads:&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019 Example Scripts]&#039;&#039;&#039; forum - WebDriver UDF (W3C compliant version)&lt;br /&gt;
** Danp2&#039;s closed thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/ General Help and Support]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (this is part I)&lt;br /&gt;
** Danp2&#039;s active thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/ General Help and Support II]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (II) &lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201283-im-creating-a-webdriver-tutorial General Help and Support]&#039;&#039;&#039; forum - Discussion about this Wiki Page&lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/ Example Scripts]&#039;&#039;&#039; forum - WebDriver example scripts collection&lt;br /&gt;
&lt;br /&gt;
* WebDriver Exe documentation:&lt;br /&gt;
** [https://sites.google.com/a/chromium.org/chromedriver/ Chrome]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver Edge]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium Edge Chromium]&lt;br /&gt;
** [https://firefox-source-docs.mozilla.org/testing/geckodriver/ Firefox]&lt;br /&gt;
** [https://selenium.dev/documentation/en/webdriver/ Opera]&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14478</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14478"/>
		<updated>2021-01-27T21:03:24Z</updated>

		<summary type="html">&lt;p&gt;Danp2: /* Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/10/11)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF (AutoIt)] by Ward and Jos&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF (AutoIt)] by trancexx or [https://github.com/dragana-r/autoit-winhttp autoit-winhttp (GitHub)]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF (GitHub)] by Danp2&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 86.0.4240.22 / &amp;lt;br&amp;gt; 2020.09.03 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 87.0.666.0 / &amp;lt;br&amp;gt; 2020.10.09 || &lt;br /&gt;
|-&lt;br /&gt;
| Firefox || [https://github.com/mozilla/geckodriver/releases GitHub] || 0.27 / &amp;lt;br&amp;gt; 2020.07.29 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases/latest GitHub] || 85.0.4183.102 / &amp;lt;br&amp;gt; 2020.09.15 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status Firefox]&lt;br /&gt;
* [https://github.com/operasoftware/operachromiumdriver Opera]: &amp;quot;&#039;&#039;OperaChromiumDriver is a WebDriver implementation derived from ChromeDriver and adapted by Opera&#039;&#039;&amp;quot;. That&#039;s why I think it has at least the same limitations as ChromeDriver.&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
=== Used Terms ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/08)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
	 &lt;br /&gt;
You will find the following terms when using WebDriver. We try to shed some light onto this subject here:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Marionette&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette consists of two parts: a server which takes requests and executes them in Gecko (the Marionette server ships with Firefox), and a client (the Marionette client ships with the GeckoDriver exe). The client sends commands to the server and the server executes the command inside the browser.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://firefox-source-docs.mozilla.org/testing/marionette/Intro.html visit this site].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ShadowRoot&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The ShadowRoot interface of the Shadow DOM API is the root node of a DOM subtree that is rendered separately from a document&#039;s main DOM tree.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://dom.spec.whatwg.org/#interface-shadowroot visit this site].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/09/27)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To automate your browser the following installation steps are needed:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory (with WD_Demo.au3):&lt;br /&gt;
** chromedriver.exe (Chrome)&lt;br /&gt;
** geckodriver.exe (Firefox)&lt;br /&gt;
** msedgedriver.exe (Edge - Chromium) or MicrosoftWebDriver.exe (Edge - EdgeHTML)&lt;br /&gt;
* Run WD_Demo.au3 and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\ ...&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;, ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function reference ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/11/16 - based on version 0.3.1.0)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WD_CORE ===&lt;br /&gt;
The WD_Core.au3 file holds functions to implement the Webdriver W3C document.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Action || Perform various interactions with the web driver session || Use one of the following values for parameter $sCommand:&lt;br /&gt;
 &#039;&#039;actions&#039;&#039;,&lt;br /&gt;
 &#039;&#039;back&#039;&#039;,&lt;br /&gt;
 &#039;&#039;forward&#039;&#039;,&lt;br /&gt;
 &#039;&#039;refresh&#039;&#039;,&lt;br /&gt;
 &#039;&#039;title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;url&#039;&#039;.&lt;br /&gt;
For command &#039;&#039;actions&#039;&#039;: Pass the actions to be set using parameter $sOption. If $sOption is empty then the set actions will be removed.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Alert || Respond to user prompt || Use one of the following actions to respond to the user prompt:&lt;br /&gt;
 &#039;&#039;accept&#039;&#039;,&lt;br /&gt;
 &#039;&#039;dismiss&#039;&#039;,&lt;br /&gt;
 &#039;&#039;gettext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;sendtext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;status&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Cookies || Gets, sets, or deletes the session&#039;s cookies || Use one of the following commands: &lt;br /&gt;
 &#039;&#039;get&#039;&#039; (Gets a single cookie)&lt;br /&gt;
 &#039;&#039;getall&#039;&#039; (Gets all cookies)&lt;br /&gt;
 &#039;&#039;add&#039;&#039; (Sets a single cookie)&lt;br /&gt;
 &#039;&#039;delete&#039;&#039; (Deletes a single cookie)&lt;br /&gt;
|-&lt;br /&gt;
| _WD_CreateSession|| Request new session from web driver || Define the capabilities of the browser with this function&lt;br /&gt;
|-&lt;br /&gt;
| _WD_DeleteSession || Delete existing session || Closes the session created by _WD_CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementAction || Perform action on designated element || Use one of the following actions:&lt;br /&gt;
 &#039;&#039;Active&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Attribute&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Clear&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Click&#039;&#039;,&lt;br /&gt;
 &#039;&#039;CSS&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Displayed&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Enabled&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Name&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Property&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Rect&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Screenshot&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Selected&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Text&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Value&#039;&#039;. &lt;br /&gt;
&#039;&#039;Clear&#039;&#039;, &#039;&#039;Click&#039;&#039; and &#039;&#039;Value&#039;&#039; use POST to modify or process the element. All other actions use GET to retrieve data from the element&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteScript || Execute Javascipt commands || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FindElement|| Find element(s) by designated strategy || You can specify whether the function should only return the first find or all of them&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetSource || Get page source || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Navigate || Navigate to the designated URL || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Option || Sets and get options for the web driver UDF || The following options can be used:&lt;br /&gt;
 &#039;&#039;BaseURL&#039;&#039; (IP address used for web driver communication),&lt;br /&gt;
 &#039;&#039;BinaryFormat&#039;&#039; (format used to store binary data),&lt;br /&gt;
 &#039;&#039;Console&#039;&#039; (define destination for console output),&lt;br /&gt;
 &#039;&#039;Driver&#039;&#039; (set the full path name to web driver executable),&lt;br /&gt;
 &#039;&#039;DriverParams&#039;&#039; (parameters to pass to web driver executable),&lt;br /&gt;
 &#039;&#039;Port&#039;&#039; (port used for web driver communication).&lt;br /&gt;
If no value is passed to be set the current value is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Shutdown || Kill the web driver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Startup || Launch the designated web driver console app || The PID for the WebDriver console is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Status || Get current web driver state || Returns a raw JSON response from the web driver&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Timeouts || Set or retrieve the session timeout parameters || Specify the type and value of the timeout like this: &#039;{&amp;quot;type&amp;quot;:value}&#039;. Example: &#039;{&amp;quot;pageLoad&amp;quot;:2000}&#039;&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Window || Perform interactions related to the current window || One of the following actions:&lt;br /&gt;
 &#039;&#039;close&#039;&#039; (close current tab),&lt;br /&gt;
 &#039;&#039;frame&#039;&#039; (switch to frame),&lt;br /&gt;
 &#039;&#039;fullscreen&#039;&#039; (set window to fullscreen),&lt;br /&gt;
 &#039;&#039;handles&#039;&#039; (get all window handles),&lt;br /&gt;
 &#039;&#039;maximize&#039;&#039; (maximize window),&lt;br /&gt;
 &#039;&#039;minimize&#039;&#039; (minimize window), &lt;br /&gt;
 &#039;&#039;parent&#039;&#039; (switch to parent frame),&lt;br /&gt;
 &#039;&#039;rect&#039;&#039; (get or set the window&#039;s size &amp;amp; position),&lt;br /&gt;
 &#039;&#039;screenshot&#039;&#039; (take screenshot of window),&lt;br /&gt;
 &#039;&#039;switch&#039;&#039; (switch to designated tab),&lt;br /&gt;
 &#039;&#039;window&#039;&#039; (get current tab&#039;s window handle).&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== WD_HELPER ===&lt;br /&gt;
The WD_Helper.au3 file holds functions to help you automate a web site.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Attach || Attach to existing browser tab || Use one of the following search modes:&lt;br /&gt;
 &#039;&#039;HTML&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;URL&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ConsoleVisible || Control visibility of the webdriver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_DownloadFile || Download file and save to disk || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementActionEx || Perform advanced action on desginated element ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementOptionSelect || Find and click on an option from a Select element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementSelectAction || Perform action on designated Select element || Use one of the following commands:&lt;br /&gt;
 &#039;&#039;options&#039;&#039;,&lt;br /&gt;
 &#039;&#039;value&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteCdpCommand || ChromeDriver specific function to execute &amp;quot;Chrome DevTools Protocol&amp;quot; (CDP) commands ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameEnter || Will enter the specified frame for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameLeave || Will leave the current frame, to its parent, not necessarily the Top, for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementById || Locate element by id ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementByName || Locate element by name ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementFromPoint || Retrieves reference to element descriped by x/y coordinate || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetFrameCount || Returns how many frames/iframes are in your current window/frame || It will not traverse to nested frames&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetMouseElement || Retrieves reference to element below mouse pointer || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetShadowRoot || Retrieves the shadow root of an element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetTable || Return all elements of a table ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElement || Will highlight the specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElements || Will highlight multiple elements passed as an array || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsLatestRelease || Compares local UDF version to latest release on Github || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsWindowTop || Returns a boolean of the session being at the top level, or in a frame(s) || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LastHTTPResult || Return the result of the last WinHTTP request || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LinkClickByText || Simulate a mouse click on a link with text matching the provided string || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LoadWait || Wait for a browser page load to complete before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_NewTab || Create new tab using Javascript ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Screenshot || Will return a screenshot of the browser window or a specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SelectFiles || Select files for uploading to a website || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetElementValue || Set value of designated element ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetTimeouts || User friendly function to set webdriver session timeouts ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_UpdateDriver || Replace web driver with newer version, if available || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_WaitElement || Wait for a element to be found in the current tab before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_jQuerify || Inject jQuery library into current session || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/07/06)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
==== WinHTTP UDF ====&lt;br /&gt;
Make sure that you are running at least version 1.6.4.2 (currently unreleased, but can be obtained [https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3 here]).&lt;br /&gt;
==== Chrome ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugChrome1&amp;quot;&amp;gt;Chrome does not start and the DOS window for chromedriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugChrome1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Chrome and does not display the DOS window for chromedriver.&amp;lt;br&amp;gt;When you manually run the chromedriver in a DOS window you get message &amp;quot;[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied.&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the chrome driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\chromedriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugFirefox1&amp;quot;&amp;gt;Firefox does not start and the DOS window for geckodriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugFirefox1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Firefox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the gecko driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\geckodriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/10/11)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ1&amp;quot;&amp;gt;1. How to connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ2&amp;quot;&amp;gt;2. How to hide the webdriver console&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I hide the webdriver console?&amp;lt;br&amp;gt;A: The console can be completely hidden from the start by adding the following line near the beginning of your script:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error&amp;lt;/syntaxhighlight&amp;gt;You can also control the visibility of the console with the function _WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ3&amp;quot;&amp;gt;3. How to utilize an existing user profile&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Can I use an existing user profile instead of the default behavior of using a new one?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration, with each browser using a different method to implement. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;:[&amp;quot;--user-data-dir=C:\\Users\\&#039; &amp;amp; @UserName &amp;amp; &#039;\\AppData\\Local\\Google\\Chrome\\User Data\\&amp;quot;, &amp;quot;--profile-directory=Default&amp;quot;]}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;:{&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;moz:firefoxOptions&amp;quot;: {&amp;quot;args&amp;quot;: [&amp;quot;-profile&amp;quot;, &#039; &amp;amp; GetDefaultFFProfile() &amp;amp; &#039;],&amp;quot;log&amp;quot;: {&amp;quot;level&amp;quot;: &amp;quot;trace&amp;quot;}}}}}&#039;&lt;br /&gt;
&lt;br /&gt;
Func GetDefaultFFProfile()&lt;br /&gt;
	Local $sDefault, $sProfilePath = &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
	Local $sProfilesPath = StringReplace(@AppDataDir, &#039;\&#039;, &#039;/&#039;) &amp;amp; &amp;quot;/Mozilla/Firefox/&amp;quot;&lt;br /&gt;
	Local $sFilename = $sProfilesPath &amp;amp; &amp;quot;profiles.ini&amp;quot;&lt;br /&gt;
	Local $aSections = IniReadSectionNames ($sFilename)&lt;br /&gt;
&lt;br /&gt;
	If Not @error Then&lt;br /&gt;
		For $i = 1 To $aSections[0]&lt;br /&gt;
			$sDefault = IniRead($sFilename, $aSections[$i], &#039;Default&#039;, &#039;0&#039;)&lt;br /&gt;
&lt;br /&gt;
			If $sDefault = &#039;1&#039; Then&lt;br /&gt;
				$sProfilePath = $sProfilesPath &amp;amp; IniRead($sFilename, $aSections[$i], &amp;quot;Path&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
				ExitLoop&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	Return $sProfilePath&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will also likely need to specify the marionette port:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&#039;DriverParams&#039;, &#039;--marionette-port 2828&#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ4&amp;quot;&amp;gt;4. How to specify location of browser executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch a browser installed in a non-standard location?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\chrome.exe&amp;quot; }}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;desiredCapabilities&amp;quot;:{&amp;quot;javascriptEnabled&amp;quot;:true,&amp;quot;nativeEvents&amp;quot;:true,&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;moz:firefoxOptions&amp;quot;:{&amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\firefox.exe&amp;quot;}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;Alternate Firefox method:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_Option(&#039;DriverParams&#039;, &#039;--binary &amp;quot;C:\Program Files\Mozilla Firefox\firefox.exe&amp;quot; --log trace &#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ5&amp;quot;&amp;gt;5. How to maximize the browser window&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ5&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to maximize the browser window?&amp;lt;br&amp;gt;A: Simply call the following function:&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Window($sSession, &amp;quot;Maximize&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Make sure to call _WD_Window after the session has been created with _WD_CreateSession.&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ6&amp;quot;&amp;gt;6. How to specify location of WebDriver executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ6&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch the WebDriver executable from a specific location?&amp;lt;br&amp;gt;A: This is controlled by function &amp;quot;_WD_Option&amp;quot;. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\local\WebDriver\WebDriver.exe&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ7&amp;quot;&amp;gt;7. How to retrieve the values of a drop-down list&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ7&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How to retrieve the values of a drop-down list (&amp;lt;Select&amp;gt; tag)?&amp;lt;br&amp;gt;A1: Here&#039;s a simple way to do it:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$sText = _WD_ElementAction($sSession, $sElement, &#039;property&#039;, &#039;innerText&#039;)&lt;br /&gt;
$aOptions = StringSplit ( $sText, @LF,  $STR_NOCOUNT)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;xxx&#039; is the name of the drop-down list.&lt;br /&gt;
&amp;lt;br&amp;gt;A2: This can now be accomplished using the function _WD_ElementSelectAction:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$aOptions = _WD_ElementSelectAction ($sSession, $sElement, &#039;options&#039;)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ8&amp;quot;&amp;gt;8. How to run the browser in headless mode&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ8&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How do I run the browser in &amp;quot;headless&amp;quot; mode?&amp;lt;br&amp;gt;A: This is controlled by the Capabilities string that is passed to _WD_CreateSession. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;: [&amp;quot;--headless&amp;quot;, &amp;quot;--allow-running-insecure-content&amp;quot;] }}}}&#039; &amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
The following tools will help you to automate your browser:&lt;br /&gt;
* [https://autonomiq.io/deviq-chropath.html ChroPath]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Makes finding an element by XPath, ID or CSS incredibly easy (Chrome, Firefox, Opera)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/01)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* AutoIt WebDriver threads:&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019 Example Scripts]&#039;&#039;&#039; forum - WebDriver UDF (W3C compliant version)&lt;br /&gt;
** Danp2&#039;s closed thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/ General Help and Support]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (this is part I)&lt;br /&gt;
** Danp2&#039;s active thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/ General Help and Support II]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (II) &lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201283-im-creating-a-webdriver-tutorial General Help and Support]&#039;&#039;&#039; forum - Discussion about this Wiki Page&lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/ Example Scripts]&#039;&#039;&#039; forum - WebDriver example scripts collection&lt;br /&gt;
&lt;br /&gt;
* WebDriver Exe documentation:&lt;br /&gt;
** [https://sites.google.com/a/chromium.org/chromedriver/ Chrome]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver Edge]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium Edge Chromium]&lt;br /&gt;
** [https://firefox-source-docs.mozilla.org/testing/geckodriver/ Firefox]&lt;br /&gt;
** [https://selenium.dev/documentation/en/webdriver/ Opera]&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14477</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14477"/>
		<updated>2021-01-27T21:02:39Z</updated>

		<summary type="html">&lt;p&gt;Danp2: Fix link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/10/11)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF (AutoIt)] by Ward and Jos&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF (AutoIt)] by trancexx or [https://github.com/dragana-r/autoit-winhttp autoit-winhttp (GitHub)]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF (GitHub)] by Danp2&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 86.0.4240.22 / &amp;lt;br&amp;gt; 2020.09.03 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 87.0.666.0 / &amp;lt;br&amp;gt; 2020.10.09 || &lt;br /&gt;
|-&lt;br /&gt;
| Firefox || [https://github.com/mozilla/geckodriver/releases GitHub] || 0.27 / &amp;lt;br&amp;gt; 2020.07.29 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases/latest GitHub] || 85.0.4183.102 / &amp;lt;br&amp;gt; 2020.09.15 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status Firefox]&lt;br /&gt;
* [https://github.com/operasoftware/operachromiumdriver Opera]: &amp;quot;&#039;&#039;OperaChromiumDriver is a WebDriver implementation derived from ChromeDriver and adapted by Opera&#039;&#039;&amp;quot;. That&#039;s why I think it has at least the same limitations as ChromeDriver.&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
=== Used Terms ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/08)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
	 &lt;br /&gt;
You will find the following terms when using WebDriver. We try to shed some light onto this subject here:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Marionette&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette consists of two parts: a server which takes requests and executes them in Gecko (the Marionette server ships with Firefox), and a client (the Marionette client ships with the GeckoDriver exe). The client sends commands to the server and the server executes the command inside the browser.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://firefox-source-docs.mozilla.org/testing/marionette/Intro.html visit this site].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ShadowRoot&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The ShadowRoot interface of the Shadow DOM API is the root node of a DOM subtree that is rendered separately from a document&#039;s main DOM tree.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://dom.spec.whatwg.org/#interface-shadowroot visit this site].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/09/27)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To automate your browser the following installation steps are needed:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory (with WD_Demo.au3):&lt;br /&gt;
** chromedriver.exe (Chrome)&lt;br /&gt;
** geckodriver.exe (Firefox)&lt;br /&gt;
** msedgedriver.exe (Edge - Chromium) or MicrosoftWebDriver.exe (Edge - EdgeHTML)&lt;br /&gt;
* Run WD_Demo.au3 and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\ ...&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;, ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function reference ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/11/16 - based on version 0.3.1.0)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WD_CORE ===&lt;br /&gt;
The WD_Core.au3 file holds functions to implement the Webdriver W3C document.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Action || Perform various interactions with the web driver session || Use one of the following values for parameter $sCommand:&lt;br /&gt;
 &#039;&#039;actions&#039;&#039;,&lt;br /&gt;
 &#039;&#039;back&#039;&#039;,&lt;br /&gt;
 &#039;&#039;forward&#039;&#039;,&lt;br /&gt;
 &#039;&#039;refresh&#039;&#039;,&lt;br /&gt;
 &#039;&#039;title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;url&#039;&#039;.&lt;br /&gt;
For command &#039;&#039;actions&#039;&#039;: Pass the actions to be set using parameter $sOption. If $sOption is empty then the set actions will be removed.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Alert || Respond to user prompt || Use one of the following actions to respond to the user prompt:&lt;br /&gt;
 &#039;&#039;accept&#039;&#039;,&lt;br /&gt;
 &#039;&#039;dismiss&#039;&#039;,&lt;br /&gt;
 &#039;&#039;gettext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;sendtext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;status&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Cookies || Gets, sets, or deletes the session&#039;s cookies || Use one of the following commands: &lt;br /&gt;
 &#039;&#039;get&#039;&#039; (Gets a single cookie)&lt;br /&gt;
 &#039;&#039;getall&#039;&#039; (Gets all cookies)&lt;br /&gt;
 &#039;&#039;add&#039;&#039; (Sets a single cookie)&lt;br /&gt;
 &#039;&#039;delete&#039;&#039; (Deletes a single cookie)&lt;br /&gt;
|-&lt;br /&gt;
| _WD_CreateSession|| Request new session from web driver || Define the capabilities of the browser with this function&lt;br /&gt;
|-&lt;br /&gt;
| _WD_DeleteSession || Delete existing session || Closes the session created by _WD_CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementAction || Perform action on designated element || Use one of the following actions:&lt;br /&gt;
 &#039;&#039;Active&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Attribute&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Clear&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Click&#039;&#039;,&lt;br /&gt;
 &#039;&#039;CSS&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Displayed&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Enabled&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Name&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Property&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Rect&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Screenshot&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Selected&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Text&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Value&#039;&#039;. &lt;br /&gt;
&#039;&#039;Clear&#039;&#039;, &#039;&#039;Click&#039;&#039; and &#039;&#039;Value&#039;&#039; use POST to modify or process the element. All other actions use GET to retrieve data from the element&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteScript || Execute Javascipt commands || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FindElement|| Find element(s) by designated strategy || You can specify whether the function should only return the first find or all of them&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetSource || Get page source || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Navigate || Navigate to the designated URL || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Option || Sets and get options for the web driver UDF || The following options can be used:&lt;br /&gt;
 &#039;&#039;BaseURL&#039;&#039; (IP address used for web driver communication),&lt;br /&gt;
 &#039;&#039;BinaryFormat&#039;&#039; (format used to store binary data),&lt;br /&gt;
 &#039;&#039;Console&#039;&#039; (define destination for console output),&lt;br /&gt;
 &#039;&#039;Driver&#039;&#039; (set the full path name to web driver executable),&lt;br /&gt;
 &#039;&#039;DriverParams&#039;&#039; (parameters to pass to web driver executable),&lt;br /&gt;
 &#039;&#039;Port&#039;&#039; (port used for web driver communication).&lt;br /&gt;
If no value is passed to be set the current value is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Shutdown || Kill the web driver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Startup || Launch the designated web driver console app || The PID for the WebDriver console is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Status || Get current web driver state || Returns a raw JSON response from the web driver&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Timeouts || Set or retrieve the session timeout parameters || Specify the type and value of the timeout like this: &#039;{&amp;quot;type&amp;quot;:value}&#039;. Example: &#039;{&amp;quot;pageLoad&amp;quot;:2000}&#039;&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Window || Perform interactions related to the current window || One of the following actions:&lt;br /&gt;
 &#039;&#039;close&#039;&#039; (close current tab),&lt;br /&gt;
 &#039;&#039;frame&#039;&#039; (switch to frame),&lt;br /&gt;
 &#039;&#039;fullscreen&#039;&#039; (set window to fullscreen),&lt;br /&gt;
 &#039;&#039;handles&#039;&#039; (get all window handles),&lt;br /&gt;
 &#039;&#039;maximize&#039;&#039; (maximize window),&lt;br /&gt;
 &#039;&#039;minimize&#039;&#039; (minimize window), &lt;br /&gt;
 &#039;&#039;parent&#039;&#039; (switch to parent frame),&lt;br /&gt;
 &#039;&#039;rect&#039;&#039; (get or set the window&#039;s size &amp;amp; position),&lt;br /&gt;
 &#039;&#039;screenshot&#039;&#039; (take screenshot of window),&lt;br /&gt;
 &#039;&#039;switch&#039;&#039; (switch to designated tab),&lt;br /&gt;
 &#039;&#039;window&#039;&#039; (get current tab&#039;s window handle).&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== WD_HELPER ===&lt;br /&gt;
The WD_Helper.au3 file holds functions to help you automate a web site.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Attach || Attach to existing browser tab || Use one of the following search modes:&lt;br /&gt;
 &#039;&#039;HTML&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;URL&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ConsoleVisible || Control visibility of the webdriver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_DownloadFile || Download file and save to disk || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementActionEx || Perform advanced action on desginated element ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementOptionSelect || Find and click on an option from a Select element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementSelectAction || Perform action on designated Select element || Use one of the following commands:&lt;br /&gt;
 &#039;&#039;options&#039;&#039;,&lt;br /&gt;
 &#039;&#039;value&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteCdpCommand || ChromeDriver specific function to execute &amp;quot;Chrome DevTools Protocol&amp;quot; (CDP) commands ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameEnter || Will enter the specified frame for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameLeave || Will leave the current frame, to its parent, not necessarily the Top, for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementById || Locate element by id ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementByName || Locate element by name ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementFromPoint || Retrieves reference to element descriped by x/y coordinate || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetFrameCount || Returns how many frames/iframes are in your current window/frame || It will not traverse to nested frames&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetMouseElement || Retrieves reference to element below mouse pointer || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetShadowRoot || Retrieves the shadow root of an element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetTable || Return all elements of a table ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElement || Will highlight the specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElements || Will highlight multiple elements passed as an array || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsLatestRelease || Compares local UDF version to latest release on Github || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsWindowTop || Returns a boolean of the session being at the top level, or in a frame(s) || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LastHTTPResult || Return the result of the last WinHTTP request || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LinkClickByText || Simulate a mouse click on a link with text matching the provided string || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LoadWait || Wait for a browser page load to complete before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_NewTab || Create new tab using Javascript ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Screenshot || Will return a screenshot of the browser window or a specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SelectFiles || Select files for uploading to a website || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetElementValue || Set value of designated element ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetTimeouts || User friendly function to set webdriver session timeouts ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_UpdateDriver || Replace web driver with newer version, if available || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_WaitElement || Wait for a element to be found in the current tab before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_jQuerify || Inject jQuery library into current session || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/07/06)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
==== WinHTTP UDF ====&lt;br /&gt;
Make sure that you are running at least version 1.6.4.2 (currently unreleased, but can be obtained [https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3 here]).&lt;br /&gt;
==== Chrome ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugChrome1&amp;quot;&amp;gt;Chrome does not start and the DOS window for chromedriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugChrome1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Chrome and does not display the DOS window for chromedriver.&amp;lt;br&amp;gt;When you manually run the chromedriver in a DOS window you get message &amp;quot;[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied.&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the chrome driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\chromedriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugFirefox1&amp;quot;&amp;gt;Firefox does not start and the DOS window for geckodriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugFirefox1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Firefox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the gecko driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\geckodriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/10/11)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ1&amp;quot;&amp;gt;1. How to connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ2&amp;quot;&amp;gt;2. How to hide the webdriver console&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I hide the webdriver console?&amp;lt;br&amp;gt;A: The console can be completely hidden from the start by adding the following line near the beginning of your script:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error&amp;lt;/syntaxhighlight&amp;gt;You can also control the visibility of the console with the function _WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ3&amp;quot;&amp;gt;3. How to utilize an existing user profile&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Can I use an existing user profile instead of the default behavior of using a new one?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration, with each browser using a different method to implement. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;:[&amp;quot;--user-data-dir=C:\\Users\\&#039; &amp;amp; @UserName &amp;amp; &#039;\\AppData\\Local\\Google\\Chrome\\User Data\\&amp;quot;, &amp;quot;--profile-directory=Default&amp;quot;]}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;:{&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;moz:firefoxOptions&amp;quot;: {&amp;quot;args&amp;quot;: [&amp;quot;-profile&amp;quot;, &#039; &amp;amp; GetDefaultFFProfile() &amp;amp; &#039;],&amp;quot;log&amp;quot;: {&amp;quot;level&amp;quot;: &amp;quot;trace&amp;quot;}}}}}&#039;&lt;br /&gt;
&lt;br /&gt;
Func GetDefaultFFProfile()&lt;br /&gt;
	Local $sDefault, $sProfilePath = &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
	Local $sProfilesPath = StringReplace(@AppDataDir, &#039;\&#039;, &#039;/&#039;) &amp;amp; &amp;quot;/Mozilla/Firefox/&amp;quot;&lt;br /&gt;
	Local $sFilename = $sProfilesPath &amp;amp; &amp;quot;profiles.ini&amp;quot;&lt;br /&gt;
	Local $aSections = IniReadSectionNames ($sFilename)&lt;br /&gt;
&lt;br /&gt;
	If Not @error Then&lt;br /&gt;
		For $i = 1 To $aSections[0]&lt;br /&gt;
			$sDefault = IniRead($sFilename, $aSections[$i], &#039;Default&#039;, &#039;0&#039;)&lt;br /&gt;
&lt;br /&gt;
			If $sDefault = &#039;1&#039; Then&lt;br /&gt;
				$sProfilePath = $sProfilesPath &amp;amp; IniRead($sFilename, $aSections[$i], &amp;quot;Path&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
				ExitLoop&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	Return $sProfilePath&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will also likely need to specify the marionette port:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&#039;DriverParams&#039;, &#039;--marionette-port 2828&#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ4&amp;quot;&amp;gt;4. How to specify location of browser executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch a browser installed in a non-standard location?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\chrome.exe&amp;quot; }}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;desiredCapabilities&amp;quot;:{&amp;quot;javascriptEnabled&amp;quot;:true,&amp;quot;nativeEvents&amp;quot;:true,&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;moz:firefoxOptions&amp;quot;:{&amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\firefox.exe&amp;quot;}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;Alternate Firefox method:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_Option(&#039;DriverParams&#039;, &#039;--binary &amp;quot;C:\Program Files\Mozilla Firefox\firefox.exe&amp;quot; --log trace &#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ5&amp;quot;&amp;gt;5. How to maximize the browser window&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ5&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to maximize the browser window?&amp;lt;br&amp;gt;A: Simply call the following function:&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Window($sSession, &amp;quot;Maximize&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Make sure to call _WD_Window after the session has been created with _WD_CreateSession.&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ6&amp;quot;&amp;gt;6. How to specify location of WebDriver executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ6&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch the WebDriver executable from a specific location?&amp;lt;br&amp;gt;A: This is controlled by function &amp;quot;_WD_Option&amp;quot;. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\local\WebDriver\WebDriver.exe&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ7&amp;quot;&amp;gt;7. How to retrieve the values of a drop-down list&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ7&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How to retrieve the values of a drop-down list (&amp;lt;Select&amp;gt; tag)?&amp;lt;br&amp;gt;A1: Here&#039;s a simple way to do it:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$sText = _WD_ElementAction($sSession, $sElement, &#039;property&#039;, &#039;innerText&#039;)&lt;br /&gt;
$aOptions = StringSplit ( $sText, @LF,  $STR_NOCOUNT)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;xxx&#039; is the name of the drop-down list.&lt;br /&gt;
&amp;lt;br&amp;gt;A2: This can now be accomplished using the function _WD_ElementSelectAction:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$aOptions = _WD_ElementSelectAction ($sSession, $sElement, &#039;options&#039;)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ8&amp;quot;&amp;gt;8. How to run the browser in headless mode&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ8&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How do I run the browser in &amp;quot;headless&amp;quot; mode?&amp;lt;br&amp;gt;A: This is controlled by the Capabilities string that is passed to _WD_CreateSession. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;: [&amp;quot;--headless&amp;quot;, &amp;quot;--allow-running-insecure-content&amp;quot;] }}}}&#039; &amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
The following tools will help you to automate your browser:&lt;br /&gt;
* [https://autonomiq.io/deviq-chropath.html/ ChroPath]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Makes finding an element by XPath, ID or CSS incredibly easy (Chrome, Firefox, Opera)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/01)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* AutoIt WebDriver threads:&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019 Example Scripts]&#039;&#039;&#039; forum - WebDriver UDF (W3C compliant version)&lt;br /&gt;
** Danp2&#039;s closed thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/ General Help and Support]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (this is part I)&lt;br /&gt;
** Danp2&#039;s active thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/ General Help and Support II]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (II) &lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201283-im-creating-a-webdriver-tutorial General Help and Support]&#039;&#039;&#039; forum - Discussion about this Wiki Page&lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/ Example Scripts]&#039;&#039;&#039; forum - WebDriver example scripts collection&lt;br /&gt;
&lt;br /&gt;
* WebDriver Exe documentation:&lt;br /&gt;
** [https://sites.google.com/a/chromium.org/chromedriver/ Chrome]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver Edge]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium Edge Chromium]&lt;br /&gt;
** [https://firefox-source-docs.mozilla.org/testing/geckodriver/ Firefox]&lt;br /&gt;
** [https://selenium.dev/documentation/en/webdriver/ Opera]&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14476</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14476"/>
		<updated>2021-01-27T21:01:27Z</updated>

		<summary type="html">&lt;p&gt;Danp2: /* Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/10/11)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF (AutoIt)] by Ward and Jos&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF (AutoIt)] by trancexx or [https://github.com/dragana-r/autoit-winhttp autoit-winhttp (GitHub)]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF (GitHub)] by Danp2&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 86.0.4240.22 / &amp;lt;br&amp;gt; 2020.09.03 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 87.0.666.0 / &amp;lt;br&amp;gt; 2020.10.09 || &lt;br /&gt;
|-&lt;br /&gt;
| Firefox || [https://github.com/mozilla/geckodriver/releases GitHub] || 0.27 / &amp;lt;br&amp;gt; 2020.07.29 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases/latest GitHub] || 85.0.4183.102 / &amp;lt;br&amp;gt; 2020.09.15 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status Firefox]&lt;br /&gt;
* [https://github.com/operasoftware/operachromiumdriver Opera]: &amp;quot;&#039;&#039;OperaChromiumDriver is a WebDriver implementation derived from ChromeDriver and adapted by Opera&#039;&#039;&amp;quot;. That&#039;s why I think it has at least the same limitations as ChromeDriver.&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
=== Used Terms ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/08)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
	 &lt;br /&gt;
You will find the following terms when using WebDriver. We try to shed some light onto this subject here:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Marionette&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette consists of two parts: a server which takes requests and executes them in Gecko (the Marionette server ships with Firefox), and a client (the Marionette client ships with the GeckoDriver exe). The client sends commands to the server and the server executes the command inside the browser.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://firefox-source-docs.mozilla.org/testing/marionette/Intro.html visit this site].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ShadowRoot&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The ShadowRoot interface of the Shadow DOM API is the root node of a DOM subtree that is rendered separately from a document&#039;s main DOM tree.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://dom.spec.whatwg.org/#interface-shadowroot visit this site].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/09/27)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To automate your browser the following installation steps are needed:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory (with WD_Demo.au3):&lt;br /&gt;
** chromedriver.exe (Chrome)&lt;br /&gt;
** geckodriver.exe (Firefox)&lt;br /&gt;
** msedgedriver.exe (Edge - Chromium) or MicrosoftWebDriver.exe (Edge - EdgeHTML)&lt;br /&gt;
* Run WD_Demo.au3 and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\ ...&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;, ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function reference ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/11/16 - based on version 0.3.1.0)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WD_CORE ===&lt;br /&gt;
The WD_Core.au3 file holds functions to implement the Webdriver W3C document.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Action || Perform various interactions with the web driver session || Use one of the following values for parameter $sCommand:&lt;br /&gt;
 &#039;&#039;actions&#039;&#039;,&lt;br /&gt;
 &#039;&#039;back&#039;&#039;,&lt;br /&gt;
 &#039;&#039;forward&#039;&#039;,&lt;br /&gt;
 &#039;&#039;refresh&#039;&#039;,&lt;br /&gt;
 &#039;&#039;title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;url&#039;&#039;.&lt;br /&gt;
For command &#039;&#039;actions&#039;&#039;: Pass the actions to be set using parameter $sOption. If $sOption is empty then the set actions will be removed.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Alert || Respond to user prompt || Use one of the following actions to respond to the user prompt:&lt;br /&gt;
 &#039;&#039;accept&#039;&#039;,&lt;br /&gt;
 &#039;&#039;dismiss&#039;&#039;,&lt;br /&gt;
 &#039;&#039;gettext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;sendtext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;status&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Cookies || Gets, sets, or deletes the session&#039;s cookies || Use one of the following commands: &lt;br /&gt;
 &#039;&#039;get&#039;&#039; (Gets a single cookie)&lt;br /&gt;
 &#039;&#039;getall&#039;&#039; (Gets all cookies)&lt;br /&gt;
 &#039;&#039;add&#039;&#039; (Sets a single cookie)&lt;br /&gt;
 &#039;&#039;delete&#039;&#039; (Deletes a single cookie)&lt;br /&gt;
|-&lt;br /&gt;
| _WD_CreateSession|| Request new session from web driver || Define the capabilities of the browser with this function&lt;br /&gt;
|-&lt;br /&gt;
| _WD_DeleteSession || Delete existing session || Closes the session created by _WD_CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementAction || Perform action on designated element || Use one of the following actions:&lt;br /&gt;
 &#039;&#039;Active&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Attribute&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Clear&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Click&#039;&#039;,&lt;br /&gt;
 &#039;&#039;CSS&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Displayed&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Enabled&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Name&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Property&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Rect&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Screenshot&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Selected&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Text&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Value&#039;&#039;. &lt;br /&gt;
&#039;&#039;Clear&#039;&#039;, &#039;&#039;Click&#039;&#039; and &#039;&#039;Value&#039;&#039; use POST to modify or process the element. All other actions use GET to retrieve data from the element&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteScript || Execute Javascipt commands || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FindElement|| Find element(s) by designated strategy || You can specify whether the function should only return the first find or all of them&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetSource || Get page source || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Navigate || Navigate to the designated URL || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Option || Sets and get options for the web driver UDF || The following options can be used:&lt;br /&gt;
 &#039;&#039;BaseURL&#039;&#039; (IP address used for web driver communication),&lt;br /&gt;
 &#039;&#039;BinaryFormat&#039;&#039; (format used to store binary data),&lt;br /&gt;
 &#039;&#039;Console&#039;&#039; (define destination for console output),&lt;br /&gt;
 &#039;&#039;Driver&#039;&#039; (set the full path name to web driver executable),&lt;br /&gt;
 &#039;&#039;DriverParams&#039;&#039; (parameters to pass to web driver executable),&lt;br /&gt;
 &#039;&#039;Port&#039;&#039; (port used for web driver communication).&lt;br /&gt;
If no value is passed to be set the current value is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Shutdown || Kill the web driver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Startup || Launch the designated web driver console app || The PID for the WebDriver console is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Status || Get current web driver state || Returns a raw JSON response from the web driver&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Timeouts || Set or retrieve the session timeout parameters || Specify the type and value of the timeout like this: &#039;{&amp;quot;type&amp;quot;:value}&#039;. Example: &#039;{&amp;quot;pageLoad&amp;quot;:2000}&#039;&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Window || Perform interactions related to the current window || One of the following actions:&lt;br /&gt;
 &#039;&#039;close&#039;&#039; (close current tab),&lt;br /&gt;
 &#039;&#039;frame&#039;&#039; (switch to frame),&lt;br /&gt;
 &#039;&#039;fullscreen&#039;&#039; (set window to fullscreen),&lt;br /&gt;
 &#039;&#039;handles&#039;&#039; (get all window handles),&lt;br /&gt;
 &#039;&#039;maximize&#039;&#039; (maximize window),&lt;br /&gt;
 &#039;&#039;minimize&#039;&#039; (minimize window), &lt;br /&gt;
 &#039;&#039;parent&#039;&#039; (switch to parent frame),&lt;br /&gt;
 &#039;&#039;rect&#039;&#039; (get or set the window&#039;s size &amp;amp; position),&lt;br /&gt;
 &#039;&#039;screenshot&#039;&#039; (take screenshot of window),&lt;br /&gt;
 &#039;&#039;switch&#039;&#039; (switch to designated tab),&lt;br /&gt;
 &#039;&#039;window&#039;&#039; (get current tab&#039;s window handle).&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== WD_HELPER ===&lt;br /&gt;
The WD_Helper.au3 file holds functions to help you automate a web site.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Attach || Attach to existing browser tab || Use one of the following search modes:&lt;br /&gt;
 &#039;&#039;HTML&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;URL&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ConsoleVisible || Control visibility of the webdriver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_DownloadFile || Download file and save to disk || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementActionEx || Perform advanced action on desginated element ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementOptionSelect || Find and click on an option from a Select element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementSelectAction || Perform action on designated Select element || Use one of the following commands:&lt;br /&gt;
 &#039;&#039;options&#039;&#039;,&lt;br /&gt;
 &#039;&#039;value&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteCdpCommand || ChromeDriver specific function to execute &amp;quot;Chrome DevTools Protocol&amp;quot; (CDP) commands ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameEnter || Will enter the specified frame for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameLeave || Will leave the current frame, to its parent, not necessarily the Top, for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementById || Locate element by id ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementByName || Locate element by name ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementFromPoint || Retrieves reference to element descriped by x/y coordinate || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetFrameCount || Returns how many frames/iframes are in your current window/frame || It will not traverse to nested frames&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetMouseElement || Retrieves reference to element below mouse pointer || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetShadowRoot || Retrieves the shadow root of an element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetTable || Return all elements of a table ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElement || Will highlight the specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElements || Will highlight multiple elements passed as an array || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsLatestRelease || Compares local UDF version to latest release on Github || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsWindowTop || Returns a boolean of the session being at the top level, or in a frame(s) || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LastHTTPResult || Return the result of the last WinHTTP request || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LinkClickByText || Simulate a mouse click on a link with text matching the provided string || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LoadWait || Wait for a browser page load to complete before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_NewTab || Create new tab using Javascript ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Screenshot || Will return a screenshot of the browser window or a specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SelectFiles || Select files for uploading to a website || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetElementValue || Set value of designated element ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetTimeouts || User friendly function to set webdriver session timeouts ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_UpdateDriver || Replace web driver with newer version, if available || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_WaitElement || Wait for a element to be found in the current tab before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_jQuerify || Inject jQuery library into current session || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/07/06)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
==== WinHTTP UDF ====&lt;br /&gt;
Make sure that you are running at least version 1.6.4.2 (currently unreleased, but can be obtained [https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3 here]).&lt;br /&gt;
==== Chrome ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugChrome1&amp;quot;&amp;gt;Chrome does not start and the DOS window for chromedriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugChrome1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Chrome and does not display the DOS window for chromedriver.&amp;lt;br&amp;gt;When you manually run the chromedriver in a DOS window you get message &amp;quot;[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied.&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the chrome driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\chromedriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugFirefox1&amp;quot;&amp;gt;Firefox does not start and the DOS window for geckodriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugFirefox1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Firefox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the gecko driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\geckodriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/10/11)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ1&amp;quot;&amp;gt;1. How to connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ2&amp;quot;&amp;gt;2. How to hide the webdriver console&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I hide the webdriver console?&amp;lt;br&amp;gt;A: The console can be completely hidden from the start by adding the following line near the beginning of your script:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error&amp;lt;/syntaxhighlight&amp;gt;You can also control the visibility of the console with the function _WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ3&amp;quot;&amp;gt;3. How to utilize an existing user profile&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Can I use an existing user profile instead of the default behavior of using a new one?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration, with each browser using a different method to implement. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;:[&amp;quot;--user-data-dir=C:\\Users\\&#039; &amp;amp; @UserName &amp;amp; &#039;\\AppData\\Local\\Google\\Chrome\\User Data\\&amp;quot;, &amp;quot;--profile-directory=Default&amp;quot;]}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;:{&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;moz:firefoxOptions&amp;quot;: {&amp;quot;args&amp;quot;: [&amp;quot;-profile&amp;quot;, &#039; &amp;amp; GetDefaultFFProfile() &amp;amp; &#039;],&amp;quot;log&amp;quot;: {&amp;quot;level&amp;quot;: &amp;quot;trace&amp;quot;}}}}}&#039;&lt;br /&gt;
&lt;br /&gt;
Func GetDefaultFFProfile()&lt;br /&gt;
	Local $sDefault, $sProfilePath = &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
	Local $sProfilesPath = StringReplace(@AppDataDir, &#039;\&#039;, &#039;/&#039;) &amp;amp; &amp;quot;/Mozilla/Firefox/&amp;quot;&lt;br /&gt;
	Local $sFilename = $sProfilesPath &amp;amp; &amp;quot;profiles.ini&amp;quot;&lt;br /&gt;
	Local $aSections = IniReadSectionNames ($sFilename)&lt;br /&gt;
&lt;br /&gt;
	If Not @error Then&lt;br /&gt;
		For $i = 1 To $aSections[0]&lt;br /&gt;
			$sDefault = IniRead($sFilename, $aSections[$i], &#039;Default&#039;, &#039;0&#039;)&lt;br /&gt;
&lt;br /&gt;
			If $sDefault = &#039;1&#039; Then&lt;br /&gt;
				$sProfilePath = $sProfilesPath &amp;amp; IniRead($sFilename, $aSections[$i], &amp;quot;Path&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
				ExitLoop&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	Return $sProfilePath&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will also likely need to specify the marionette port:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&#039;DriverParams&#039;, &#039;--marionette-port 2828&#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ4&amp;quot;&amp;gt;4. How to specify location of browser executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch a browser installed in a non-standard location?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\chrome.exe&amp;quot; }}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;desiredCapabilities&amp;quot;:{&amp;quot;javascriptEnabled&amp;quot;:true,&amp;quot;nativeEvents&amp;quot;:true,&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;moz:firefoxOptions&amp;quot;:{&amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\firefox.exe&amp;quot;}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;Alternate Firefox method:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_Option(&#039;DriverParams&#039;, &#039;--binary &amp;quot;C:\Program Files\Mozilla Firefox\firefox.exe&amp;quot; --log trace &#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ5&amp;quot;&amp;gt;5. How to maximize the browser window&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ5&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to maximize the browser window?&amp;lt;br&amp;gt;A: Simply call the following function:&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Window($sSession, &amp;quot;Maximize&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Make sure to call _WD_Window after the session has been created with _WD_CreateSession.&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ6&amp;quot;&amp;gt;6. How to specify location of WebDriver executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ6&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch the WebDriver executable from a specific location?&amp;lt;br&amp;gt;A: This is controlled by function &amp;quot;_WD_Option&amp;quot;. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\local\WebDriver\WebDriver.exe&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ7&amp;quot;&amp;gt;7. How to retrieve the values of a drop-down list&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ7&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How to retrieve the values of a drop-down list (&amp;lt;Select&amp;gt; tag)?&amp;lt;br&amp;gt;A1: Here&#039;s a simple way to do it:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$sText = _WD_ElementAction($sSession, $sElement, &#039;property&#039;, &#039;innerText&#039;)&lt;br /&gt;
$aOptions = StringSplit ( $sText, @LF,  $STR_NOCOUNT)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;xxx&#039; is the name of the drop-down list.&lt;br /&gt;
&amp;lt;br&amp;gt;A2: This can now be accomplished using the function _WD_ElementSelectAction:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$aOptions = _WD_ElementSelectAction ($sSession, $sElement, &#039;options&#039;)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ8&amp;quot;&amp;gt;8. How to run the browser in headless mode&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ8&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How do I run the browser in &amp;quot;headless&amp;quot; mode?&amp;lt;br&amp;gt;A: This is controlled by the Capabilities string that is passed to _WD_CreateSession. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;: [&amp;quot;--headless&amp;quot;, &amp;quot;--allow-running-insecure-content&amp;quot;] }}}}&#039; &amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
The following tools will help you to automate your browser:&lt;br /&gt;
* [https://autonomiq.io/deviq-chropath.html]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Makes finding an element by XPath, ID or CSS incredibly easy (Chrome, Firefox, Opera)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/01)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* AutoIt WebDriver threads:&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019 Example Scripts]&#039;&#039;&#039; forum - WebDriver UDF (W3C compliant version)&lt;br /&gt;
** Danp2&#039;s closed thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/ General Help and Support]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (this is part I)&lt;br /&gt;
** Danp2&#039;s active thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/ General Help and Support II]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (II) &lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201283-im-creating-a-webdriver-tutorial General Help and Support]&#039;&#039;&#039; forum - Discussion about this Wiki Page&lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/ Example Scripts]&#039;&#039;&#039; forum - WebDriver example scripts collection&lt;br /&gt;
&lt;br /&gt;
* WebDriver Exe documentation:&lt;br /&gt;
** [https://sites.google.com/a/chromium.org/chromedriver/ Chrome]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver Edge]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium Edge Chromium]&lt;br /&gt;
** [https://firefox-source-docs.mozilla.org/testing/geckodriver/ Firefox]&lt;br /&gt;
** [https://selenium.dev/documentation/en/webdriver/ Opera]&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14473</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14473"/>
		<updated>2021-01-10T15:57:02Z</updated>

		<summary type="html">&lt;p&gt;Danp2: Update FAQ #3, Firefox example code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/10/11)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF (AutoIt)] by Ward and Jos&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF (AutoIt)] by trancexx or [https://github.com/dragana-r/autoit-winhttp autoit-winhttp (GitHub)]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF (GitHub)] by Danp2&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 86.0.4240.22 / &amp;lt;br&amp;gt; 2020.09.03 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 87.0.666.0 / &amp;lt;br&amp;gt; 2020.10.09 || &lt;br /&gt;
|-&lt;br /&gt;
| Firefox || [https://github.com/mozilla/geckodriver/releases GitHub] || 0.27 / &amp;lt;br&amp;gt; 2020.07.29 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases/latest GitHub] || 85.0.4183.102 / &amp;lt;br&amp;gt; 2020.09.15 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status Firefox]&lt;br /&gt;
* [https://github.com/operasoftware/operachromiumdriver Opera]: &amp;quot;&#039;&#039;OperaChromiumDriver is a WebDriver implementation derived from ChromeDriver and adapted by Opera&#039;&#039;&amp;quot;. That&#039;s why I think it has at least the same limitations as ChromeDriver.&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
=== Used Terms ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/08)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
	 &lt;br /&gt;
You will find the following terms when using WebDriver. We try to shed some light onto this subject here:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Marionette&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette consists of two parts: a server which takes requests and executes them in Gecko (the Marionette server ships with Firefox), and a client (the Marionette client ships with the GeckoDriver exe). The client sends commands to the server and the server executes the command inside the browser.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://firefox-source-docs.mozilla.org/testing/marionette/Intro.html visit this site].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ShadowRoot&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The ShadowRoot interface of the Shadow DOM API is the root node of a DOM subtree that is rendered separately from a document&#039;s main DOM tree.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://dom.spec.whatwg.org/#interface-shadowroot visit this site].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/09/27)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To automate your browser the following installation steps are needed:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory (with WD_Demo.au3):&lt;br /&gt;
** chromedriver.exe (Chrome)&lt;br /&gt;
** geckodriver.exe (Firefox)&lt;br /&gt;
** msedgedriver.exe (Edge - Chromium) or MicrosoftWebDriver.exe (Edge - EdgeHTML)&lt;br /&gt;
* Run WD_Demo.au3 and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\ ...&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;, ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function reference ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/11/16 - based on version 0.3.1.0)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WD_CORE ===&lt;br /&gt;
The WD_Core.au3 file holds functions to implement the Webdriver W3C document.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Action || Perform various interactions with the web driver session || Use one of the following values for parameter $sCommand:&lt;br /&gt;
 &#039;&#039;actions&#039;&#039;,&lt;br /&gt;
 &#039;&#039;back&#039;&#039;,&lt;br /&gt;
 &#039;&#039;forward&#039;&#039;,&lt;br /&gt;
 &#039;&#039;refresh&#039;&#039;,&lt;br /&gt;
 &#039;&#039;title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;url&#039;&#039;.&lt;br /&gt;
For command &#039;&#039;actions&#039;&#039;: Pass the actions to be set using parameter $sOption. If $sOption is empty then the set actions will be removed.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Alert || Respond to user prompt || Use one of the following actions to respond to the user prompt:&lt;br /&gt;
 &#039;&#039;accept&#039;&#039;,&lt;br /&gt;
 &#039;&#039;dismiss&#039;&#039;,&lt;br /&gt;
 &#039;&#039;gettext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;sendtext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;status&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Cookies || Gets, sets, or deletes the session&#039;s cookies || Use one of the following commands: &lt;br /&gt;
 &#039;&#039;get&#039;&#039; (Gets a single cookie)&lt;br /&gt;
 &#039;&#039;getall&#039;&#039; (Gets all cookies)&lt;br /&gt;
 &#039;&#039;add&#039;&#039; (Sets a single cookie)&lt;br /&gt;
 &#039;&#039;delete&#039;&#039; (Deletes a single cookie)&lt;br /&gt;
|-&lt;br /&gt;
| _WD_CreateSession|| Request new session from web driver || Define the capabilities of the browser with this function&lt;br /&gt;
|-&lt;br /&gt;
| _WD_DeleteSession || Delete existing session || Closes the session created by _WD_CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementAction || Perform action on designated element || Use one of the following actions:&lt;br /&gt;
 &#039;&#039;Active&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Attribute&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Clear&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Click&#039;&#039;,&lt;br /&gt;
 &#039;&#039;CSS&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Displayed&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Enabled&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Name&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Property&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Rect&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Screenshot&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Selected&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Text&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Value&#039;&#039;. &lt;br /&gt;
&#039;&#039;Clear&#039;&#039;, &#039;&#039;Click&#039;&#039; and &#039;&#039;Value&#039;&#039; use POST to modify or process the element. All other actions use GET to retrieve data from the element&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteScript || Execute Javascipt commands || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FindElement|| Find element(s) by designated strategy || You can specify whether the function should only return the first find or all of them&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetSource || Get page source || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Navigate || Navigate to the designated URL || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Option || Sets and get options for the web driver UDF || The following options can be used:&lt;br /&gt;
 &#039;&#039;BaseURL&#039;&#039; (IP address used for web driver communication),&lt;br /&gt;
 &#039;&#039;BinaryFormat&#039;&#039; (format used to store binary data),&lt;br /&gt;
 &#039;&#039;Console&#039;&#039; (define destination for console output),&lt;br /&gt;
 &#039;&#039;Driver&#039;&#039; (set the full path name to web driver executable),&lt;br /&gt;
 &#039;&#039;DriverParams&#039;&#039; (parameters to pass to web driver executable),&lt;br /&gt;
 &#039;&#039;Port&#039;&#039; (port used for web driver communication).&lt;br /&gt;
If no value is passed to be set the current value is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Shutdown || Kill the web driver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Startup || Launch the designated web driver console app || The PID for the WebDriver console is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Status || Get current web driver state || Returns a raw JSON response from the web driver&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Timeouts || Set or retrieve the session timeout parameters || Specify the type and value of the timeout like this: &#039;{&amp;quot;type&amp;quot;:value}&#039;. Example: &#039;{&amp;quot;pageLoad&amp;quot;:2000}&#039;&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Window || Perform interactions related to the current window || One of the following actions:&lt;br /&gt;
 &#039;&#039;close&#039;&#039; (close current tab),&lt;br /&gt;
 &#039;&#039;frame&#039;&#039; (switch to frame),&lt;br /&gt;
 &#039;&#039;fullscreen&#039;&#039; (set window to fullscreen),&lt;br /&gt;
 &#039;&#039;handles&#039;&#039; (get all window handles),&lt;br /&gt;
 &#039;&#039;maximize&#039;&#039; (maximize window),&lt;br /&gt;
 &#039;&#039;minimize&#039;&#039; (minimize window), &lt;br /&gt;
 &#039;&#039;parent&#039;&#039; (switch to parent frame),&lt;br /&gt;
 &#039;&#039;rect&#039;&#039; (get or set the window&#039;s size &amp;amp; position),&lt;br /&gt;
 &#039;&#039;screenshot&#039;&#039; (take screenshot of window),&lt;br /&gt;
 &#039;&#039;switch&#039;&#039; (switch to designated tab),&lt;br /&gt;
 &#039;&#039;window&#039;&#039; (get current tab&#039;s window handle).&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== WD_HELPER ===&lt;br /&gt;
The WD_Helper.au3 file holds functions to help you automate a web site.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Attach || Attach to existing browser tab || Use one of the following search modes:&lt;br /&gt;
 &#039;&#039;HTML&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;URL&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ConsoleVisible || Control visibility of the webdriver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_DownloadFile || Download file and save to disk || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementActionEx || Perform advanced action on desginated element ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementOptionSelect || Find and click on an option from a Select element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementSelectAction || Perform action on designated Select element || Use one of the following commands:&lt;br /&gt;
 &#039;&#039;options&#039;&#039;,&lt;br /&gt;
 &#039;&#039;value&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteCdpCommand || ChromeDriver specific function to execute &amp;quot;Chrome DevTools Protocol&amp;quot; (CDP) commands ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameEnter || Will enter the specified frame for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameLeave || Will leave the current frame, to its parent, not necessarily the Top, for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementById || Locate element by id ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementByName || Locate element by name ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementFromPoint || Retrieves reference to element descriped by x/y coordinate || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetFrameCount || Returns how many frames/iframes are in your current window/frame || It will not traverse to nested frames&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetMouseElement || Retrieves reference to element below mouse pointer || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetShadowRoot || Retrieves the shadow root of an element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetTable || Return all elements of a table ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElement || Will highlight the specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElements || Will highlight multiple elements passed as an array || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsLatestRelease || Compares local UDF version to latest release on Github || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsWindowTop || Returns a boolean of the session being at the top level, or in a frame(s) || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LastHTTPResult || Return the result of the last WinHTTP request || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LinkClickByText || Simulate a mouse click on a link with text matching the provided string || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LoadWait || Wait for a browser page load to complete before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_NewTab || Create new tab using Javascript ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Screenshot || Will return a screenshot of the browser window or a specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SelectFiles || Select files for uploading to a website || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetElementValue || Set value of designated element ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetTimeouts || User friendly function to set webdriver session timeouts ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_UpdateDriver || Replace web driver with newer version, if available || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_WaitElement || Wait for a element to be found in the current tab before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_jQuerify || Inject jQuery library into current session || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/07/06)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
==== WinHTTP UDF ====&lt;br /&gt;
Make sure that you are running at least version 1.6.4.2 (currently unreleased, but can be obtained [https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3 here]).&lt;br /&gt;
==== Chrome ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugChrome1&amp;quot;&amp;gt;Chrome does not start and the DOS window for chromedriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugChrome1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Chrome and does not display the DOS window for chromedriver.&amp;lt;br&amp;gt;When you manually run the chromedriver in a DOS window you get message &amp;quot;[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied.&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the chrome driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\chromedriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugFirefox1&amp;quot;&amp;gt;Firefox does not start and the DOS window for geckodriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugFirefox1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Firefox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the gecko driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\geckodriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/10/11)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ1&amp;quot;&amp;gt;1. How to connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ2&amp;quot;&amp;gt;2. How to hide the webdriver console&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I hide the webdriver console?&amp;lt;br&amp;gt;A: The console can be completely hidden from the start by adding the following line near the beginning of your script:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error&amp;lt;/syntaxhighlight&amp;gt;You can also control the visibility of the console with the function _WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ3&amp;quot;&amp;gt;3. How to utilize an existing user profile&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Can I use an existing user profile instead of the default behavior of using a new one?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration, with each browser using a different method to implement. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;:[&amp;quot;--user-data-dir=C:\\Users\\&#039; &amp;amp; @UserName &amp;amp; &#039;\\AppData\\Local\\Google\\Chrome\\User Data\\&amp;quot;, &amp;quot;--profile-directory=Default&amp;quot;]}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;:{&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;moz:firefoxOptions&amp;quot;: {&amp;quot;args&amp;quot;: [&amp;quot;-profile&amp;quot;, &#039; &amp;amp; GetDefaultFFProfile() &amp;amp; &#039;],&amp;quot;log&amp;quot;: {&amp;quot;level&amp;quot;: &amp;quot;trace&amp;quot;}}}}}&#039;&lt;br /&gt;
&lt;br /&gt;
Func GetDefaultFFProfile()&lt;br /&gt;
	Local $sDefault, $sProfilePath = &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
	Local $sProfilesPath = StringReplace(@AppDataDir, &#039;\&#039;, &#039;/&#039;) &amp;amp; &amp;quot;/Mozilla/Firefox/&amp;quot;&lt;br /&gt;
	Local $sFilename = $sProfilesPath &amp;amp; &amp;quot;profiles.ini&amp;quot;&lt;br /&gt;
	Local $aSections = IniReadSectionNames ($sFilename)&lt;br /&gt;
&lt;br /&gt;
	If Not @error Then&lt;br /&gt;
		For $i = 1 To $aSections[0]&lt;br /&gt;
			$sDefault = IniRead($sFilename, $aSections[$i], &#039;Default&#039;, &#039;0&#039;)&lt;br /&gt;
&lt;br /&gt;
			If $sDefault = &#039;1&#039; Then&lt;br /&gt;
				$sProfilePath = $sProfilesPath &amp;amp; IniRead($sFilename, $aSections[$i], &amp;quot;Path&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
				ExitLoop&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	Return $sProfilePath&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will also likely need to specify the marionette port:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&#039;DriverParams&#039;, &#039;--marionette-port 2828&#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ4&amp;quot;&amp;gt;4. How to specify location of browser executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch a browser installed in a non-standard location?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\chrome.exe&amp;quot; }}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;desiredCapabilities&amp;quot;:{&amp;quot;javascriptEnabled&amp;quot;:true,&amp;quot;nativeEvents&amp;quot;:true,&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;moz:firefoxOptions&amp;quot;:{&amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\firefox.exe&amp;quot;}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;Alternate Firefox method:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_Option(&#039;DriverParams&#039;, &#039;--binary &amp;quot;C:\Program Files\Mozilla Firefox\firefox.exe&amp;quot; --log trace &#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ5&amp;quot;&amp;gt;5. How to maximize the browser window&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ5&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to maximize the browser window?&amp;lt;br&amp;gt;A: Simply call the following function:&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Window($sSession, &amp;quot;Maximize&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Make sure to call _WD_Window after the session has been created with _WD_CreateSession.&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ6&amp;quot;&amp;gt;6. How to specify location of WebDriver executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ6&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch the WebDriver executable from a specific location?&amp;lt;br&amp;gt;A: This is controlled by function &amp;quot;_WD_Option&amp;quot;. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\local\WebDriver\WebDriver.exe&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ7&amp;quot;&amp;gt;7. How to retrieve the values of a drop-down list&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ7&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How to retrieve the values of a drop-down list (&amp;lt;Select&amp;gt; tag)?&amp;lt;br&amp;gt;A1: Here&#039;s a simple way to do it:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$sText = _WD_ElementAction($sSession, $sElement, &#039;property&#039;, &#039;innerText&#039;)&lt;br /&gt;
$aOptions = StringSplit ( $sText, @LF,  $STR_NOCOUNT)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;xxx&#039; is the name of the drop-down list.&lt;br /&gt;
&amp;lt;br&amp;gt;A2: This can now be accomplished using the function _WD_ElementSelectAction:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$aOptions = _WD_ElementSelectAction ($sSession, $sElement, &#039;options&#039;)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ8&amp;quot;&amp;gt;8. How to run the browser in headless mode&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ8&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How do I run the browser in &amp;quot;headless&amp;quot; mode?&amp;lt;br&amp;gt;A: This is controlled by the Capabilities string that is passed to _WD_CreateSession. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;: [&amp;quot;--headless&amp;quot;, &amp;quot;--allow-running-insecure-content&amp;quot;] }}}}&#039; &amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
The following tools will help you to automate your browser:&lt;br /&gt;
* [https://autonomiq.io/chropath/ ChroPath]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Makes finding an element by XPath, ID or CSS incredibly easy (Chrome, Firefox, Opera)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/01)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* AutoIt WebDriver threads:&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019 Example Scripts]&#039;&#039;&#039; forum - WebDriver UDF (W3C compliant version)&lt;br /&gt;
** Danp2&#039;s closed thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/ General Help and Support]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (this is part I)&lt;br /&gt;
** Danp2&#039;s active thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/ General Help and Support II]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (II) &lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201283-im-creating-a-webdriver-tutorial General Help and Support]&#039;&#039;&#039; forum - Discussion about this Wiki Page&lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/ Example Scripts]&#039;&#039;&#039; forum - WebDriver example scripts collection&lt;br /&gt;
&lt;br /&gt;
* WebDriver Exe documentation:&lt;br /&gt;
** [https://sites.google.com/a/chromium.org/chromedriver/ Chrome]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver Edge]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium Edge Chromium]&lt;br /&gt;
** [https://firefox-source-docs.mozilla.org/testing/geckodriver/ Firefox]&lt;br /&gt;
** [https://selenium.dev/documentation/en/webdriver/ Opera]&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14439</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14439"/>
		<updated>2020-11-12T18:00:05Z</updated>

		<summary type="html">&lt;p&gt;Danp2: /* FAQ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/10/11)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF (AutoIt)] by Ward and Jos&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF (AutoIt)] by trancexx or [https://github.com/dragana-r/autoit-winhttp autoit-winhttp (GitHub)]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF (GitHub)] by Danp2&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 86.0.4240.22 / &amp;lt;br&amp;gt; 2020.09.03 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 87.0.666.0 / &amp;lt;br&amp;gt; 2020.10.09 || &lt;br /&gt;
|-&lt;br /&gt;
| Firefox || [https://github.com/mozilla/geckodriver/releases GitHub] || 0.27 / &amp;lt;br&amp;gt; 2020.07.29 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases/latest GitHub] || 85.0.4183.102 / &amp;lt;br&amp;gt; 2020.09.15 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status Firefox]&lt;br /&gt;
* [https://github.com/operasoftware/operachromiumdriver Opera]: &amp;quot;&#039;&#039;OperaChromiumDriver is a WebDriver implementation derived from ChromeDriver and adapted by Opera&#039;&#039;&amp;quot;. That&#039;s why I think it has at least the same limitations as ChromeDriver.&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
=== Used Terms ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/08)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
	 &lt;br /&gt;
You will find the following terms when using WebDriver. We try to shed some light onto this subject here:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Marionette&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette consists of two parts: a server which takes requests and executes them in Gecko (the Marionette server ships with Firefox), and a client (the Marionette client ships with the GeckoDriver exe). The client sends commands to the server and the server executes the command inside the browser.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://firefox-source-docs.mozilla.org/testing/marionette/Intro.html visit this site].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ShadowRoot&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The ShadowRoot interface of the Shadow DOM API is the root node of a DOM subtree that is rendered separately from a document&#039;s main DOM tree.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://dom.spec.whatwg.org/#interface-shadowroot visit this site].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/09/27)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To automate your browser the following installation steps are needed:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory (with WD_Demo.au3):&lt;br /&gt;
** chromedriver.exe (Chrome)&lt;br /&gt;
** geckodriver.exe (Firefox)&lt;br /&gt;
** msedgedriver.exe (Edge - Chromium) or MicrosoftWebDriver.exe (Edge - EdgeHTML)&lt;br /&gt;
* Run WD_Demo.au3 and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\ ...&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;, ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function reference ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/08/31 - based on version 0.3.0.8)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WD_CORE ===&lt;br /&gt;
The WD_Core.au3 file holds functions to implement the Webdriver W3C document.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Action || Perform various interactions with the web driver session || Use one of the following values for parameter $sCommand:&lt;br /&gt;
 &#039;&#039;actions&#039;&#039;,&lt;br /&gt;
 &#039;&#039;back&#039;&#039;,&lt;br /&gt;
 &#039;&#039;forward&#039;&#039;,&lt;br /&gt;
 &#039;&#039;refresh&#039;&#039;,&lt;br /&gt;
 &#039;&#039;title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;url&#039;&#039;.&lt;br /&gt;
For command &#039;&#039;actions&#039;&#039;: Pass the actions to be set using parameter $sOption. If $sOption is empty then the set actions will be removed.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Alert || Respond to user prompt || Use one of the following actions to respond to the user prompt:&lt;br /&gt;
 &#039;&#039;accept&#039;&#039;,&lt;br /&gt;
 &#039;&#039;dismiss&#039;&#039;,&lt;br /&gt;
 &#039;&#039;gettext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;sendtext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;status&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Cookies || Gets, sets, or deletes the session&#039;s cookies || Use one of the following commands: &lt;br /&gt;
 &#039;&#039;get&#039;&#039; (Gets a single cookie)&lt;br /&gt;
 &#039;&#039;getall&#039;&#039; (Gets all cookies)&lt;br /&gt;
 &#039;&#039;add&#039;&#039; (Sets a single cookie)&lt;br /&gt;
 &#039;&#039;delete&#039;&#039; (Deletes a single cookie)&lt;br /&gt;
|-&lt;br /&gt;
| _WD_CreateSession|| Request new session from web driver || Define the capabilities of the browser with this function&lt;br /&gt;
|-&lt;br /&gt;
| _WD_DeleteSession || Delete existing session || Closes the session created by _WD_CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementAction || Perform action on designated element || Use one of the following actions:&lt;br /&gt;
 &#039;&#039;Active&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Attribute&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Clear&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Click&#039;&#039;,&lt;br /&gt;
 &#039;&#039;CSS&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Displayed&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Enabled&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Name&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Property&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Rect&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Screenshot&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Selected&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Text&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Value&#039;&#039;. &lt;br /&gt;
&#039;&#039;Clear&#039;&#039;, &#039;&#039;Click&#039;&#039; and &#039;&#039;Value&#039;&#039; use POST to modify or process the element. All other actions use GET to retrieve data from the element&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteScript || Execute Javascipt commands || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FindElement|| Find element(s) by designated strategy || You can specify whether the function should only return the first find or all of them&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetSource || Get page source || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Navigate || Navigate to the designated URL || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Option || Sets and get options for the web driver UDF || The following options can be used:&lt;br /&gt;
 &#039;&#039;BaseURL&#039;&#039; (IP address used for web driver communication),&lt;br /&gt;
 &#039;&#039;BinaryFormat&#039;&#039; (format used to store binary data),&lt;br /&gt;
 &#039;&#039;Console&#039;&#039; (define destination for console output),&lt;br /&gt;
 &#039;&#039;Driver&#039;&#039; (set the full path name to web driver executable),&lt;br /&gt;
 &#039;&#039;DriverParams&#039;&#039; (parameters to pass to web driver executable),&lt;br /&gt;
 &#039;&#039;Port&#039;&#039; (port used for web driver communication).&lt;br /&gt;
If no value is passed to be set the current value is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Shutdown || Kill the web driver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Startup || Launch the designated web driver console app || The PID for the WebDriver console is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Status || Get current web driver state || Returns a raw JSON response from the web driver&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Timeouts || Set or retrieve the session timeout parameters || Specify the type and value of the timeout like this: &#039;{&amp;quot;type&amp;quot;:value}&#039;. Example: &#039;{&amp;quot;pageLoad&amp;quot;:2000}&#039;&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Window || Perform interactions related to the current window || One of the following actions:&lt;br /&gt;
 &#039;&#039;close&#039;&#039; (close current tab),&lt;br /&gt;
 &#039;&#039;frame&#039;&#039; (switch to frame),&lt;br /&gt;
 &#039;&#039;fullscreen&#039;&#039; (set window to fullscreen),&lt;br /&gt;
 &#039;&#039;handles&#039;&#039; (get all window handles),&lt;br /&gt;
 &#039;&#039;maximize&#039;&#039; (maximize window),&lt;br /&gt;
 &#039;&#039;minimize&#039;&#039; (minimize window), &lt;br /&gt;
 &#039;&#039;parent&#039;&#039; (switch to parent frame),&lt;br /&gt;
 &#039;&#039;rect&#039;&#039; (get or set the window&#039;s size &amp;amp; position),&lt;br /&gt;
 &#039;&#039;screenshot&#039;&#039; (take screenshot of window),&lt;br /&gt;
 &#039;&#039;switch&#039;&#039; (switch to designated tab),&lt;br /&gt;
 &#039;&#039;window&#039;&#039; (get current tab&#039;s window handle).&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== WD_HELPER ===&lt;br /&gt;
The WD_Helper.au3 file holds functions to help you automate a web site.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Attach || Attach to existing browser tab || Use one of the following search modes:&lt;br /&gt;
 &#039;&#039;HTML&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;URL&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ConsoleVisible || Control visibility of the webdriver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_DownloadFile || Download file and save to disk || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementActionEx || Perform advanced action on desginated element ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementOptionSelect || Find and click on an option from a Select element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementSelectAction || Perform action on designated Select element || Use one of the following commands:&lt;br /&gt;
 &#039;&#039;options&#039;&#039;,&lt;br /&gt;
 &#039;&#039;value&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteCdpCommand || ChromeDriver specific function to execute &amp;quot;Chrome DevTools Protocol&amp;quot; (CDP) commands ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameEnter || Will enter the specified frame for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameLeave || Will leave the current frame, to its parent, not necessarily the Top, for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementById || Locate element by id ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementByName || Locate element by name ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementFromPoint || Retrieves reference to element descriped by x/y coordinate || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetFrameCount || Returns how many frames/iframes are in your current window/frame || It will not traverse to nested frames&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetMouseElement || Retrieves reference to element below mouse pointer || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetShadowRoot || Retrieve the specified ShadowRoot || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetTable || Return all elements of a table ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElement || Will highlight the specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElements || Will highlight multiple elements passed as an array || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsLatestRelease || Compares local UDF version to latest release on Github || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsWindowTop || Returns a boolean of the session being at the top level, or in a frame(s) || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LastHTTPResult || Return the result of the last WinHTTP request || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LinkClickByText || Simulate a mouse click on a link with text matching the provided string || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LoadWait || Wait for a browser page load to complete before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_NewTab || Create new tab using Javascript ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Screenshot || Will return a screenshot of the browser window or a specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SelectFiles || Select files for uploading to a website || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetElementValue || ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetTimeouts || User friendly function to set webdriver session timeouts ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_UpdateDriver || Replace web driver with newer version, if available || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_WaitElement || Wait for a element to be found in the current tab before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_jQuerify || Inject jQuery library into current session || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/07/06)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
==== WinHTTP UDF ====&lt;br /&gt;
Make sure that you are running at least version 1.6.4.2 (currently unreleased, but can be obtained [https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3 here]).&lt;br /&gt;
==== Chrome ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugChrome1&amp;quot;&amp;gt;Chrome does not start and the DOS window for chromedriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugChrome1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Chrome and does not display the DOS window for chromedriver.&amp;lt;br&amp;gt;When you manually run the chromedriver in a DOS window you get message &amp;quot;[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied.&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the chrome driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\chromedriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugFirefox1&amp;quot;&amp;gt;Firefox does not start and the DOS window for geckodriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugFirefox1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Firefox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the gecko driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\geckodriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/10/11)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ1&amp;quot;&amp;gt;1. How to connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ2&amp;quot;&amp;gt;2. How to hide the webdriver console&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I hide the webdriver console?&amp;lt;br&amp;gt;A: The console can be completely hidden from the start by adding the following line near the beginning of your script:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error&amp;lt;/syntaxhighlight&amp;gt;You can also control the visibility of the console with the function _WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ3&amp;quot;&amp;gt;3. How to utilize an existing user profile&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Can I use an existing user profile instead of the default behavior of using a new one?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration, with each browser using a different method to implement. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;:[&amp;quot;--user-data-dir=C:\\Users\\&#039; &amp;amp; @UserName &amp;amp; &#039;\\AppData\\Local\\Google\\Chrome\\User Data\\&amp;quot;, &amp;quot;--profile-directory=Default&amp;quot;]}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;:{&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;moz:firefoxOptions&amp;quot;: {&amp;quot;args&amp;quot;: [&amp;quot;-profile&amp;quot;, &amp;quot;C:/Users/AppData/Roaming/Mozilla/Firefox/Profiles/gbjaumrnd.default&amp;quot;],&amp;quot;log&amp;quot;: {&amp;quot;level&amp;quot;: &amp;quot;trace&amp;quot;}}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;You will also likely need to specify the marionette port:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&#039;DriverParams&#039;, &#039;--marionette-port 2828&#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ4&amp;quot;&amp;gt;4. How to specify location of browser executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch a browser installed in a non-standard location?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\chrome.exe&amp;quot; }}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;desiredCapabilities&amp;quot;:{&amp;quot;javascriptEnabled&amp;quot;:true,&amp;quot;nativeEvents&amp;quot;:true,&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;moz:firefoxOptions&amp;quot;:{&amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\firefox.exe&amp;quot;}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;Alternate Firefox method:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_Option(&#039;DriverParams&#039;, &#039;--binary &amp;quot;C:\Program Files\Mozilla Firefox\firefox.exe&amp;quot; --log trace &#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ5&amp;quot;&amp;gt;5. How to maximize the browser window&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ5&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to maximize the browser window?&amp;lt;br&amp;gt;A: Simply call the following function:&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Window($sSession, &amp;quot;Maximize&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Make sure to call _WD_Window after the session has been created with _WD_CreateSession.&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ6&amp;quot;&amp;gt;6. How to specify location of WebDriver executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ6&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch the WebDriver executable from a specific location?&amp;lt;br&amp;gt;A: This is controlled by function &amp;quot;_WD_Option&amp;quot;. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\local\WebDriver\WebDriver.exe&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ7&amp;quot;&amp;gt;7. How to retrieve the values of a drop-down list&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ7&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How to retrieve the values of a drop-down list (&amp;lt;Select&amp;gt; tag)?&amp;lt;br&amp;gt;A1: Here&#039;s a simple way to do it:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$sText = _WD_ElementAction($sSession, $sElement, &#039;property&#039;, &#039;innerText&#039;)&lt;br /&gt;
$aOptions = StringSplit ( $sText, @LF,  $STR_NOCOUNT)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;xxx&#039; is the name of the drop-down list.&lt;br /&gt;
&amp;lt;br&amp;gt;A2: This can now be accomplished using the function _WD_ElementSelectAction:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$aOptions = _WD_ElementSelectAction ($sSession, $sElement, &#039;options&#039;)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ8&amp;quot;&amp;gt;8. How to run the browser in headless mode&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ8&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How do I run the browser in &amp;quot;headless&amp;quot; mode?&amp;lt;br&amp;gt;A: This is controlled by the Capabilities string that is passed to _WD_CreateSession. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;: [&amp;quot;--headless&amp;quot;, &amp;quot;--allow-running-insecure-content&amp;quot;] }}}}&#039; &amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
The following tools will help you to automate your browser:&lt;br /&gt;
* [https://autonomiq.io/chropath/ ChroPath]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Makes finding an element by XPath, ID or CSS incredibly easy (Chrome, Firefox, Opera)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/01)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* AutoIt WebDriver threads:&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019 Example Scripts]&#039;&#039;&#039; forum - WebDriver UDF (W3C compliant version)&lt;br /&gt;
** Danp2&#039;s closed thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/ General Help and Support]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (this is part I)&lt;br /&gt;
** Danp2&#039;s active thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/ General Help and Support II]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (II) &lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201283-im-creating-a-webdriver-tutorial General Help and Support]&#039;&#039;&#039; forum - Discussion about this Wiki Page&lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/ Example Scripts]&#039;&#039;&#039; forum - WebDriver example scripts collection&lt;br /&gt;
&lt;br /&gt;
* WebDriver Exe documentation:&lt;br /&gt;
** [https://sites.google.com/a/chromium.org/chromedriver/ Chrome]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver Edge]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium Edge Chromium]&lt;br /&gt;
** [https://firefox-source-docs.mozilla.org/testing/geckodriver/ Firefox]&lt;br /&gt;
** [https://selenium.dev/documentation/en/webdriver/ Opera]&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=AdlibEnable&amp;diff=14382</id>
		<title>AdlibEnable</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=AdlibEnable&amp;diff=14382"/>
		<updated>2020-08-09T14:04:29Z</updated>

		<summary type="html">&lt;p&gt;Danp2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NOTE: As of 3.3.4.0 AdlibEnable/AdlibDisable were replaced with AdlibRegister/[[AdlibUnRegister]].&lt;br /&gt;
[http://www.autoitscript.com/forum/topic/115139-adlibenable-func-dont-work/ See reference forum topic]&lt;br /&gt;
&lt;br /&gt;
Adlib&#039;s functionality is like that of combining {{Help File|Sleep}} with {{Help File|Call}} in that a function will be called after so many milliseconds.&lt;br /&gt;
&lt;br /&gt;
=Syntax=&lt;br /&gt;
 AdlibEnable(&amp;quot;&#039;&#039;func&#039;&#039;&amp;quot;[, &#039;&#039;time&#039;&#039;])&lt;br /&gt;
&lt;br /&gt;
=Parameters=&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;func&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Name of function to be called.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;time&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Time in milliseconds till next &#039;&#039;func&#039;&#039; call. Default 250ms. (Optional)&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Return Value=&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
=Example=&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Local $x = 0, $y&lt;br /&gt;
&lt;br /&gt;
Func myFunction()&lt;br /&gt;
  $y = MsgBox(1,&amp;quot;Count the boxes&amp;quot;,$x,1)  ; timeout in 1 second&lt;br /&gt;
  if $y = 2 then Exit  ; exit on cancel&lt;br /&gt;
  $x += 1&lt;br /&gt;
  AdlibEnable(myFunction(),1000)  ; call this function again in 1 second&lt;br /&gt;
EndFunc&lt;br /&gt;
&lt;br /&gt;
myFunction()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Related Functions=&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[[AdlibDisable]] [[Call]] [[Sleep]]&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14370</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14370"/>
		<updated>2020-07-17T13:18:49Z</updated>

		<summary type="html">&lt;p&gt;Danp2: /* FAQ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/07/12)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF]&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 84.0.4147.30 / &amp;lt;br&amp;gt; 2020.05.28 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 86.0.573.0 / &amp;lt;br&amp;gt; 2020.07.12 || &lt;br /&gt;
|-&lt;br /&gt;
| Firefox || [https://github.com/mozilla/geckodriver/releases github] || 0.26 / &amp;lt;br&amp;gt; 2019.10.12 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases github] || 83.0.4103.97 / &amp;lt;br&amp;gt; 2020.06.24 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status Firefox]&lt;br /&gt;
* [https://github.com/operasoftware/operachromiumdriver Opera]: &amp;quot;&#039;&#039;OperaChromiumDriver is a WebDriver implementation derived from ChromeDriver and adapted by Opera&#039;&#039;&amp;quot;. That&#039;s why I think it has at least the same limitations as ChromeDriver.&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
=== Used Terms ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/08)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
	 &lt;br /&gt;
You will find the following terms when using WebDriver. We try to shed some light onto this subject here:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Marionette&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette consists of two parts: a server which takes requests and executes them in Gecko (the Marionette server ships with Firefox), and a client (the Marionette client ships with the GeckoDriver exe). The client sends commands to the server and the server executes the command inside the browser.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://firefox-source-docs.mozilla.org/testing/marionette/Intro.html visit this site].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ShadowRoot&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The ShadowRoot interface of the Shadow DOM API is the root node of a DOM subtree that is rendered separately from a document&#039;s main DOM tree.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://dom.spec.whatwg.org/#interface-shadowroot visit this site].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/23)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To automate your browser the following installation steps are needed:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory:&lt;br /&gt;
** chromedriver.exe (Chrome)&lt;br /&gt;
** geckodriver.exe (Firefox)&lt;br /&gt;
** msedgedriver.exe (Edge - Chromium) or MicrosoftWebDriver.exe (Edge - EdgeHTML)&lt;br /&gt;
* Run WD_Demo.au3 and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\ ...&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;, ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function reference ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/07/12 - based on version 0.3.0.4)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WD_CORE ===&lt;br /&gt;
The WD_Core.au3 file holds functions to implement the Webdriver W3C document.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Action || Perform various interactions with the web driver session || Use one of the following values for parameter $sCommand:&lt;br /&gt;
 &#039;&#039;actions&#039;&#039;,&lt;br /&gt;
 &#039;&#039;back&#039;&#039;,&lt;br /&gt;
 &#039;&#039;forward&#039;&#039;,&lt;br /&gt;
 &#039;&#039;refresh&#039;&#039;,&lt;br /&gt;
 &#039;&#039;title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;url&#039;&#039;.&lt;br /&gt;
For command &#039;&#039;actions&#039;&#039;: Pass the actions to be set using parameter $sOption. If $sOption is empty then the set actions will be removed.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Alert || Respond to user prompt || Use one of the following actions to respond to the user prompt:&lt;br /&gt;
 &#039;&#039;accept&#039;&#039;,&lt;br /&gt;
 &#039;&#039;dismiss&#039;&#039;,&lt;br /&gt;
 &#039;&#039;gettext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;sendtext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;status&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Cookies || Gets, sets, or deletes the session&#039;s cookies || Use one of the following commands: &lt;br /&gt;
 &#039;&#039;get&#039;&#039; (Gets a single cookie)&lt;br /&gt;
 &#039;&#039;getall&#039;&#039; (Gets all cookies)&lt;br /&gt;
 &#039;&#039;add&#039;&#039; (Sets a single cookie)&lt;br /&gt;
 &#039;&#039;delete&#039;&#039; (Deletes a single cookie)&lt;br /&gt;
|-&lt;br /&gt;
| _WD_CreateSession|| Request new session from web driver || Define the capabilities of the browser with this function&lt;br /&gt;
|-&lt;br /&gt;
| _WD_DeleteSession || Delete existing session || Closes the session created by _WD_CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementAction || Perform action on designated element || Use one of the following actions:&lt;br /&gt;
 &#039;&#039;Active&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Attribute&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Clear&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Click&#039;&#039;,&lt;br /&gt;
 &#039;&#039;CSS&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Displayed&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Enabled&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Name&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Property&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Rect&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Screenshot&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Selected&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Text&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Value&#039;&#039;. &lt;br /&gt;
&#039;&#039;Clear&#039;&#039;, &#039;&#039;Click&#039;&#039; and &#039;&#039;Value&#039;&#039; use POST to modify or process the element. All other actions use GET to retrieve data from the element&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteScript || Execute Javascipt commands || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FindElement|| Find element(s) by designated strategy || You can specify whether the function should only return the first find or all of them&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetSource || Get page source || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Navigate || Navigate to the designated URL || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Option || Sets and get options for the web driver UDF || The following options can be used:&lt;br /&gt;
 &#039;&#039;BaseURL&#039;&#039; (IP address used for web driver communication),&lt;br /&gt;
 &#039;&#039;BinaryFormat&#039;&#039; (format used to store binary data),&lt;br /&gt;
 &#039;&#039;Driver&#039;&#039; (set the full path name to web driver executable),&lt;br /&gt;
 &#039;&#039;DriverParams&#039;&#039; (parameters to pass to web driver executable),&lt;br /&gt;
 &#039;&#039;Port&#039;&#039; (port used for web driver communication).&lt;br /&gt;
If no value is passed to be set the current value is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Shutdown || Kill the web driver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Startup || Launch the designated web driver console app || The PID for the WebDriver console is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Status || Get current web driver state || Returns a raw JSON response from the web driver&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Timeouts || Set or retrieve the session timeout parameters || Specify the type and value of the timeout like this: &#039;{&amp;quot;type&amp;quot;:value}&#039;. Example: &#039;{&amp;quot;pageLoad&amp;quot;:2000}&#039;&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Window || Perform interactions related to the current window || One of the following actions:&lt;br /&gt;
 &#039;&#039;close&#039;&#039; (close current tab),&lt;br /&gt;
 &#039;&#039;frame&#039;&#039; (switch to frame),&lt;br /&gt;
 &#039;&#039;fullscreen&#039;&#039; (set window to fullscreen),&lt;br /&gt;
 &#039;&#039;handles&#039;&#039; (get all window handles),&lt;br /&gt;
 &#039;&#039;maximize&#039;&#039; (maximize window),&lt;br /&gt;
 &#039;&#039;minimize&#039;&#039; (minimize window), &lt;br /&gt;
 &#039;&#039;parent&#039;&#039; (switch to parent frame),&lt;br /&gt;
 &#039;&#039;rect&#039;&#039; (get or set the window&#039;s size &amp;amp; position),&lt;br /&gt;
 &#039;&#039;screenshot&#039;&#039; (take screenshot of window),&lt;br /&gt;
 &#039;&#039;switch&#039;&#039; (switch to designated tab),&lt;br /&gt;
 &#039;&#039;window&#039;&#039; (get current tab&#039;s window handle).&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== WD_HELPER ===&lt;br /&gt;
The WD_Helper.au3 file holds functions to help you automate a web site.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Attach || Attach to existing browser tab || Use one of the following search modes:&lt;br /&gt;
 &#039;&#039;HTML&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;URL&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ConsoleVisible || Control visibility of the webdriver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_DownloadFile || Download file and save to disk || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementActionEx || Perform advanced action on desginated element ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementOptionSelect || Find and click on an option from a Select element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementSelectAction || Perform action on designated Select element || Use one of the following commands:&lt;br /&gt;
 &#039;&#039;options&#039;&#039;,&lt;br /&gt;
 &#039;&#039;value&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteCdpCommand || ChromeDriver specific function to execute &amp;quot;Chrome DevTools Protocol&amp;quot; (CDP) commands ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameEnter || Will enter the specified frame for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameLeave || Will leave the current frame, to its parent, not necessarily the Top, for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementById || Locate element by id ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementByName || Locate element by name ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementFromPoint || Retrieves reference to element descriped by x/y coordinate || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetFrameCount || Returns how many frames/iframes are in your current window/frame || It will not traverse to nested frames&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetMouseElement || Retrieves reference to element below mouse pointer || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetShadowRoot || Retrieve the specified ShadowRoot || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElement || Will highlight the specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElements || Will highlight multiple elements passed as an array || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsLatestRelease || Compares local UDF version to latest release on Github || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsWindowTop || Returns a boolean of the session being at the top level, or in a frame(s) || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LastHTTPResult || Return the result of the last WinHTTP request || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LinkClickByText || Simulate a mouse click on a link with text matching the provided string || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LoadWait || Wait for a browser page load to complete before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_NewTab || Create new tab using Javascript ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Screenshot || Will return a screenshot of the browser window or a specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SelectFiles || Select files for uploading to a website || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetElementValue || ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetTimeouts || User friendly function to set webdriver session timeouts ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_UpdateDriver || Replace web driver with newer version, if available || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_WaitElement || Wait for a element to be found  in the current tab before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_jQuerify || Inject jQuery library into current session || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/07/06)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
==== WinHTTP UDF ====&lt;br /&gt;
Make sure that you are running at least version 1.6.4.2 (currently unreleased, but can be obtained [https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3 here]).&lt;br /&gt;
==== Chrome ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugChrome1&amp;quot;&amp;gt;Chrome does not start and the DOS window for chromedriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugChrome1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Chrome and does not display the DOS window for chromedriver.&amp;lt;br&amp;gt;When you manually run the chromedriver in a DOS window you get message &amp;quot;[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied.&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the chrome driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\chromedriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugFirefox1&amp;quot;&amp;gt;Firefox does not start and the DOS window for geckodriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugFirefox1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Firefox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the gecko driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\geckodriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/07/11)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ1&amp;quot;&amp;gt;1. How to connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post] or in the [https://github.com/Danp2/WebDriver/wiki/Connecting-to-existing-browser-instance Github wiki].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ2&amp;quot;&amp;gt;2. How to hide the webdriver console&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I hide the webdriver console?&amp;lt;br&amp;gt;A: The console can be completely hidden from the start by adding the following line near the beginning of your script:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error&amp;lt;/syntaxhighlight&amp;gt;You can also control the visibility of the console with the function _WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ3&amp;quot;&amp;gt;3. How to utilize an existing user profile&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Can I use an existing user profile instead of the default behavior of using a new one?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration, with each browser using a different method to implement. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;:[&amp;quot;--user-data-dir=C:\\Users\\&#039; &amp;amp; @UserName &amp;amp; &#039;\\AppData\\Local\\Google\\Chrome\\User Data\\&amp;quot;, &amp;quot;--profile-directory=Default&amp;quot;]}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;:{&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;moz:firefoxOptions&amp;quot;: {&amp;quot;args&amp;quot;: [&amp;quot;-profile&amp;quot;, &amp;quot;C:/Users/AppData/Roaming/Mozilla/Firefox/Profiles/gbjaumrnd.default&amp;quot;],&amp;quot;log&amp;quot;: {&amp;quot;level&amp;quot;: &amp;quot;trace&amp;quot;}}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;You will also likely need to specify the marionette port:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&#039;DriverParams&#039;, &#039;--marionette-port 2828&#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ4&amp;quot;&amp;gt;4. How to specify location of browser executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch a browser installed in a non-standard location?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\chrome.exe&amp;quot; }}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;desiredCapabilities&amp;quot;:{&amp;quot;javascriptEnabled&amp;quot;:true,&amp;quot;nativeEvents&amp;quot;:true,&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;moz:firefoxOptions&amp;quot;:{&amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\firefox.exe&amp;quot;}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;Alternate Firefox method:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_Option(&#039;DriverParams&#039;, &#039;--binary &amp;quot;C:\Program Files\Mozilla Firefox\firefox.exe&amp;quot; --log trace &#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ5&amp;quot;&amp;gt;5. How to maximize the browser window&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ5&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to maximize the browser window?&amp;lt;br&amp;gt;A: Simply call the following function:&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Window($sSession, &amp;quot;Maximize&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ6&amp;quot;&amp;gt;6. How to specify location of WebDriver executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ6&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch the WebDriver executable from a specific location?&amp;lt;br&amp;gt;A: This is controlled by function &amp;quot;_WD_Option&amp;quot;. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\local\WebDriver\WebDriver.exe&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ7&amp;quot;&amp;gt;7. How to retrieve the values of a drop-down list&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ7&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How to retrieve the values of a drop-down list (&amp;lt;Select&amp;gt; tag)?&amp;lt;br&amp;gt;A1: Here&#039;s a simple way to do it:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$sText = _WD_ElementAction($sSession, $sElement, &#039;property&#039;, &#039;innerText&#039;)&lt;br /&gt;
$aOptions = StringSplit ( $sText, @LF,  $STR_NOCOUNT)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;xxx&#039; is the name of the drop-down list.&lt;br /&gt;
&amp;lt;br&amp;gt;A2: This can now be accomplished using the function _WD_ElementSelectAction:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$aOptions = _WD_ElementSelectAction ($sSession, $sElement, &#039;options&#039;)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ8&amp;quot;&amp;gt;8. How to run the browser in headless mode&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ8&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How do I run the browser in &amp;quot;headless&amp;quot; mode?&amp;lt;br&amp;gt;A: This is controlled by the Capabilities string that is passed to _WD_CreateSession. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;: [&amp;quot;--headless&amp;quot;, &amp;quot;--allow-running-insecure-content&amp;quot;] }}}}&#039; &amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
The following tools will help you to automate your browser:&lt;br /&gt;
* [https://autonomiq.io/chropath/ ChroPath]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Makes finding an element by XPath, ID or CSS incredibly easy (Chrome, Firefox, Opera)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/01)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* AutoIt WebDriver threads:&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019 Example Scripts]&#039;&#039;&#039; forum - WebDriver UDF (W3C compliant version)&lt;br /&gt;
** Danp2&#039;s closed thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/ General Help and Support]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (this is part I)&lt;br /&gt;
** Danp2&#039;s active thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/ General Help and Support II]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (II) &lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201283-im-creating-a-webdriver-tutorial General Help and Support]&#039;&#039;&#039; forum - Discussion about this Wiki Page&lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/ Example Scripts]&#039;&#039;&#039; forum - WebDriver example scripts collection&lt;br /&gt;
&lt;br /&gt;
* WebDriver Exe documentation:&lt;br /&gt;
** [https://sites.google.com/a/chromium.org/chromedriver/ Chrome]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver Edge]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium Edge Chromium]&lt;br /&gt;
** [https://firefox-source-docs.mozilla.org/testing/geckodriver/ Firefox]&lt;br /&gt;
** [https://selenium.dev/documentation/en/webdriver/ Opera]&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14364</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14364"/>
		<updated>2020-07-11T21:27:48Z</updated>

		<summary type="html">&lt;p&gt;Danp2: /* FAQ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/06/14)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF]&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 84.0.4147.30 / &amp;lt;br&amp;gt; 2020.05.28 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 85.0.545.0 / &amp;lt;br&amp;gt; 2020.06.14 || &lt;br /&gt;
|-&lt;br /&gt;
| Firefox || [https://github.com/mozilla/geckodriver/releases github] || 0.26 / &amp;lt;br&amp;gt; 2019.10.12 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases github] || 81.0.4044.113 / &amp;lt;br&amp;gt; 2020.04.22 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status Firefox]&lt;br /&gt;
* [https://github.com/operasoftware/operachromiumdriver Opera]: &amp;quot;&#039;&#039;OperaChromiumDriver is a WebDriver implementation derived from ChromeDriver and adapted by Opera&#039;&#039;&amp;quot;. That&#039;s why I think it has at least the same limitations as ChromeDriver.&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
=== Used Terms ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/08)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
	 &lt;br /&gt;
You will find the following terms when using WebDriver. We try to shed some light onto this subject here:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Marionette&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette consists of two parts: a server which takes requests and executes them in Gecko (the Marionette server ships with Firefox), and a client (the Marionette client ships with the GeckoDriver exe). The client sends commands to the server and the server executes the command inside the browser.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://firefox-source-docs.mozilla.org/testing/marionette/Intro.html visit this site].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ShadowRoot&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The ShadowRoot interface of the Shadow DOM API is the root node of a DOM subtree that is rendered separately from a document&#039;s main DOM tree.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://dom.spec.whatwg.org/#interface-shadowroot visit this site].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/23)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To automate your browser the following installation steps are needed:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory:&lt;br /&gt;
** chromedriver.exe (Chrome)&lt;br /&gt;
** geckodriver.exe (Firefox)&lt;br /&gt;
** msedgedriver.exe (Edge - Chromium) or MicrosoftWebDriver.exe (Edge - EdgeHTML)&lt;br /&gt;
* Run WD_Demo.au3 and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\ ...&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;, ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function reference ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/06/17 - based on version 0.3.0.3)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WD_CORE ===&lt;br /&gt;
The WD_Core.au3 file holds functions to implement the Webdriver W3C document.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Action || Perform various interactions with the web driver session || Use one of the following values for parameter $sCommand:&lt;br /&gt;
 &#039;&#039;actions&#039;&#039;,&lt;br /&gt;
 &#039;&#039;back&#039;&#039;,&lt;br /&gt;
 &#039;&#039;forward&#039;&#039;,&lt;br /&gt;
 &#039;&#039;refresh&#039;&#039;,&lt;br /&gt;
 &#039;&#039;title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;url&#039;&#039;.&lt;br /&gt;
For command &#039;&#039;actions&#039;&#039;: Pass the actions to be set using parameter $sOption. If $sOption is empty then the set actions will be removed.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Alert || Respond to user prompt || Use one of the following actions to respond to the user prompt:&lt;br /&gt;
 &#039;&#039;accept&#039;&#039;,&lt;br /&gt;
 &#039;&#039;dismiss&#039;&#039;,&lt;br /&gt;
 &#039;&#039;gettext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;sendtext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;status&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Cookies || Gets, sets, or deletes the session&#039;s cookies || Use one of the following commands: &lt;br /&gt;
 &#039;&#039;get&#039;&#039; (Gets a single cookie)&lt;br /&gt;
 &#039;&#039;getall&#039;&#039; (Gets all cookies)&lt;br /&gt;
 &#039;&#039;add&#039;&#039; (Sets a single cookie)&lt;br /&gt;
 &#039;&#039;delete&#039;&#039; (Deletes a single cookie)&lt;br /&gt;
|-&lt;br /&gt;
| _WD_CreateSession|| Request new session from web driver || Define the capabilities of the browser with this function&lt;br /&gt;
|-&lt;br /&gt;
| _WD_DeleteSession || Delete existing session || Closes the session created by _WD_CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementAction || Perform action on designated element || Use one of the following actions:&lt;br /&gt;
 &#039;&#039;Active&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Attribute&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Clear&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Click&#039;&#039;,&lt;br /&gt;
 &#039;&#039;CSS&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Displayed&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Enabled&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Name&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Property&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Rect&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Screenshot&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Selected&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Text&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Value&#039;&#039;. &lt;br /&gt;
&#039;&#039;Clear&#039;&#039;, &#039;&#039;Click&#039;&#039; and &#039;&#039;Value&#039;&#039; use POST to modify or process the element. All other actions use GET to retrieve data from the element&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteScript || Execute Javascipt commands || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FindElement|| Find element(s) by designated strategy || You can specify whether the function should only return the first find or all of them&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetSource || Get page source || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Navigate || Navigate to the designated URL || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Option || Sets and get options for the web driver UDF || The following options can be used:&lt;br /&gt;
 &#039;&#039;BaseURL&#039;&#039; (IP address used for web driver communication),&lt;br /&gt;
 &#039;&#039;BinaryFormat&#039;&#039; (format used to store binary data),&lt;br /&gt;
 &#039;&#039;Driver&#039;&#039; (set the full path name to web driver executable),&lt;br /&gt;
 &#039;&#039;DriverParams&#039;&#039; (parameters to pass to web driver executable),&lt;br /&gt;
 &#039;&#039;Port&#039;&#039; (port used for web driver communication).&lt;br /&gt;
If no value is passed to be set the current value is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Shutdown || Kill the web driver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Startup || Launch the designated web driver console app || The PID for the WebDriver console is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Status || Get current web driver state || Returns a raw JSON response from the web driver&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Timeouts || Set or retrieve the session timeout parameters || Specify the type and value of the timeout like this: &#039;{&amp;quot;type&amp;quot;:value}&#039;. Example: &#039;{&amp;quot;pageLoad&amp;quot;:2000}&#039;&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Window || Perform interactions related to the current window || One of the following actions:&lt;br /&gt;
 &#039;&#039;close&#039;&#039; (close current tab),&lt;br /&gt;
 &#039;&#039;frame&#039;&#039; (switch to frame),&lt;br /&gt;
 &#039;&#039;fullscreen&#039;&#039; (set window to fullscreen),&lt;br /&gt;
 &#039;&#039;handles&#039;&#039; (get all window handles),&lt;br /&gt;
 &#039;&#039;maximize&#039;&#039; (maximize window),&lt;br /&gt;
 &#039;&#039;minimize&#039;&#039; (minimize window), &lt;br /&gt;
 &#039;&#039;parent&#039;&#039; (switch to parent frame),&lt;br /&gt;
 &#039;&#039;rect&#039;&#039; (get or set the window&#039;s size &amp;amp; position),&lt;br /&gt;
 &#039;&#039;screenshot&#039;&#039; (take screenshot of window),&lt;br /&gt;
 &#039;&#039;switch&#039;&#039; (switch to designated tab),&lt;br /&gt;
 &#039;&#039;window&#039;&#039; (get current tab&#039;s window handle).&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== WD_HELPER ===&lt;br /&gt;
The WD_Helper.au3 file holds functions to help you automate a web site.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Attach || Attach to existing browser tab || Use one of the following search modes:&lt;br /&gt;
 &#039;&#039;HTML&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;URL&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ConsoleVisible || Control visibility of the webdriver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_DownloadFile || Download file and save to disk || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementActionEx || Perform advanced action on desginated element ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementOptionSelect || Find and click on an option from a Select element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementSelectAction || Perform action on designated Select element || Use one of the following commands:&lt;br /&gt;
 &#039;&#039;options&#039;&#039;,&lt;br /&gt;
 &#039;&#039;value&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameEnter || Will enter the specified frame for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameLeave || Will leave the current frame, to its parent, not necessarily the Top, for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementById || Locate element by id ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementByName || Locate element by name ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementFromPoint || Retrieves reference to element descriped by x/y coordinate || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetFrameCount || Returns how many frames/iframes are in your current window/frame || It will not traverse to nested frames&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetMouseElement || Retrieves reference to element below mouse pointer || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetShadowRoot || Retrieve the specified ShadowRoot || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElement || Will highlight the specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElements || Will highlight multiple elements passed as an array || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsLatestRelease || Compares local UDF version to latest release on Github || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsWindowTop || Returns a boolean of the session being at the top level, or in a frame(s) || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LastHTTPResult || Return the result of the last WinHTTP request || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LinkClickByText || Simulate a mouse click on a link with text matching the provided string || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LoadWait || Wait for a browser page load to complete before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_NewTab || Create new tab using Javascript ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Screenshot || Will return a screenshot of the browser window or a specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SelectFiles || Select files for uploading to a website || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetElementValue || ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetTimeouts || User friendly function to set webdriver session timeouts ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_UpdateDriver || Replace web driver with newer version, if available || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_WaitElement || Wait for a element to be found  in the current tab before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_jQuerify || Inject jQuery library into current session || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/27)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
==== WinHTTP UDF ====&lt;br /&gt;
Make sure that you are running at least version 1.6.4.2 (currently unreleased, but can be obtained [https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3 here].&lt;br /&gt;
==== Chrome ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugChrome1&amp;quot;&amp;gt;Chrome does not start and the DOS window for chromedriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugChrome1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Chrome and does not display the DOS window for chromedriver.&amp;lt;br&amp;gt;When you manually run the chromedriver in a DOS window you get message &amp;quot;[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied.&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the chrome driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\chromedriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugFirefox1&amp;quot;&amp;gt;Firefox does not start and the DOS window for geckodriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugFirefox1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Firefox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the gecko driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\geckodriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/04/19)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ1&amp;quot;&amp;gt;1. How to connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post] or in the [https://github.com/Danp2/WebDriver/wiki/Connecting-to-existing-browser-instance Github wiki].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ2&amp;quot;&amp;gt;2. How to hide the webdriver console&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I hide the webdriver console?&amp;lt;br&amp;gt;A: The console can be completely hidden from the start by adding the following line near the beginning of your script:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error&amp;lt;/syntaxhighlight&amp;gt;You can also control the visibility of the console with the function _WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ3&amp;quot;&amp;gt;3. How to utilize an existing user profile&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Can I use an existing user profile instead of the default behavior of using a new one?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration, with each browser using a different method to implement. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;:[&amp;quot;--user-data-dir=C:\\Users\\&#039; &amp;amp; @UserName &amp;amp; &#039;\\AppData\\Local\\Google\\Chrome\\User Data\\&amp;quot;, &amp;quot;--profile-directory=Default&amp;quot;]}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;:{&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;moz:firefoxOptions&amp;quot;: {&amp;quot;args&amp;quot;: [&amp;quot;-profile&amp;quot;, &amp;quot;C:/Users/AppData/Roaming/Mozilla/Firefox/Profiles/gbjaumrnd.default&amp;quot;],&amp;quot;log&amp;quot;: {&amp;quot;level&amp;quot;: &amp;quot;trace&amp;quot;}}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;You will also likely need to specify the martionette port&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&#039;DriverParams&#039;, &#039;--marionette-port 2828&#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ4&amp;quot;&amp;gt;4. How to specify location of browser executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch a browser installed in a non-standard location?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\chrome.exe&amp;quot; }}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;desiredCapabilities&amp;quot;:{&amp;quot;javascriptEnabled&amp;quot;:true,&amp;quot;nativeEvents&amp;quot;:true,&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;moz:firefoxOptions&amp;quot;:{&amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\firefox.exe&amp;quot;}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;Alternate Firefox method:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_Option(&#039;DriverParams&#039;, &#039;--binary &amp;quot;C:\Program Files\Mozilla Firefox\firefox.exe&amp;quot; --log trace &#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ5&amp;quot;&amp;gt;5. How to maximize the browser window&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ5&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to maximize the browser window?&amp;lt;br&amp;gt;A: Simply call the following function:&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Window($sSession, &amp;quot;Maximize&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ6&amp;quot;&amp;gt;6. How to specify location of WebDriver executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ6&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch the WebDriver executable from a specific location?&amp;lt;br&amp;gt;A: This is controlled by function &amp;quot;_WD_Option&amp;quot;. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\local\WebDriver\WebDriver.exe&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ7&amp;quot;&amp;gt;7. How to retrieve the values of a drop-down list&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ7&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How to retrieve the values of a drop-down list (&amp;lt;Select&amp;gt; tag)?&amp;lt;br&amp;gt;A1: Here&#039;s a simple way to do it:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$sText = _WD_ElementAction($sSession, $sElement, &#039;property&#039;, &#039;innerText&#039;)&lt;br /&gt;
$aOptions = StringSplit ( $sText, @LF,  $STR_NOCOUNT)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;xxx&#039; is the name of the drop-down list.&lt;br /&gt;
&amp;lt;br&amp;gt;A2: This can now be accomplished using the function _WD_ElementSelectAction:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$aOptions = _WD_ElementSelectAction ($sSession, $sElement, &#039;options&#039;)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
The following tools will help you to automate your browser:&lt;br /&gt;
* [https://autonomiq.io/chropath/ ChroPath]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Makes finding an element by XPath, ID or CSS incredibly easy (Chrome, Firefox, Opera)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/01)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* AutoIt WebDriver threads:&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019 Example Scripts]&#039;&#039;&#039; forum - WebDriver UDF (W3C compliant version)&lt;br /&gt;
** Danp2&#039;s closed thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/ General Help and Support]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (this is part I)&lt;br /&gt;
** Danp2&#039;s active thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/ General Help and Support II]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (II) &lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201283-im-creating-a-webdriver-tutorial General Help and Support]&#039;&#039;&#039; forum - Discussion about this Wiki Page&lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/ Example Scripts]&#039;&#039;&#039; forum - WebDriver example scripts collection&lt;br /&gt;
&lt;br /&gt;
* WebDriver Exe documentation:&lt;br /&gt;
** [https://sites.google.com/a/chromium.org/chromedriver/ Chrome]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver Edge]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium Edge Chromium]&lt;br /&gt;
** [https://firefox-source-docs.mozilla.org/testing/geckodriver/ Firefox]&lt;br /&gt;
** [https://selenium.dev/documentation/en/webdriver/ Opera]&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14359</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14359"/>
		<updated>2020-07-06T15:51:42Z</updated>

		<summary type="html">&lt;p&gt;Danp2: Troubleshooting / WinHTTP&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/06/14)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF]&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 84.0.4147.30 / &amp;lt;br&amp;gt; 2020.05.28 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 85.0.545.0 / &amp;lt;br&amp;gt; 2020.06.14 || &lt;br /&gt;
|-&lt;br /&gt;
| Firefox || [https://github.com/mozilla/geckodriver/releases github] || 0.26 / &amp;lt;br&amp;gt; 2019.10.12 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases github] || 81.0.4044.113 / &amp;lt;br&amp;gt; 2020.04.22 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status Firefox]&lt;br /&gt;
* [https://github.com/operasoftware/operachromiumdriver Opera]: &amp;quot;&#039;&#039;OperaChromiumDriver is a WebDriver implementation derived from ChromeDriver and adapted by Opera&#039;&#039;&amp;quot;. That&#039;s why I think it has at least the same limitations as ChromeDriver.&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
=== Used Terms ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/08)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
	 &lt;br /&gt;
You will find the following terms when using WebDriver. We try to shed some light onto this subject here:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Marionette&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette consists of two parts: a server which takes requests and executes them in Gecko (the Marionette server ships with Firefox), and a client (the Marionette client ships with the GeckoDriver exe). The client sends commands to the server and the server executes the command inside the browser.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://firefox-source-docs.mozilla.org/testing/marionette/Intro.html visit this site].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ShadowRoot&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The ShadowRoot interface of the Shadow DOM API is the root node of a DOM subtree that is rendered separately from a document&#039;s main DOM tree.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://dom.spec.whatwg.org/#interface-shadowroot visit this site].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/23)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To automate your browser the following installation steps are needed:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory:&lt;br /&gt;
** chromedriver.exe (Chrome)&lt;br /&gt;
** geckodriver.exe (Firefox)&lt;br /&gt;
** msedgedriver.exe (Edge - Chromium) or MicrosoftWebDriver.exe (Edge - EdgeHTML)&lt;br /&gt;
* Run WD_Demo.au3 and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\ ...&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;, ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function reference ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/06/17 - based on version 0.3.0.3)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WD_CORE ===&lt;br /&gt;
The WD_Core.au3 file holds functions to implement the Webdriver W3C document.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Action || Perform various interactions with the web driver session || Use one of the following values for parameter $sCommand:&lt;br /&gt;
 &#039;&#039;actions&#039;&#039;,&lt;br /&gt;
 &#039;&#039;back&#039;&#039;,&lt;br /&gt;
 &#039;&#039;forward&#039;&#039;,&lt;br /&gt;
 &#039;&#039;refresh&#039;&#039;,&lt;br /&gt;
 &#039;&#039;title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;url&#039;&#039;.&lt;br /&gt;
For command &#039;&#039;actions&#039;&#039;: Pass the actions to be set using parameter $sOption. If $sOption is empty then the set actions will be removed.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Alert || Respond to user prompt || Use one of the following actions to respond to the user prompt:&lt;br /&gt;
 &#039;&#039;accept&#039;&#039;,&lt;br /&gt;
 &#039;&#039;dismiss&#039;&#039;,&lt;br /&gt;
 &#039;&#039;gettext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;sendtext&#039;&#039;,&lt;br /&gt;
 &#039;&#039;status&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Cookies || Gets, sets, or deletes the session&#039;s cookies || Use one of the following commands: &lt;br /&gt;
 &#039;&#039;get&#039;&#039; (Gets a single cookie)&lt;br /&gt;
 &#039;&#039;getall&#039;&#039; (Gets all cookies)&lt;br /&gt;
 &#039;&#039;add&#039;&#039; (Sets a single cookie)&lt;br /&gt;
 &#039;&#039;delete&#039;&#039; (Deletes a single cookie)&lt;br /&gt;
|-&lt;br /&gt;
| _WD_CreateSession|| Request new session from web driver || Define the capabilities of the browser with this function&lt;br /&gt;
|-&lt;br /&gt;
| _WD_DeleteSession || Delete existing session || Closes the session created by _WD_CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementAction || Perform action on designated element || Use one of the following actions:&lt;br /&gt;
 &#039;&#039;Active&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Attribute&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Clear&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Click&#039;&#039;,&lt;br /&gt;
 &#039;&#039;CSS&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Displayed&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Enabled&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Name&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Property&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Rect&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Screenshot&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Selected&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Text&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Value&#039;&#039;. &lt;br /&gt;
&#039;&#039;Clear&#039;&#039;, &#039;&#039;Click&#039;&#039; and &#039;&#039;Value&#039;&#039; use POST to modify or process the element. All other actions use GET to retrieve data from the element&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteScript || Execute Javascipt commands || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FindElement|| Find element(s) by designated strategy || You can specify whether the function should only return the first find or all of them&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetSource || Get page source || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Navigate || Navigate to the designated URL || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Option || Sets and get options for the web driver UDF || The following options can be used:&lt;br /&gt;
 &#039;&#039;BaseURL&#039;&#039; (IP address used for web driver communication),&lt;br /&gt;
 &#039;&#039;BinaryFormat&#039;&#039; (format used to store binary data),&lt;br /&gt;
 &#039;&#039;Driver&#039;&#039; (set the full path name to web driver executable),&lt;br /&gt;
 &#039;&#039;DriverParams&#039;&#039; (parameters to pass to web driver executable),&lt;br /&gt;
 &#039;&#039;Port&#039;&#039; (port used for web driver communication).&lt;br /&gt;
If no value is passed to be set the current value is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Shutdown || Kill the web driver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Startup || Launch the designated web driver console app || The PID for the WebDriver console is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Status || Get current web driver state || Returns a raw JSON response from the web driver&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Timeouts || Set or retrieve the session timeout parameters || Specify the type and value of the timeout like this: &#039;{&amp;quot;type&amp;quot;:value}&#039;. Example: &#039;{&amp;quot;pageLoad&amp;quot;:2000}&#039;&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Window || Perform interactions related to the current window || One of the following actions:&lt;br /&gt;
 &#039;&#039;close&#039;&#039; (close current tab),&lt;br /&gt;
 &#039;&#039;frame&#039;&#039; (switch to frame),&lt;br /&gt;
 &#039;&#039;fullscreen&#039;&#039; (set window to fullscreen),&lt;br /&gt;
 &#039;&#039;handles&#039;&#039; (get all window handles),&lt;br /&gt;
 &#039;&#039;maximize&#039;&#039; (maximize window),&lt;br /&gt;
 &#039;&#039;minimize&#039;&#039; (minimize window), &lt;br /&gt;
 &#039;&#039;parent&#039;&#039; (switch to parent frame),&lt;br /&gt;
 &#039;&#039;rect&#039;&#039; (get or set the window&#039;s size &amp;amp; position),&lt;br /&gt;
 &#039;&#039;screenshot&#039;&#039; (take screenshot of window),&lt;br /&gt;
 &#039;&#039;switch&#039;&#039; (switch to designated tab),&lt;br /&gt;
 &#039;&#039;window&#039;&#039; (get current tab&#039;s window handle).&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== WD_HELPER ===&lt;br /&gt;
The WD_Helper.au3 file holds functions to help you automate a web site.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 200px;&amp;quot; | Function !! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 450px;&amp;quot; | Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Attach || Attach to existing browser tab || Use one of the following search modes:&lt;br /&gt;
 &#039;&#039;HTML&#039;&#039;,&lt;br /&gt;
 &#039;&#039;Title&#039;&#039;,&lt;br /&gt;
 &#039;&#039;URL&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ConsoleVisible || Control visibility of the webdriver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_DownloadFile || Download file and save to disk || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementActionEx || Perform advanced action on desginated element ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementOptionSelect || Find and click on an option from a Select element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementSelectAction || Perform action on designated Select element || Use one of the following commands:&lt;br /&gt;
 &#039;&#039;options&#039;&#039;,&lt;br /&gt;
 &#039;&#039;value&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameEnter || Will enter the specified frame for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameLeave || Will leave the current frame, to its parent, not necessarily the Top, for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementById || Locate element by id ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementByName || Locate element by name ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementFromPoint || Retrieves reference to element descriped by x/y coordinate || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetFrameCount || Returns how many frames/iframes are in your current window/frame || It will not traverse to nested frames&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetMouseElement || Retrieves reference to element below mouse pointer || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetShadowRoot || Retrieve the specified ShadowRoot || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElement || Will highlight the specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElements || Will highlight multiple elements passed as an array || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsLatestRelease || Compares local UDF version to latest release on Github || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsWindowTop || Returns a boolean of the session being at the top level, or in a frame(s) || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LastHTTPResult || Return the result of the last WinHTTP request || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LinkClickByText || Simulate a mouse click on a link with text matching the provided string || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LoadWait || Wait for a browser page load to complete before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_NewTab || Create new tab using Javascript ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Screenshot || Will return a screenshot of the browser window or a specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SelectFiles || Select files for uploading to a website || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetElementValue || ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_SetTimeouts || User friendly function to set webdriver session timeouts ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_UpdateDriver || Replace web driver with newer version, if available || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_WaitElement || Wait for a element to be found  in the current tab before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_jQuerify || Inject jQuery library into current session || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/27)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
==== WinHTTP UDF ====&lt;br /&gt;
Make sure that you are running at least version 1.6.4.2 (currently unreleased, but can be obtained [https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3 here].&lt;br /&gt;
==== Chrome ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugChrome1&amp;quot;&amp;gt;Chrome does not start and the DOS window for chromedriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugChrome1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Chrome and does not display the DOS window for chromedriver.&amp;lt;br&amp;gt;When you manually run the chromedriver in a DOS window you get message &amp;quot;[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied.&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the chrome driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\chromedriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugFirefox1&amp;quot;&amp;gt;Firefox does not start and the DOS window for geckodriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugFirefox1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Firefox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the gecko driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\geckodriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/04/19)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ1&amp;quot;&amp;gt;1. How to connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post] or in the [https://github.com/Danp2/WebDriver/wiki/Connecting-to-existing-browser-instance Github wiki].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ2&amp;quot;&amp;gt;2. How to hide the webdriver console&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I hide the webdriver console?&amp;lt;br&amp;gt;A: The console can be completely hidden from the start by adding the following line near the beginning of your script:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error&amp;lt;/syntaxhighlight&amp;gt;You can also control the visibility of the console with the function _WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ3&amp;quot;&amp;gt;3. How to utilize an existing user profile&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Can I use an existing user profile instead of the default behavior of using a new one?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration, with each browser using a different method to implement. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;:[&amp;quot;--user-data-dir=C:\\Users\\&#039; &amp;amp; @UserName &amp;amp; &#039;\\AppData\\Local\\Google\\Chrome\\User Data\\&amp;quot;, &amp;quot;--profile-directory=Default&amp;quot;]}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;:{&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;moz:firefoxOptions&amp;quot;: {&amp;quot;args&amp;quot;: [&amp;quot;-profile&amp;quot;, &amp;quot;C:/Users/AppData/Roaming/Mozilla/Firefox/Profiles/gbjaumrnd.default&amp;quot;],&amp;quot;log&amp;quot;: {&amp;quot;level&amp;quot;: &amp;quot;trace&amp;quot;}}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ4&amp;quot;&amp;gt;4. How to specify location of browser executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch a browser installed in a non-standard location?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\chrome.exe&amp;quot; }}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;desiredCapabilities&amp;quot;:{&amp;quot;javascriptEnabled&amp;quot;:true,&amp;quot;nativeEvents&amp;quot;:true,&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;moz:firefoxOptions&amp;quot;:{&amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\firefox.exe&amp;quot;}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;Alternate Firefox method:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_Option(&#039;DriverParams&#039;, &#039;--binary &amp;quot;C:\Program Files\Mozilla Firefox\firefox.exe&amp;quot; --log trace &#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ5&amp;quot;&amp;gt;5. How to maximize the browser window&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ5&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to maximize the browser window?&amp;lt;br&amp;gt;A: Simply call the following function:&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Window($sSession, &amp;quot;Maximize&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ6&amp;quot;&amp;gt;6. How to specify location of WebDriver executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ6&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch the WebDriver executable from a specific location?&amp;lt;br&amp;gt;A: This is controlled by function &amp;quot;_WD_Option&amp;quot;. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\local\WebDriver\WebDriver.exe&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ7&amp;quot;&amp;gt;7. How to retrieve the values of a drop-down list&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ7&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How to retrieve the values of a drop-down list (&amp;lt;Select&amp;gt; tag)?&amp;lt;br&amp;gt;A1: Here&#039;s a simple way to do it:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$sText = _WD_ElementAction($sSession, $sElement, &#039;property&#039;, &#039;innerText&#039;)&lt;br /&gt;
$aOptions = StringSplit ( $sText, @LF,  $STR_NOCOUNT)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;xxx&#039; is the name of the drop-down list.&lt;br /&gt;
&amp;lt;br&amp;gt;A2: This can now be accomplished using the function _WD_ElementSelectAction:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$aOptions = _WD_ElementSelectAction ($sSession, $sElement, &#039;options&#039;)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
The following tools will help you to automate your browser:&lt;br /&gt;
* [https://autonomiq.io/chropath/ ChroPath]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Makes finding an element by XPath, ID or CSS incredibly easy (Chrome, Firefox, Opera)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/01)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* AutoIt WebDriver threads:&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019 Example Scripts]&#039;&#039;&#039; forum - WebDriver UDF (W3C compliant version)&lt;br /&gt;
** Danp2&#039;s closed thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/ General Help and Support]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (this is part I)&lt;br /&gt;
** Danp2&#039;s active thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/ General Help and Support II]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (II) &lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201283-im-creating-a-webdriver-tutorial General Help and Support]&#039;&#039;&#039; forum - Discussion about this Wiki Page&lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/ Example Scripts]&#039;&#039;&#039; forum - WebDriver example scripts collection&lt;br /&gt;
&lt;br /&gt;
* WebDriver Exe documentation:&lt;br /&gt;
** [https://sites.google.com/a/chromium.org/chromedriver/ Chrome]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver Edge]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium Edge Chromium]&lt;br /&gt;
** [https://firefox-source-docs.mozilla.org/testing/geckodriver/ Firefox]&lt;br /&gt;
** [https://selenium.dev/documentation/en/webdriver/ Opera]&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14275</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14275"/>
		<updated>2020-04-19T17:46:00Z</updated>

		<summary type="html">&lt;p&gt;Danp2: /* FAQ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WIP}}&lt;br /&gt;
The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/04/16)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF]&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 81.0.4044.69 / 2020.03.17 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 81.0.410.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Firefox || [https://github.com/mozilla/geckodriver/releases github] || 0.26 / 2019.10.12 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases github] || 80.0.3987.100 / 2020.02.25 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status Firefox]&lt;br /&gt;
* [https://github.com/operasoftware/operachromiumdriver Opera]: &amp;quot;&#039;&#039;OperaChromiumDriver is a WebDriver implementation derived from ChromeDriver and adapted by Opera&#039;&#039;&amp;quot;. That&#039;s why I think it has at least the same limitations as ChromeDriver.&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
=== Used Terms ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/08)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
	 &lt;br /&gt;
You will find the following terms when using WebDriver. We try to shed some light onto this subject here:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Marionette&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette consists of two parts: a server which takes requests and executes them in Gecko (the Marionette server ships with Firefox), and a client (the Marionette client ships with the GeckoDriver exe). The client sends commands to the server and the server executes the command inside the browser.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://firefox-source-docs.mozilla.org/testing/marionette/Intro.html visit this site].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ShadowRoot&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The ShadowRoot interface of the Shadow DOM API is the root node of a DOM subtree that is rendered separately from a document&#039;s main DOM tree.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://dom.spec.whatwg.org/#interface-shadowroot visit this site].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/23)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To automate your browser the following installation steps are needed:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory:&lt;br /&gt;
** chromedriver.exe (Chrome)&lt;br /&gt;
** geckodriver.exe (Firefox)&lt;br /&gt;
** msedgedriver.exe (Edge - Chromium) or MicrosoftWebDriver.exe (Edge - EdgeHTML)&lt;br /&gt;
* Run WD_Demo.au3 and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\ ...&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;, ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function reference ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/07 - based on version 0.2.0.6)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WD_CORE ===&lt;br /&gt;
The WD_Core.au3 file holds functions to implement the Webdriver W3C document.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function !! Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Action || Perform various interactions with the web driver session || Use one of the following values for parameter $sCommand: &#039;&#039;refresh&#039;&#039;, &#039;&#039;back&#039;&#039;, &#039;&#039;forward&#039;&#039;, &#039;&#039;url&#039;&#039;, &#039;&#039;title&#039;&#039;, &#039;&#039;actions&#039;&#039;.&amp;lt;br&amp;gt;For command &#039;&#039;actions&#039;&#039;: Pass the actions to be set using parameter $sOption. If $sOption is empty then the set actions will be removed.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Alert || Respond to user prompt || Use one of the following actions to respond to the user prompt: &#039;&#039;dismiss&#039;&#039;, &#039;&#039;accept&#039;&#039;, &#039;&#039;gettext&#039;&#039;, &#039;&#039;sendtext&#039;&#039;, &#039;&#039;status&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Cookies || Gets, sets, or deletes the session&#039;s cookies || Gets a single (command &#039;&#039;get&#039;&#039;) or all (command &#039;&#039;getall&#039;&#039;) cookies, &#039;&#039;adds&#039;&#039; or &#039;&#039;delete&#039;&#039;s a single cookie &lt;br /&gt;
|-&lt;br /&gt;
| _WD_CreateSession|| Request new session from web driver || Define the capabilities of the browser with this function&lt;br /&gt;
|-&lt;br /&gt;
| _WD_DeleteSession || Delete existing session || Closes the session created by _WD_CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementAction || Perform action on designated element || Use one of the following actions: &#039;&#039;Name&#039;&#039;, &#039;&#039;Rect&#039;&#039;, &#039;&#039;Text&#039;&#039;, &#039;&#039;Selected&#039;&#039;, &#039;&#039;Enabled&#039;&#039;, &#039;&#039;Displayed&#039;&#039;, &#039;&#039;Active&#039;&#039;, &#039;&#039;Attribute&#039;&#039;, &#039;&#039;Property&#039;&#039;, &#039;&#039;CSS&#039;&#039;, &#039;&#039;Clear&#039;&#039;, &#039;&#039;Click&#039;&#039;, &#039;&#039;Value&#039;&#039;, &#039;&#039;Screenshot&#039;&#039;.&amp;lt;br&amp;gt;&#039;&#039;Clear&#039;&#039;, &#039;&#039;Click&#039;&#039; and &#039;&#039;Value&#039;&#039; use POST to modify or process the element. All other actions use GET to retrieve data from the element&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteScript || Execute Javascipt commands || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FindElement|| Find element(s) by designated strategy || You can specify whether the function should only return the first find or all of them&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetSource || Get page source || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Navigate || Navigate to the designated URL || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Option || Sets and get options for the web driver UDF || The following options can be used: &#039;&#039;Driver&#039;&#039; (set the full path name to web driver executable), &#039;&#039;DriverParams&#039;&#039; (parameters to pass to web driver executable), &#039;&#039;BaseURL&#039;&#039; (IP address used for web driver communication), &#039;&#039;Port&#039;&#039; (port used for web driver communication), &#039;&#039;BinaryFormat&#039;&#039; (format used to store binary data). If no value is passed to be set the current value is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Shutdown || Kill the web driver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Startup || Launch the designated web driver console app || The PID for the WD console is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Status || Get current web driver state || Returns a raw JSON response from the web driver&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Timeouts || Set or retrieve the session timeout parameters || Specify the type and value of the timeout like this: &#039;{&amp;quot;type&amp;quot;:value}&#039;. Example: &#039;{&amp;quot;pageLoad&amp;quot;:2000}&#039;&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Window || Perform interactions related to the current window || One of the following actions: &#039;&#039;window&#039;&#039; (get current tab&#039;s window handle), &#039;&#039;handles&#039;&#039; (get all window handles), &#039;&#039;maximize&#039;&#039; (maximize window), &#039;&#039;minimize&#039;&#039; (minimize window), &#039;&#039;fullscreen&#039;&#039; (set window to fullscreen), &#039;&#039;rect&#039;&#039; (get or set the window&#039;s size &amp;amp; position), &#039;&#039;screenshot&#039;&#039; (take screenshot of window), &#039;&#039;close&#039;&#039; (close current tab), &#039;&#039;switch&#039;&#039; (switch to designated tab), &#039;&#039;frame&#039;&#039; (switch to frame), &#039;&#039;parent&#039;&#039; (switch to parent frame)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== WD_HELPER ===&lt;br /&gt;
The WD_Helper.au3 file holds functions to help you automate a web site.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function !! Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Attach || Attach to existing browser tab || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ConsoleVisible || Control visibility of the webdriver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_DownloadFile || Download file and save to disk || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementOptionSelect || Find and click on an option from a Select element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameEnter || Will enter the specified frame for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameLeave || Will leave the current frame, to its parent, not necessarily the Top, for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementFromPoint || Retrieves reference to element descriped by x/y coordinate || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetFrameCount || Returns how many frames/iframes are in your current window/frame || It will not traverse to nested frames&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetMouseElement || Retrieves reference to element below mouse pointer || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetShadowRoot ||  || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElement || Will highlight the specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElements || Will highlight multiple elements passed as an array || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsLatestRelease || Compares local UDF version to latest release on Github || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsWindowTop || Returns a boolean of the session being at the top level, or in a frame(s) || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LastHTTPResult || Return the result of the last WinHTTP request || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LinkClickByText || Simulate a mouse click on a link with text matching the provided string || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LoadWait || Wait for a browser page load to complete before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_NewTab || Create new tab using Javascript ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Screenshot || Will return a screenshot of the browser window or a specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SelectFiles || Select files for uploading to a website || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_UpdateDriver || Replace web driver with newer version, if available || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_WaitElement || Wait for a element to be found  in the current tab before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_jQuerify || Inject jQuery library into current session || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/27)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Chrome ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugChrome1&amp;quot;&amp;gt;Chrome does not start and the DOS window for chromedriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugChrome1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Chrome and does not display the DOS window for chromedriver.&amp;lt;br&amp;gt;When you manually run the chromedriver in a DOS window you get message &amp;quot;[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied.&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the chrome driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\chromedriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugFirefox1&amp;quot;&amp;gt;Firefox does not start and the DOS window for geckodriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugFirefox1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Firefox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the gecko driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\geckodriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/03/01)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ1&amp;quot;&amp;gt;1. How to connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post] or in the [https://github.com/Danp2/WebDriver/wiki/Connecting-to-existing-browser-instance Github wiki].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ2&amp;quot;&amp;gt;2. How to hide the webdriver console&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I hide the webdriver console?&amp;lt;br&amp;gt;A: The console can be completely hidden from the start by adding the following line near the beginning of your script:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error&amp;lt;/syntaxhighlight&amp;gt;You can also control the visibility of the console with the function _WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ3&amp;quot;&amp;gt;3. How to utilize an existing user profile&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Can I use an existing user profile instead of the default behavior of using a new one?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration, with each browser using a different method to implement. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;:[&amp;quot;--user-data-dir=C:\\Users\\&#039; &amp;amp; @UserName &amp;amp; &#039;\\AppData\\Local\\Google\\Chrome\\User Data\\&amp;quot;, &amp;quot;--profile-directory=Default&amp;quot;]}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;:{&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;moz:firefoxOptions&amp;quot;: {&amp;quot;args&amp;quot;: [&amp;quot;-profile&amp;quot;, &amp;quot;C:/Users/AppData/Roaming/Mozilla/Firefox/Profiles/gbjaumrnd.default&amp;quot;],&amp;quot;log&amp;quot;: {&amp;quot;level&amp;quot;: &amp;quot;trace&amp;quot;}}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ4&amp;quot;&amp;gt;4. How to specify location of browser executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch a browser installed in a non-standard location?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration. Here are some examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\chrome.exe&amp;quot; }}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;desiredCapabilities&amp;quot;:{&amp;quot;javascriptEnabled&amp;quot;:true,&amp;quot;nativeEvents&amp;quot;:true,&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;moz:firefoxOptions&amp;quot;:{&amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\firefox.exe&amp;quot;}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;Alternate Firefox method:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_Option(&#039;DriverParams&#039;, &#039;--binary &amp;quot;C:\Program Files\Mozilla Firefox\firefox.exe&amp;quot; --log trace &#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ5&amp;quot;&amp;gt;5. How to maximize the browser window&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ5&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to maximize the browser window?&amp;lt;br&amp;gt;A: Simply call the following function:&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Window($sSession, &amp;quot;Maximize&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ6&amp;quot;&amp;gt;6. How to specify location of WebDriver executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ6&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch the WebDriver executable from a specific location?&amp;lt;br&amp;gt;A: This is controlled by function &amp;quot;_WD_Option&amp;quot;. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\local\WebDriver\WebDriver.exe&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ7&amp;quot;&amp;gt;7. How to retrieve the values of a drop-down list&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ7&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How to retrieve the values of a drop-down list (&amp;lt;Select&amp;gt; tag)?&amp;lt;br&amp;gt;A1: Here&#039;s a simple way to do it:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$sText = _WD_ElementAction($sSession, $sElement, &#039;property&#039;, &#039;innerText&#039;)&lt;br /&gt;
$aOptions = StringSplit ( $sText, @LF,  $STR_NOCOUNT)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;xxx&#039; is the name of the drop-down list.&lt;br /&gt;
&amp;lt;br&amp;gt;A2: This can now be accomplished using the function _WD_ElementSelectAction --&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, &amp;quot;//select[@name=&#039;xxx&#039;]&amp;quot;)&lt;br /&gt;
$aOptions = _WD_ElementSelectAction ($sSession, $sElement, &#039;options&#039;)&lt;br /&gt;
_ArrayDisplay($aOptions)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
The following tools will help you to automate your browser:&lt;br /&gt;
* [https://autonomiq.io/chropath/ ChroPath]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Makes finding an element by XPath, ID or CSS incredibly easy (Chrome, Firefox, Opera)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* AutoIt WebDriver threads:&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019 Example Scripts]&#039;&#039;&#039; forum - WebDriver UDF (W3C compliant version)&lt;br /&gt;
** Danp2&#039;s closed thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/ General Help and Support]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (this is part I)&lt;br /&gt;
** Danp2&#039;s active thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/ General Help and Support II]&#039;&#039;&#039; forum - WebDriver UDF - Help &amp;amp; Support (II) &lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201283-im-creating-a-webdriver-tutorial General Help and Support]&#039;&#039;&#039; forum - Discussion about this Wiki Page&lt;br /&gt;
** Water&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/ Example Scripts]&#039;&#039;&#039; forum - WebDriver example scripts collection&lt;br /&gt;
&lt;br /&gt;
* WebDriver Exe documentation:&lt;br /&gt;
** [https://sites.google.com/a/chromium.org/chromedriver/ Chrome]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver Edge]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium Edge Chromium]&lt;br /&gt;
** [https://firefox-source-docs.mozilla.org/testing/geckodriver/ Firefox]&lt;br /&gt;
** [https://selenium.dev/documentation/en/webdriver/ Opera]&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14244</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14244"/>
		<updated>2020-02-22T01:56:45Z</updated>

		<summary type="html">&lt;p&gt;Danp2: /* FAQ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WIP}}&lt;br /&gt;
The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/25)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF]&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 80.0.3987.16 / 2019.12.19 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 81.0.403.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Firefox || [https://github.com/mozilla/geckodriver/releases github] || 0.26 / 2019.10.12 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases github] || 79.0.3945.79 - 2020.01.08 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status Firefox]&lt;br /&gt;
* [https://github.com/operasoftware/operachromiumdriver Opera]: &amp;quot;&#039;&#039;OperaChromiumDriver is a WebDriver implementation derived from ChromeDriver and adapted by Opera&#039;&#039;&amp;quot;. That&#039;s why I think it has at least the same limitations as the chromedriver.&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
=== Used Terms ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/03)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
	 &lt;br /&gt;
You will find the following terms when using WebDriver. We try to shed some light onto this subject here:&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&#039;&#039;&#039;Marionette&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette consists of two parts: a server which takes requests and executes them in Gecko (the Marionette server ships with Firefox), and a client (the Marionette client ships with the GeckoDriver exe). The client sends commands to the server and the server executes the command inside the browser.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://firefox-source-docs.mozilla.org/testing/marionette/Intro.html visit this site].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/23)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To automate your browser the following installation steps are needed:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory:&lt;br /&gt;
** chromedriver.exe (Chrome)&lt;br /&gt;
** geckodriver.exe (Firefox)&lt;br /&gt;
** msedgedriver.exe (Edge - Chromium) or MicrosoftWebDriver.exe (Edge - EdgeHTML)&lt;br /&gt;
* Run WD_Demo.au3 and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\ ...&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;, ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function reference ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/27 - based on version 0.2.0.5)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WD_CORE ===&lt;br /&gt;
The WD_Core.au3 file holds functions to implement the Webdriver W3C document.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function !! Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Action || Perform various interactions with the web driver session || Use one of the following values for parameter $sCommand: &#039;&#039;refresh&#039;&#039;, &#039;&#039;back&#039;&#039;, &#039;&#039;forward&#039;&#039;, &#039;&#039;url&#039;&#039;, &#039;&#039;title&#039;&#039;, &#039;&#039;actions&#039;&#039;.&amp;lt;br&amp;gt;For command &#039;&#039;actions&#039;&#039;: Pass the actions to be set using parameter $sOption. If $sOption is empty then the set actions will be removed.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Alert || Respond to user prompt || Use one of the following actions to respond to the user prompt: &#039;&#039;dismiss&#039;&#039;, &#039;&#039;accept&#039;&#039;, &#039;&#039;gettext&#039;&#039;, &#039;&#039;sendtext&#039;&#039;, &#039;&#039;status&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Cookies || Gets, sets, or deletes the session&#039;s cookies || Gets a single (command &#039;&#039;get&#039;&#039;) or all (command &#039;&#039;getall&#039;&#039;) cookies, &#039;&#039;adds&#039;&#039; or &#039;&#039;delete&#039;&#039;s a single cookie &lt;br /&gt;
|-&lt;br /&gt;
| _WD_CreateSession|| Request new session from web driver || Define the capabilities of the browser with this function&lt;br /&gt;
|-&lt;br /&gt;
| _WD_DeleteSession || Delete existing session || Closes the session created by _WD_CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementAction || Perform action on designated element || Use one of the following actions: &#039;&#039;Name&#039;&#039;, &#039;&#039;Rect&#039;&#039;, &#039;&#039;Text&#039;&#039;, &#039;&#039;Selected&#039;&#039;, &#039;&#039;Enabled&#039;&#039;, &#039;&#039;Displayed&#039;&#039;, &#039;&#039;Active&#039;&#039;, &#039;&#039;Attribute&#039;&#039;, &#039;&#039;Property&#039;&#039;, &#039;&#039;CSS&#039;&#039;, &#039;&#039;Clear&#039;&#039;, &#039;&#039;Click&#039;&#039;, &#039;&#039;Value&#039;&#039;, &#039;&#039;Screenshot&#039;&#039;.&amp;lt;br&amp;gt;&#039;&#039;Clear&#039;&#039;, &#039;&#039;Click&#039;&#039; and &#039;&#039;Value&#039;&#039; use POST to modify or process the element. All other actions use GET to retrieve data from the element&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteScript || Execute Javascipt commands || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FindElement|| Find element(s) by designated strategy || You can specify whether the function should only return the first find or all of them&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetSource || Get page source || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Navigate || Navigate to the designated URL || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Option || Sets and get options for the web driver UDF || The following options can be used: &#039;&#039;Driver&#039;&#039; (set the full path name to web driver executable), &#039;&#039;DriverParams&#039;&#039; (parameters to pass to web driver executable), &#039;&#039;BaseURL&#039;&#039; (IP address used for web driver communication), &#039;&#039;Port&#039;&#039; (port used for web driver communication), &#039;&#039;BinaryFormat&#039;&#039; (format used to store binary data). If no value is passed to be set the current value is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Shutdown || Kill the web driver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Startup || Launch the designated web driver console app || The PID for the WD console is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Status || Get current web driver state || Returns a raw JSON response from the web driver&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Timeouts || Set or retrieve the session timeout parameters || Specify the type and value of the timeout like this: &#039;{&amp;quot;type&amp;quot;:value}&#039;. Example: &#039;{&amp;quot;pageLoad&amp;quot;:2000}&#039;&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Window || Perform interactions related to the current window || One of the following actions: &#039;&#039;window&#039;&#039; (get current tab&#039;s window handle), &#039;&#039;handles&#039;&#039; (get all window handles), &#039;&#039;maximize&#039;&#039; (maximize window), &#039;&#039;minimize&#039;&#039; (minimize window), &#039;&#039;fullscreen&#039;&#039; (set window to fullscreen), &#039;&#039;rect&#039;&#039; (get or set the window&#039;s size &amp;amp; position), &#039;&#039;screenshot&#039;&#039; (take screenshot of window), &#039;&#039;close&#039;&#039; (close current tab), &#039;&#039;switch&#039;&#039; (switch to designated tab), &#039;&#039;frame&#039;&#039; (switch to frame), &#039;&#039;parent&#039;&#039; (switch to parent frame)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== WD_HELPER ===&lt;br /&gt;
The WD_Helper.au3 file holds functions to help you automate a web site.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function !! Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Attach || Attach to existing browser tab || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ConsoleVisible || Control visibility of the webdriver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_DownloadFile || Download file and save to disk || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementOptionSelect || Find and click on an option from a Select element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameEnter || Will enter the specified frame for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameLeave || Will leave the current frame, to its parent, not necessarily the Top, for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementFromPoint || Retrieves reference to element descriped by x/y coordinate || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetFrameCount || Returns how many frames/iframes are in your current window/frame || It will not traverse to nested frames&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetMouseElement || Retrieves reference to element below mouse pointer || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetShadowRoot ||  || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElement || Will highlight the specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElements || Will highlight multiple elements passed as an array || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsLatestRelease || Compares local UDF version to latest release on Github || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsWindowTop || Returns a boolean of the session being at the top level, or in a frame(s) || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LastHTTPResult || Return the result of the last WinHTTP request || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LinkClickByText || Simulate a mouse click on a link with text matching the provided string || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LoadWait || Wait for a browser page load to complete before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_NewTab || Create new tab using Javascript ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Screenshot || Will return a screenshot of the browser window or a specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SelectFiles ||  || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_UpdateDriver || Replace web driver with newer version, if available || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_WaitElement || Wait for a element to be found  in the current tab before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_jQuerify || Inject jQuery library into current session || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/27)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Chrome ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugChrome1&amp;quot;&amp;gt;Chrome does not start and the DOS window for chromedriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugChrome1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Chrome and does not display the DOS window for chromedriver.&amp;lt;br&amp;gt;When you manually run the chromedriver in a DOS window you get message &amp;quot;[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied.&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the chrome driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\chromedriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugFirefox1&amp;quot;&amp;gt;Firefox does not start and the DOS window for geckodriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugFirefox1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Firefox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the gecko driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\geckodriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/02/17)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ1&amp;quot;&amp;gt;How to connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post] or in the [https://github.com/Danp2/WebDriver/wiki/Connecting-to-existing-browser-instance Github wiki].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ2&amp;quot;&amp;gt;How to hide the webdriver console&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I hide the webdriver console?&amp;lt;br&amp;gt;A: The console can be completely hidden from the start by adding the following line near the beginning of your script:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error&amp;lt;/syntaxhighlight&amp;gt;You can also control the visibility of the console with the function _WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ3&amp;quot;&amp;gt;How to utilize an existing user profile&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Can I use an existing user profile instead of the default behavior of using a new one?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration, with each browser using a different method to implement. Here are some examples --&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;:[&amp;quot;--user-data-dir=C:\\Users\\&#039; &amp;amp; @UserName &amp;amp; &#039;\\AppData\\Local\\Google\\Chrome\\User Data\\&amp;quot;, &amp;quot;--profile-directory=Default&amp;quot;]}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;:{&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;moz:firefoxOptions&amp;quot;: {&amp;quot;args&amp;quot;: [&amp;quot;-profile&amp;quot;, &amp;quot;C:/Users/AppData/Roaming/Mozilla/Firefox/Profiles/gbjaumrnd.default&amp;quot;],&amp;quot;log&amp;quot;: {&amp;quot;level&amp;quot;: &amp;quot;trace&amp;quot;}}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ4&amp;quot;&amp;gt;How to specify location of browser executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch a browser installed in a non-standard location?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration. Here are some examples --&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\chrome.exe&amp;quot; }}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;desiredCapabilities&amp;quot;:{&amp;quot;javascriptEnabled&amp;quot;:true,&amp;quot;nativeEvents&amp;quot;:true,&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;moz:firefoxOptions&amp;quot;:{&amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\firefox.exe&amp;quot;}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;Alternate Firefox method --&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_Option(&#039;DriverParams&#039;, &#039;--binary &amp;quot;C:\Program Files\Mozilla Firefox\firefox.exe&amp;quot; --log trace &#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ5&amp;quot;&amp;gt;How to maximize the browser window&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ5&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to maximize the browser window?&amp;lt;br&amp;gt;A: Simply call the following function:&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Window($sSession, &amp;quot;Maximize&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ6&amp;quot;&amp;gt;How to specify location of WebDriver executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ6&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch the WebDriver executable from a specific location?&amp;lt;br&amp;gt;A: This is controlled by function &amp;quot;_WD_Option&amp;quot;. Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\local\WebDriver\WebDriver.exe&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
The following tools will help you to automate your browser:&lt;br /&gt;
* [https://autonomiq.io/chropath/ ChroPath]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Makes finding an element by XPath, ID or CSS incredibly easy (Chrome, Firefox, Opera)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* AutoIt WebDriver threads:&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019 Example Scripts]&#039;&#039;&#039; forum&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/ General Help and Support]&#039;&#039;&#039; forum&lt;br /&gt;
** WebDriver &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/ Example Scripts Collection]&#039;&#039;&#039;&lt;br /&gt;
* WebDriver Exe documentation&lt;br /&gt;
** [https://sites.google.com/a/chromium.org/chromedriver/ Chrome]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver Edge]&lt;br /&gt;
** [https://firefox-source-docs.mozilla.org/testing/geckodriver/ Firefox]&lt;br /&gt;
** [https://selenium.dev/documentation/en/webdriver/ Opera]&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14236</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14236"/>
		<updated>2020-01-28T16:23:18Z</updated>

		<summary type="html">&lt;p&gt;Danp2: /* FAQ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WIP}}&lt;br /&gt;
The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/25)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF]&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 80.0.3987.16 / 2019.12.19 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 81.0.403.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Firefox || [https://github.com/mozilla/geckodriver/releases github] || 0.26 / 2019.10.12 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases github] || 79.0.3945.79 - 2020.01.08 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status Firefox]&lt;br /&gt;
* [https://github.com/operasoftware/operachromiumdriver Opera]: &amp;quot;&#039;&#039;OperaChromiumDriver is a WebDriver implementation derived from ChromeDriver and adapted by Opera&#039;&#039;&amp;quot;. That&#039;s why I think it has at least the same limitations as the chromedriver.&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
=== Used Terms ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/03)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
	 &lt;br /&gt;
You will find the following terms when using WebDriver. We try to shed some light onto this subject here:&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&#039;&#039;&#039;Marionette&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette consists of two parts: a server which takes requests and executes them in Gecko (the Marionette server ships with Firefox), and a client (the Marionette client ships with the GeckoDriver exe). The client sends commands to the server and the server executes the command inside the browser.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://firefox-source-docs.mozilla.org/testing/marionette/Intro.html visit this site].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/23)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To automate your browser the following installation steps are needed:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory:&lt;br /&gt;
** chromedriver.exe (Chrome)&lt;br /&gt;
** geckodriver.exe (Firefox)&lt;br /&gt;
** msedgedriver.exe (Edge - Chromium) or MicrosoftWebDriver.exe (Edge - EdgeHTML)&lt;br /&gt;
* Run WD_Demo.au3 and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\ ...&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;, ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function reference ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/27 - based on version 0.2.0.5)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WD_CORE ===&lt;br /&gt;
The WD_Core.au3 file holds functions to implement the Webdriver W3C document.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function !! Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Action || Perform various interactions with the web driver session || Use one of the following values for parameter $sCommand: &#039;&#039;refresh&#039;&#039;, &#039;&#039;back&#039;&#039;, &#039;&#039;forward&#039;&#039;, &#039;&#039;url&#039;&#039;, &#039;&#039;title&#039;&#039;, &#039;&#039;actions&#039;&#039;.&amp;lt;br&amp;gt;For command &#039;&#039;actions&#039;&#039;: Pass the actions to be set using parameter $sOption. If $sOption is empty then the set actions will be removed.&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Alert || Respond to user prompt || Use one of the following actions to respond to the user prompt: &#039;&#039;dismiss&#039;&#039;, &#039;&#039;accept&#039;&#039;, &#039;&#039;gettext&#039;&#039;, &#039;&#039;sendtext&#039;&#039;, &#039;&#039;status&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Cookies || Gets, sets, or deletes the session&#039;s cookies || Gets a single (command &#039;&#039;get&#039;&#039;) or all (command &#039;&#039;getall&#039;&#039;) cookies, &#039;&#039;adds&#039;&#039; or &#039;&#039;delete&#039;&#039;s a single cookie &lt;br /&gt;
|-&lt;br /&gt;
| _WD_CreateSession|| Request new session from web driver || Define the capabilities of the browser with this function&lt;br /&gt;
|-&lt;br /&gt;
| _WD_DeleteSession || Delete existing session || Closes the session created by _WD_CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementAction || Perform action on designated element || Use one of the following actions: &#039;&#039;Name&#039;&#039;, &#039;&#039;Rect&#039;&#039;, &#039;&#039;Text&#039;&#039;, &#039;&#039;Selected&#039;&#039;, &#039;&#039;Enabled&#039;&#039;, &#039;&#039;Displayed&#039;&#039;, &#039;&#039;Active&#039;&#039;, &#039;&#039;Attribute&#039;&#039;, &#039;&#039;Property&#039;&#039;, &#039;&#039;CSS&#039;&#039;, &#039;&#039;Clear&#039;&#039;, &#039;&#039;Click&#039;&#039;, &#039;&#039;Value&#039;&#039;, &#039;&#039;Screenshot&#039;&#039;.&amp;lt;br&amp;gt;&#039;&#039;Clear&#039;&#039;, &#039;&#039;Click&#039;&#039; and &#039;&#039;Value&#039;&#039; use POST to modify or process the element. All other actions use GET to retrieve data from the element&lt;br /&gt;
|-&lt;br /&gt;
| _WD_ExecuteScript || Execute Javascipt commands || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FindElement|| Find element(s) by designated strategy || You can specify whether the function should only return the first find or all of them&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetSource || Get page source || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Navigate || Navigate to the designated URL || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Option || Sets and get options for the web driver UDF || The following options can be used: &#039;&#039;Driver&#039;&#039; (set the full path name to web driver executable), &#039;&#039;DriverParams&#039;&#039; (parameters to pass to web driver executable), &#039;&#039;BaseURL&#039;&#039; (IP address used for web driver communication), &#039;&#039;Port&#039;&#039; (port used for web driver communication), &#039;&#039;BinaryFormat&#039;&#039; (format used to store binary data). If no value is passed to be set the current value is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Shutdown || Kill the web driver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_Startup || Launch the designated web driver console app || The PID for the WD console is returned&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Status || Get current web driver state || Returns a raw JSON response from the web driver&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Timeouts || Set or retrieve the session timeout parameters || Specify the type and value of the timeout like this: &#039;{&amp;quot;type&amp;quot;:value}&#039;. Example: &#039;{&amp;quot;pageLoad&amp;quot;:2000}&#039;&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Window || Perform interactions related to the current window || One of the following actions: &#039;&#039;window&#039;&#039; (get current tab&#039;s window handle), &#039;&#039;handles&#039;&#039; (get all window handles), &#039;&#039;maximize&#039;&#039; (maximize window), &#039;&#039;minimize&#039;&#039; (minimize window), &#039;&#039;fullscreen&#039;&#039; (set window to fullscreen), &#039;&#039;rect&#039;&#039; (get or set the window&#039;s size &amp;amp; position), &#039;&#039;screenshot&#039;&#039; (take screenshot of window), &#039;&#039;close&#039;&#039; (close current tab), &#039;&#039;switch&#039;&#039; (switch to designated tab), &#039;&#039;frame&#039;&#039; (switch to frame), &#039;&#039;parent&#039;&#039; (switch to parent frame)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== WD_HELPER ===&lt;br /&gt;
The WD_Helper.au3 file holds functions to help you automate a web site.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function !! Description !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Attach || Attach to existing browser tab || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ConsoleVisible || Control visibility of the webdriver console app || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_DownloadFile || Download file and save to disk || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_ElementOptionSelect || Find and click on an option from a Select element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameEnter || Will enter the specified frame for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_FrameLeave || Will leave the current frame, to its parent, not necessarily the Top, for subsequent WebDriver operations || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetElementFromPoint || Retrieves reference to element descriped by x/y coordinate || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetFrameCount || Returns how many frames/iframes are in your current window/frame || It will not traverse to nested frames&lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetMouseElement || Retrieves reference to element below mouse pointer || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_GetShadowRoot ||  || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElement || Will highlight the specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_HighlightElements || Will highlight multiple elements passed as an array || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsLatestRelease || Compares local UDF version to latest release on Github || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_IsWindowTop || Returns a boolean of the session being at the top level, or in a frame(s) || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LastHTTPResult || Return the result of the last WinHTTP request || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LinkClickByText || Simulate a mouse click on a link with text matching the provided string || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_LoadWait || Wait for a browser page load to complete before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_NewTab || Create new tab using Javascript ||&lt;br /&gt;
|-&lt;br /&gt;
| _WD_Screenshot || Will return a screenshot of the browser window or a specified element || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_SelectFiles ||  || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_UpdateDriver || Replace web driver with newer version, if available || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_WaitElement || Wait for a element to be found  in the current tab before returning || &lt;br /&gt;
|-&lt;br /&gt;
| _WD_jQuerify || Inject jQuery library into current session || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/27)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Chrome ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugChrome1&amp;quot;&amp;gt;Chrome does not start and the DOS window for chromedriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugChrome1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Chrome and does not display the DOS window for chromedriver.&amp;lt;br&amp;gt;When you manually run the chromedriver in a DOS window you get message &amp;quot;[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied.&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the chrome driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\chromedriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-DebugFirefox1&amp;quot;&amp;gt;Firefox does not start and the DOS window for geckodriver does not get displayed&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-DebugFirefox1&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| When running WD_Demo.au3 it does not start up Firefox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| This could be caused by missing execution permission for the network drive. Please ask your IT admin for &amp;quot;Applocker&amp;quot; or &amp;quot;application directory whitelisting&amp;quot;. &amp;lt;br&amp;gt;Or run the gecko driver from a local HDD and call _WD_Option to set the location of the webdriver executable. Example: _WD_Option(&amp;quot;Driver&amp;quot;, &amp;quot;C:\Local\WebDriver\geckodriver.exe&amp;quot;) || [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/16)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ1&amp;quot;&amp;gt;How to connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post] or in the [https://github.com/Danp2/WebDriver/wiki/Connecting-to-existing-browser-instance Github wiki].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ2&amp;quot;&amp;gt;How to hide the webdriver console&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I hide the webdriver console?&amp;lt;br&amp;gt;A: The console can be completely hidden from the start by adding the following line near the beginning of your script:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error&amp;lt;/syntaxhighlight&amp;gt;You can also control the visibility of the console with the function _WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ3&amp;quot;&amp;gt;How to utilize an existing user profile&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Can I use an existing user profile instead of the default behavior of using a new one?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration, with each browser using a different method to implement. Here are some examples --&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;:[&amp;quot;--user-data-dir=C:\\Users\\&#039; &amp;amp; @UserName &amp;amp; &#039;\\AppData\\Local\\Google\\Chrome\\User Data\\&amp;quot;, &amp;quot;--profile-directory=Default&amp;quot;]}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;:{&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;moz:firefoxOptions&amp;quot;: {&amp;quot;args&amp;quot;: [&amp;quot;-profile&amp;quot;, &amp;quot;C:/Users/AppData/Roaming/Mozilla/Firefox/Profiles/gbjaumrnd.default&amp;quot;],&amp;quot;log&amp;quot;: {&amp;quot;level&amp;quot;: &amp;quot;trace&amp;quot;}}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ4&amp;quot;&amp;gt;How to specify location of browser executable&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Is it possible to launch a browser installed in a non-standard location?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration. Here are some examples --&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\chrome.exe&amp;quot; }}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;desiredCapabilities&amp;quot;:{&amp;quot;javascriptEnabled&amp;quot;:true,&amp;quot;nativeEvents&amp;quot;:true,&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;moz:firefoxOptions&amp;quot;:{&amp;quot;binary&amp;quot;:&amp;quot;C:\\Path\\To\\Alternate\\Browser\\firefox.exe&amp;quot;}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;Alternate Firefox method --&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_Option(&#039;DriverParams&#039;, &#039;--binary &amp;quot;C:\Program Files\Mozilla Firefox\firefox.exe&amp;quot; --log trace &#039;)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
The following tools will help you to automate your browser:&lt;br /&gt;
* [https://autonomiq.io/chropath/ ChroPath]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Makes finding an element by XPath, ID or CSS incredibly easy (Chrome, Firefox, Opera)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/28)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* AutoIt WebDriver threads:&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019 Example Scripts]&#039;&#039;&#039; forum&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/ General Help and Support]&#039;&#039;&#039; forum&lt;br /&gt;
** WebDriver &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/ Example Scripts Collection]&#039;&#039;&#039;&lt;br /&gt;
* WebDriver Exe documentation&lt;br /&gt;
** [https://sites.google.com/a/chromium.org/chromedriver/ Chrome]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver Edge]&lt;br /&gt;
** [https://firefox-source-docs.mozilla.org/testing/geckodriver/ Firefox]&lt;br /&gt;
** [https://selenium.dev/documentation/en/webdriver/ Opera]&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14203</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14203"/>
		<updated>2020-01-09T23:56:06Z</updated>

		<summary type="html">&lt;p&gt;Danp2: /* FAQ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WIP}}&lt;br /&gt;
The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2019/12/29)&amp;lt;/small&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF]&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 80.0.3987.16 / 2019.12.19 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 81.0.370.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Firefox || [https://github.com/mozilla/geckodriver/releases github] || 0.26 / 2019.10.12 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Internet Explorer || [https://www.microsoft.com/en-us/download/details.aspx?id=44069 Microsoft] ||  || &lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases github] || 78.0.3904.87 - 2019.11.14 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status Firefox]&lt;br /&gt;
* [tbd: Opera]&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
=== Used Terms ===&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/03)&amp;lt;/small&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
	 &lt;br /&gt;
You will find the following terms when using WebDriver. We try to shed some light onto this subject here:&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&#039;&#039;&#039;Marionette&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette consists of two parts: a server which takes requests and executes them in Gecko (the Marionette server ships with Firefox), and a client (the Marionette client ships with the GeckoDriver exe). The client sends commands to the server and the server executes the command inside the browser.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://firefox-source-docs.mozilla.org/testing/marionette/Intro.html visit this site].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/04)&amp;lt;/small&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following steps are needed to install everything you need to automate your browser:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory:&lt;br /&gt;
** chromedriver.exe (Chrome)&lt;br /&gt;
** geckodriver.exe (Firefox)&lt;br /&gt;
** msedgedriver.exe (Edge - Chromium) or MicrosoftWebDriver.exe (Edge - EdgeHTML)&lt;br /&gt;
* Run the installation test script (WD_Demo.au3) and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\Users\\xy\\AppData\\Local\\Temp\\rust_mozprofileaWURpD&amp;quot;&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:{&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;,&amp;quot;browserVersion&amp;quot;:&amp;quot;71.0&amp;quot;,&amp;quot;moz:accessibilityChecks&amp;quot;:false,&amp;quot;moz:buildID&amp;quot;:&amp;quot;20191202093317&amp;quot;,&amp;quot;moz:geckodriverVersion&amp;quot;:&amp;quot;0.26.0&amp;quot;,&amp;quot;moz:headless&amp;quot;:false,&amp;quot;moz:processID&amp;quot;:50220,&amp;quot;moz:profile&amp;quot;:&amp;quot;C:\\Users\\xy\\AppData\\Local\\Temp\\rust_mozprofileaWURpD&amp;quot;,&amp;quot;moz:shutdownTimeout&amp;quot;:60000,&amp;quot;moz:useNonSpecCompliantPointerOrigin&amp;quot;:false,&amp;quot;moz:webdriverClick&amp;quot;:true,&amp;quot;pageLoadStrategy&amp;quot;:&amp;quot;normal&amp;quot;,&amp;quot;platformName&amp;quot;:&amp;quot;windows&amp;quot;,&amp;quot;platformVersion&amp;quot;:&amp;quot;10.0&amp;quot;,&amp;quot;rotatable&amp;quot;:false,&amp;quot;setWindowRect&amp;quot;:true,&amp;quot;strictFileInteractability&amp;quot;:false,&amp;quot;timeouts&amp;quot;:{&amp;quot;implicit&amp;quot;:0,&amp;quot;pageLoad&amp;quot;:300000,&amp;quot;script&amp;quot;:30000},&amp;quot;unhandledPromptBehavior&amp;quot;:&amp;quot;dismiss and notify&amp;quot;}}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2019/12/28)&amp;lt;/small&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| The installation testing script does not start up Firefox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| Run the gecko driver from a local HDD.|| [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2020/01/08)&amp;lt;/small&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ1&amp;quot;&amp;gt;How to connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post] or in the [https://github.com/Danp2/WebDriver/wiki/Connecting-to-existing-browser-instance Github wiki].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ2&amp;quot;&amp;gt;How to hide the webdriver console&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I hide the webdriver console?&amp;lt;br&amp;gt;A: The console can be completely hidden from the start by adding the following line near the beginning of your script:&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error&amp;lt;/syntaxhighlight&amp;gt;You can also control the visibility of the console with the function _WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ3&amp;quot;&amp;gt;How to utilize an existing user profile&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: Can I use an existing user profile instead of the default behavior of using a new one?&amp;lt;br&amp;gt;A: This is controlled by your &amp;quot;capabilities&amp;quot; declaration, with each browser using a different method to implement. Here are some examples --&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Chrome&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;goog:chromeOptions&amp;quot;: {&amp;quot;w3c&amp;quot;: true, &amp;quot;args&amp;quot;:[&amp;quot;--user-data-dir=C:\\Users\\&#039; &amp;amp; @UserName &amp;amp; &#039;\\AppData\\Local\\Google\\Chrome\\User Data\\&amp;quot;, &amp;quot;--profile-directory=Default&amp;quot;]}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Firefox&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$sDesiredCapabilities = &#039;{&amp;quot;capabilities&amp;quot;:{&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;moz:firefoxOptions&amp;quot;: {&amp;quot;args&amp;quot;: [&amp;quot;-profile&amp;quot;, &amp;quot;C:/Users/AppData/Roaming/Mozilla/Firefox/Profiles/gbjaumrnd.default&amp;quot;],&amp;quot;log&amp;quot;: {&amp;quot;level&amp;quot;: &amp;quot;trace&amp;quot;}}}}}&#039;&amp;lt;/syntaxhighlight&amp;gt;You can also control the visibility of the console with the function _WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
The following tools will help you to automate your browser:&lt;br /&gt;
* [https://autonomiq.io/chropath/ ChroPath]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Makes finding an element by XPath, ID or CSS incredibly easy (Chrome, Firefox, Opera)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2019/12/31)&amp;lt;/small&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* AutoIt WebDriver threads:&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019 Example Scripts]&#039;&#039;&#039; forum&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/ General Help and Support]&#039;&#039;&#039; forum&lt;br /&gt;
* WebDriver Exe documentation&lt;br /&gt;
** [https://sites.google.com/a/chromium.org/chromedriver/ Chrome]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver Edge]&lt;br /&gt;
** [https://firefox-source-docs.mozilla.org/testing/geckodriver/ Firefox]&lt;br /&gt;
** [tbd: Opera]&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14200</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14200"/>
		<updated>2020-01-08T13:52:28Z</updated>

		<summary type="html">&lt;p&gt;Danp2: /* FAQ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WIP}}&lt;br /&gt;
The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
(Last modified: 2019/12/29)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF]&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 80.0.3987.16 / 2019.12.19 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 81.0.370.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Firefox || [https://github.com/mozilla/geckodriver/releases github] || 0.26 / 2019.10.12 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Internet Explorer || [https://www.microsoft.com/en-us/download/details.aspx?id=44069 Microsoft] ||  || &lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases github] || 78.0.3904.87 - 2019.11.14 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status Firefox]&lt;br /&gt;
* [tbd: Opera]&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
=== Used Terms ===&lt;br /&gt;
(Last modified: 2020/01/03)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
	 &lt;br /&gt;
You will find the following terms when using WebDriver. We try to shed some light onto this subject here:&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&#039;&#039;&#039;Marionette&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette consists of two parts: a server which takes requests and executes them in Gecko (the Marionette server ships with Firefox), and a client (the Marionette client ships with the GeckoDriver exe). The client sends commands to the server and the server executes the command inside the browser.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://firefox-source-docs.mozilla.org/testing/marionette/Intro.html visit this site].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
(Last modified: 2020/01/04)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following steps are needed to install everything you need to automate your browser:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory:&lt;br /&gt;
** chromedriver.exe (Chrome)&lt;br /&gt;
** geckodriver.exe (Firefox)&lt;br /&gt;
** msedgedriver.exe (Edge - Chromium) or MicrosoftWebDriver.exe (Edge - EdgeHTML)&lt;br /&gt;
* Run the installation test script (WD_Demo.au3) and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\Users\\xy\\AppData\\Local\\Temp\\rust_mozprofileaWURpD&amp;quot;&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:{&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;,&amp;quot;browserVersion&amp;quot;:&amp;quot;71.0&amp;quot;,&amp;quot;moz:accessibilityChecks&amp;quot;:false,&amp;quot;moz:buildID&amp;quot;:&amp;quot;20191202093317&amp;quot;,&amp;quot;moz:geckodriverVersion&amp;quot;:&amp;quot;0.26.0&amp;quot;,&amp;quot;moz:headless&amp;quot;:false,&amp;quot;moz:processID&amp;quot;:50220,&amp;quot;moz:profile&amp;quot;:&amp;quot;C:\\Users\\xy\\AppData\\Local\\Temp\\rust_mozprofileaWURpD&amp;quot;,&amp;quot;moz:shutdownTimeout&amp;quot;:60000,&amp;quot;moz:useNonSpecCompliantPointerOrigin&amp;quot;:false,&amp;quot;moz:webdriverClick&amp;quot;:true,&amp;quot;pageLoadStrategy&amp;quot;:&amp;quot;normal&amp;quot;,&amp;quot;platformName&amp;quot;:&amp;quot;windows&amp;quot;,&amp;quot;platformVersion&amp;quot;:&amp;quot;10.0&amp;quot;,&amp;quot;rotatable&amp;quot;:false,&amp;quot;setWindowRect&amp;quot;:true,&amp;quot;strictFileInteractability&amp;quot;:false,&amp;quot;timeouts&amp;quot;:{&amp;quot;implicit&amp;quot;:0,&amp;quot;pageLoad&amp;quot;:300000,&amp;quot;script&amp;quot;:30000},&amp;quot;unhandledPromptBehavior&amp;quot;:&amp;quot;dismiss and notify&amp;quot;}}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
(Last modified: 2019/12/28)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| The installation testing script does not start up Firefox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| Run the gecko driver from a local HDD.|| [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
(Last modified: 2019/12/30)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ1&amp;quot;&amp;gt;Connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post] or in the [https://github.com/Danp2/WebDriver/wiki/Connecting-to-existing-browser-instance Github wiki].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ2&amp;quot;&amp;gt;How to hide the webdriver console&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I hide the webdriver console?&amp;lt;br&amp;gt;A: The console can be completely hidden from the start by adding the following line near the beginning of your script --&amp;lt;br&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error&amp;lt;/syntaxhighlight&amp;gt;You can also control the visibility of the console with the function_WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
The following tools will help you to automate your browser:&lt;br /&gt;
* [https://autonomiq.io/chropath/ ChroPath]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Makes finding an element by XPath, ID or CSS incredibly easy (Chrome, Firefox, Opera)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
(Last modified: 2019/12/31)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* AutoIt WebDriver threads:&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019 Example Scripts]&#039;&#039;&#039; forum&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/ General Help and Support]&#039;&#039;&#039; forum&lt;br /&gt;
* WebDriver Exe documentation&lt;br /&gt;
** [https://sites.google.com/a/chromium.org/chromedriver/ Chrome]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver Edge]&lt;br /&gt;
** [https://firefox-source-docs.mozilla.org/testing/geckodriver/ Firefox]&lt;br /&gt;
** [tbd: Opera]&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14199</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14199"/>
		<updated>2020-01-08T13:50:10Z</updated>

		<summary type="html">&lt;p&gt;Danp2: /* FAQ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WIP}}&lt;br /&gt;
The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
(Last modified: 2019/12/29)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF]&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 80.0.3987.16 / 2019.12.19 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 81.0.370.0 || &lt;br /&gt;
|-&lt;br /&gt;
| Firefox || [https://github.com/mozilla/geckodriver/releases github] || 0.26 / 2019.10.12 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Internet Explorer || [https://www.microsoft.com/en-us/download/details.aspx?id=44069 Microsoft] ||  || &lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases github] || 78.0.3904.87 - 2019.11.14 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status Firefox]&lt;br /&gt;
* [tbd: Opera]&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
=== Used Terms ===&lt;br /&gt;
(Last modified: 2020/01/03)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
	 &lt;br /&gt;
You will find the following terms when using WebDriver. We try to shed some light onto this subject here:&lt;br /&gt;
&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
&#039;&#039;&#039;Marionette&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox. It can control both the chrome (i.e. menus and functions) or the content (the webpage loaded inside the browsing context), giving a high level of control and ability to replicate user actions. In addition to performing actions on the browser, Marionette can also read the properties and attributes of the DOM.&amp;lt;br&amp;gt;&lt;br /&gt;
Marionette consists of two parts: a server which takes requests and executes them in Gecko (the Marionette server ships with Firefox), and a client (the Marionette client ships with the GeckoDriver exe). The client sends commands to the server and the server executes the command inside the browser.&amp;lt;br&amp;gt;&lt;br /&gt;
For details please [https://firefox-source-docs.mozilla.org/testing/marionette/Intro.html visit this site].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
(Last modified: 2020/01/04)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following steps are needed to install everything you need to automate your browser:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory:&lt;br /&gt;
** chromedriver.exe (Chrome)&lt;br /&gt;
** geckodriver.exe (Firefox)&lt;br /&gt;
** msedgedriver.exe (Edge - Chromium) or MicrosoftWebDriver.exe (Edge - EdgeHTML)&lt;br /&gt;
* Run the installation test script (WD_Demo.au3) and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\Users\\xy\\AppData\\Local\\Temp\\rust_mozprofileaWURpD&amp;quot;&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:{&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;,&amp;quot;browserVersion&amp;quot;:&amp;quot;71.0&amp;quot;,&amp;quot;moz:accessibilityChecks&amp;quot;:false,&amp;quot;moz:buildID&amp;quot;:&amp;quot;20191202093317&amp;quot;,&amp;quot;moz:geckodriverVersion&amp;quot;:&amp;quot;0.26.0&amp;quot;,&amp;quot;moz:headless&amp;quot;:false,&amp;quot;moz:processID&amp;quot;:50220,&amp;quot;moz:profile&amp;quot;:&amp;quot;C:\\Users\\xy\\AppData\\Local\\Temp\\rust_mozprofileaWURpD&amp;quot;,&amp;quot;moz:shutdownTimeout&amp;quot;:60000,&amp;quot;moz:useNonSpecCompliantPointerOrigin&amp;quot;:false,&amp;quot;moz:webdriverClick&amp;quot;:true,&amp;quot;pageLoadStrategy&amp;quot;:&amp;quot;normal&amp;quot;,&amp;quot;platformName&amp;quot;:&amp;quot;windows&amp;quot;,&amp;quot;platformVersion&amp;quot;:&amp;quot;10.0&amp;quot;,&amp;quot;rotatable&amp;quot;:false,&amp;quot;setWindowRect&amp;quot;:true,&amp;quot;strictFileInteractability&amp;quot;:false,&amp;quot;timeouts&amp;quot;:{&amp;quot;implicit&amp;quot;:0,&amp;quot;pageLoad&amp;quot;:300000,&amp;quot;script&amp;quot;:30000},&amp;quot;unhandledPromptBehavior&amp;quot;:&amp;quot;dismiss and notify&amp;quot;}}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
==== Firefox ====&lt;br /&gt;
(Last modified: 2019/12/28)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| The installation testing script does not start up Firefox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| Run the gecko driver from a local HDD.|| [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
(Last modified: 2019/12/30)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ1&amp;quot;&amp;gt;Connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post] or in the [https://github.com/Danp2/WebDriver/wiki/Connecting-to-existing-browser-instance Github wiki].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ2&amp;quot;&amp;gt;How to hide the webdriver console&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-FAQ2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I hide the webdriver console?&amp;lt;br&amp;gt;A: The console can be completely hidden from the start by adding the following line near the beginning of your script --&amp;lt;br&amp;gt;$_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;You can also control the visibility of the console with the function_WD_ConsoleVisible.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
The following tools will help you to automate your browser:&lt;br /&gt;
* [https://autonomiq.io/chropath/ ChroPath]﻿ ﻿p﻿l﻿u﻿g﻿i﻿n: Makes finding an element by XPath, ID or CSS incredibly easy (Chrome, Firefox, Opera)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
(Last modified: 2019/12/31)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* AutoIt WebDriver threads:&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019 Example Scripts]&#039;&#039;&#039; forum&lt;br /&gt;
** Danp2&#039;s thread in the &#039;&#039;&#039;[https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/ General Help and Support]&#039;&#039;&#039; forum&lt;br /&gt;
* WebDriver Exe documentation&lt;br /&gt;
** [https://sites.google.com/a/chromium.org/chromedriver/ Chrome]&lt;br /&gt;
** [https://docs.microsoft.com/en-us/microsoft-edge/webdriver Edge]&lt;br /&gt;
** [https://firefox-source-docs.mozilla.org/testing/geckodriver/ Firefox]&lt;br /&gt;
** [tbd: Opera]&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14184</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14184"/>
		<updated>2019-12-31T16:50:08Z</updated>

		<summary type="html">&lt;p&gt;Danp2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WIP}}&lt;br /&gt;
The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
(Last modified: 2019/12/29)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF] from github&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 80.0.3987.16 / 2019.12.19 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 81.0.370.0 || &lt;br /&gt;
|-&lt;br /&gt;
| FireFox || [https://github.com/mozilla/geckodriver/releases github] || 0.26 / 2019.10.12 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Internet Explorer || [https://www.microsoft.com/en-us/download/details.aspx?id=44069 Microsoft] ||  || &lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases github] || 78.0.3904.87 - 2019.11.14 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto the corresponding website below:&lt;br /&gt;
&lt;br /&gt;
* [https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md Chrome]&lt;br /&gt;
* [https://docs.microsoft.com/en-us/microsoft-edge/webdriver#w3c-webdriver-specification-supporthttpsw3cgithubiowebdriverwebdriver-spechtml Edge]&lt;br /&gt;
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status FireFox]&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independent and browser dependent parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
(Last modified: 2019/12/30)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following steps are needed to install everything you need to automate your browser:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependent WebDriver to the same directory:&lt;br /&gt;
** chromedriver.exe for Chrome&lt;br /&gt;
** geckodriver.exe for Firefox&lt;br /&gt;
** msedgedriver.exe for Edge (Chromium) or MicrosoftWebDriver.exe for Edge (EdgeHTML)&lt;br /&gt;
* Run the installation test script (WD_Demo.au3) and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\Users\\xy\\AppData\\Local\\Temp\\rust_mozprofileaWURpD&amp;quot;&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:{&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;,&amp;quot;browserVersion&amp;quot;:&amp;quot;71.0&amp;quot;,&amp;quot;moz:accessibilityChecks&amp;quot;:false,&amp;quot;moz:buildID&amp;quot;:&amp;quot;20191202093317&amp;quot;,&amp;quot;moz:geckodriverVersion&amp;quot;:&amp;quot;0.26.0&amp;quot;,&amp;quot;moz:headless&amp;quot;:false,&amp;quot;moz:processID&amp;quot;:50220,&amp;quot;moz:profile&amp;quot;:&amp;quot;C:\\Users\\xy\\AppData\\Local\\Temp\\rust_mozprofileaWURpD&amp;quot;,&amp;quot;moz:shutdownTimeout&amp;quot;:60000,&amp;quot;moz:useNonSpecCompliantPointerOrigin&amp;quot;:false,&amp;quot;moz:webdriverClick&amp;quot;:true,&amp;quot;pageLoadStrategy&amp;quot;:&amp;quot;normal&amp;quot;,&amp;quot;platformName&amp;quot;:&amp;quot;windows&amp;quot;,&amp;quot;platformVersion&amp;quot;:&amp;quot;10.0&amp;quot;,&amp;quot;rotatable&amp;quot;:false,&amp;quot;setWindowRect&amp;quot;:true,&amp;quot;strictFileInteractability&amp;quot;:false,&amp;quot;timeouts&amp;quot;:{&amp;quot;implicit&amp;quot;:0,&amp;quot;pageLoad&amp;quot;:300000,&amp;quot;script&amp;quot;:30000},&amp;quot;unhandledPromptBehavior&amp;quot;:&amp;quot;dismiss and notify&amp;quot;}}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
==== FireFox ====&lt;br /&gt;
(Last modified: 2019/12/28)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| The installation testing script does not start up FireFox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| Run the gecko driver from a local HDD.|| [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
(Last modified: 2019/12/30)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-myDivision&amp;quot;&amp;gt;Connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-myDivision&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post] or in the [https://github.com/Danp2/WebDriver/wiki/Connecting-to-existing-browser-instance Github wiki].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
(Last modified: 2019/12/28)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* Danp2&#039;s thread in the &#039;&#039;&#039;Example Scripts&#039;&#039;&#039; forum: https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019&lt;br /&gt;
* Danp2&#039;s thread in the &#039;&#039;&#039;General Help and Support&#039;&#039;&#039; forum: https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14182</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14182"/>
		<updated>2019-12-30T23:42:37Z</updated>

		<summary type="html">&lt;p&gt;Danp2: /* Connect to a running browser instance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WIP}}&lt;br /&gt;
The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
(Last modified: 2019/12/29)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF] from github&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 80.0.3987.16 / 2019.12.19 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 81.0.370.0 || &lt;br /&gt;
|-&lt;br /&gt;
| FireFox || [https://github.com/mozilla/geckodriver/releases github] || 0.26 / 2019.10.12 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Internet Explorer || [https://www.microsoft.com/en-us/download/details.aspx?id=44069 Microsoft] ||  || &lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases github] || 78.0.3904.87 - 2019.11.14 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto [https://github.com/Danp2/WebDriver Danp2&#039;s website on Github] and scroll down to &amp;quot;Requirements&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independant and browser dependant parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
(Last modified: 2019/12/30)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following steps are needed to install everything you need to automate your browser:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependant WebDriver to the same directory:&lt;br /&gt;
** chromedriver.exe for Chrome&lt;br /&gt;
** geckodriver.exe for Firefox&lt;br /&gt;
** msedgedriver.exe for Edge (Chromium) or MicrosoftWebDriver.exe for Edge (EdgeHTML)&lt;br /&gt;
* Run the installation test script (WD_Demo.au3) and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\Users\\xy\\AppData\\Local\\Temp\\rust_mozprofileaWURpD&amp;quot;&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:{&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;,&amp;quot;browserVersion&amp;quot;:&amp;quot;71.0&amp;quot;,&amp;quot;moz:accessibilityChecks&amp;quot;:false,&amp;quot;moz:buildID&amp;quot;:&amp;quot;20191202093317&amp;quot;,&amp;quot;moz:geckodriverVersion&amp;quot;:&amp;quot;0.26.0&amp;quot;,&amp;quot;moz:headless&amp;quot;:false,&amp;quot;moz:processID&amp;quot;:50220,&amp;quot;moz:profile&amp;quot;:&amp;quot;C:\\Users\\xy\\AppData\\Local\\Temp\\rust_mozprofileaWURpD&amp;quot;,&amp;quot;moz:shutdownTimeout&amp;quot;:60000,&amp;quot;moz:useNonSpecCompliantPointerOrigin&amp;quot;:false,&amp;quot;moz:webdriverClick&amp;quot;:true,&amp;quot;pageLoadStrategy&amp;quot;:&amp;quot;normal&amp;quot;,&amp;quot;platformName&amp;quot;:&amp;quot;windows&amp;quot;,&amp;quot;platformVersion&amp;quot;:&amp;quot;10.0&amp;quot;,&amp;quot;rotatable&amp;quot;:false,&amp;quot;setWindowRect&amp;quot;:true,&amp;quot;strictFileInteractability&amp;quot;:false,&amp;quot;timeouts&amp;quot;:{&amp;quot;implicit&amp;quot;:0,&amp;quot;pageLoad&amp;quot;:300000,&amp;quot;script&amp;quot;:30000},&amp;quot;unhandledPromptBehavior&amp;quot;:&amp;quot;dismiss and notify&amp;quot;}}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
==== FireFox ====&lt;br /&gt;
(Last modified: 2019/12/28)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| The installation testing script does not start up FireFox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| Run the gecko driver from a local HDD.|| [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
(Last modified: 2019/12/30)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-myDivision&amp;quot;&amp;gt;Connect to a running browser instance&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; id=&amp;quot;mw-customcollapsible-myDivision&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post] or in the [https://github.com/Danp2/WebDriver/wiki/Connecting-to-existing-browser-instance Github wiki].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
(Last modified: 2019/12/28)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* Danp2&#039;s thread in the &#039;&#039;&#039;Example Scripts&#039;&#039;&#039; forum: https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019&lt;br /&gt;
* Danp2&#039;s thread in the &#039;&#039;&#039;General Help and Support&#039;&#039;&#039; forum: https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14181</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14181"/>
		<updated>2019-12-30T22:46:33Z</updated>

		<summary type="html">&lt;p&gt;Danp2: /* Installation */ Update console contents&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WIP}}&lt;br /&gt;
The W3C WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== WebDriver API ===&lt;br /&gt;
WebDriver enables developers to create automated tests that simulate user interaction. This is different from JavaScript unit tests because WebDriver has access to functionality and information that JavaScript running in the browser doesn&#039;t, and it can more accurately simulate user events or OS-level events. WebDriver can also manage testing across multiple windows, tabs and webpages in a single test session.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver UDF ===&lt;br /&gt;
The WebDriver UDF allows to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
(Last modified: 2019/12/29)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following UDFs need to be installed - &#039;&#039;&#039;independent&#039;&#039;&#039; of the Browser you try to automate:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn JSON UDF]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP UDF]&lt;br /&gt;
* [https://github.com/Danp2/WebDriver/releases/latest WebDriver UDF] from github&lt;br /&gt;
One of the following Drivers needs to be installed - &#039;&#039;&#039;depending&#039;&#039;&#039; on the Browser type and version you try to automate:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Browser !! Download Link !! Latest Version / Date !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Chrome || [https://sites.google.com/a/chromium.org/chromedriver/downloads Google] || 80.0.3987.16 / 2019.12.19 || Follow this [https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection link] to select the correct version depending on the Chrome version you run!&lt;br /&gt;
|-&lt;br /&gt;
| Edge || [https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Microsoft] || 81.0.370.0 || &lt;br /&gt;
|-&lt;br /&gt;
| FireFox || [https://github.com/mozilla/geckodriver/releases github] || 0.26 / 2019.10.12 || Firefox version ≥ 60 is recommended&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must still have the Microsoft Visual Studio redistributable runtime installed on your system for the binary to run. This is a known bug in version 0.26 which the authors weren&#039;t able fix for this release.&lt;br /&gt;
|-&lt;br /&gt;
| Internet Explorer || [https://www.microsoft.com/en-us/download/details.aspx?id=44069 Microsoft] ||  || &lt;br /&gt;
|-&lt;br /&gt;
| Opera || [https://github.com/operasoftware/operachromiumdriver/releases github] || 78.0.3904.87 - 2019.11.14 || The versioning of OperaDriver matches the Chromium version on which Opera browser is based on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
Not all WebDriver functions have been implemented by each browser. To check the status goto [https://github.com/Danp2/WebDriver Danp2&#039;s website on Github] and scroll down to &amp;quot;Requirements&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Big Picture ===&lt;br /&gt;
How the browser independant and browser dependant parts fit together:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:WebDriver.png|800px|||Big Picture - How everything fits together]]&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
(Last modified: 2019/12/30)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following steps are needed to install everything you need to automate your browser:&lt;br /&gt;
* Download the files listed in section &amp;quot;[[WebDriver#Requirements|Requirements]]&amp;quot; &lt;br /&gt;
* Move the UDFs to a directory where SciTE and Autoit can find them:&lt;br /&gt;
** Json.au3 and BinaryCall.au3 from the JSON UDF&lt;br /&gt;
** wd_Core.au3 and wd_helper.au3 from the WebDriver UDF&lt;br /&gt;
** WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF&lt;br /&gt;
* Move the browser dependant WebDriver to the same directory:&lt;br /&gt;
** chromedriver.exe for Chrome&lt;br /&gt;
** geckodriver.exe for Firefox&lt;br /&gt;
** msedgedriver.exe for Edge (Chromium) or MicrosoftWebDriver.exe for Edge (EdgeHTML)&lt;br /&gt;
* Run the installation test script (WD_Demo.au3) and select &amp;quot;DemoNavigation&amp;quot; to validate the installation.&amp;lt;br&amp;gt;The result (for Firefox) displayed in the DOS window should be similar to the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1577745813519   geckodriver     DEBUG   Listening on 127.0.0.1:4444&lt;br /&gt;
1577745813744   webdriver::server       DEBUG   -&amp;gt; POST /session {&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;browserName&amp;quot;: &amp;quot;firefox&amp;quot;, &amp;quot;acceptInsecureCerts&amp;quot;:true}}}&lt;br /&gt;
1577745813746   geckodriver::capabilities       DEBUG   Trying to read firefox version from ini files&lt;br /&gt;
1577745813747   geckodriver::capabilities       DEBUG   Found version 71.0&lt;br /&gt;
1577745813757   mozrunner::runner       INFO    Running command: &amp;quot;C:\\Program Files\\Mozilla Firefox\\firefox.exe&amp;quot; &amp;quot;-marionette&amp;quot; &amp;quot;-foreground&amp;quot; &amp;quot;-no-remote&amp;quot; &amp;quot;-profile&amp;quot; &amp;quot;C:\\Users\\xy\\AppData\\Local\\Temp\\rust_mozprofileaWURpD&amp;quot;&lt;br /&gt;
1577745813783   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1:55184&lt;br /&gt;
1577745817392   geckodriver::marionette DEBUG   Connection to Marionette established on 127.0.0.1:55184.&lt;br /&gt;
1577745817464   webdriver::server       DEBUG   &amp;lt;- 200 OK {&amp;quot;value&amp;quot;:{&amp;quot;sessionId&amp;quot;:&amp;quot;925641bf-6c5d-4fe2-a985-02de9b1c7c74&amp;quot;,&amp;quot;capabilities&amp;quot;:{&amp;quot;acceptInsecureCerts&amp;quot;:true,&amp;quot;browserName&amp;quot;:&amp;quot;firefox&amp;quot;,&amp;quot;browserVersion&amp;quot;:&amp;quot;71.0&amp;quot;,&amp;quot;moz:accessibilityChecks&amp;quot;:false,&amp;quot;moz:buildID&amp;quot;:&amp;quot;20191202093317&amp;quot;,&amp;quot;moz:geckodriverVersion&amp;quot;:&amp;quot;0.26.0&amp;quot;,&amp;quot;moz:headless&amp;quot;:false,&amp;quot;moz:processID&amp;quot;:50220,&amp;quot;moz:profile&amp;quot;:&amp;quot;C:\\Users\\xy\\AppData\\Local\\Temp\\rust_mozprofileaWURpD&amp;quot;,&amp;quot;moz:shutdownTimeout&amp;quot;:60000,&amp;quot;moz:useNonSpecCompliantPointerOrigin&amp;quot;:false,&amp;quot;moz:webdriverClick&amp;quot;:true,&amp;quot;pageLoadStrategy&amp;quot;:&amp;quot;normal&amp;quot;,&amp;quot;platformName&amp;quot;:&amp;quot;windows&amp;quot;,&amp;quot;platformVersion&amp;quot;:&amp;quot;10.0&amp;quot;,&amp;quot;rotatable&amp;quot;:false,&amp;quot;setWindowRect&amp;quot;:true,&amp;quot;strictFileInteractability&amp;quot;:false,&amp;quot;timeouts&amp;quot;:{&amp;quot;implicit&amp;quot;:0,&amp;quot;pageLoad&amp;quot;:300000,&amp;quot;script&amp;quot;:30000},&amp;quot;unhandledPromptBehavior&amp;quot;:&amp;quot;dismiss and notify&amp;quot;}}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
=== Debug the WebDriver setup ===&lt;br /&gt;
==== FireFox ====&lt;br /&gt;
(Last modified: 2019/12/28)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Problem !! Solution !! Reference&lt;br /&gt;
|-&lt;br /&gt;
| The installation testing script does not start up FireFox and does not display the DOS window for geckodriver.&amp;lt;br&amp;gt;When you manually run the geckodriver in a DOS window you get message &amp;quot;geckodriver: error: An invalid argument was supplied. (os error 10022)&amp;quot;|| Run the gecko driver from a local HDD.|| [https://stackoverflow.com/questions/51056121/createplatformsocket-returned-an-error-an-invalid-argument-was-supplied-0x2 Stackoverflow]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Debug your Script ===&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
(Last modified: 2019/12/30)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Connect to a running browser instance ===&lt;br /&gt;
Q: How can I connect to a running browser instance?&amp;lt;br&amp;gt;A: That&#039;s described (for Firefox, but should work similar for other browsers) in this [https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/?do=findComment&amp;amp;comment=1444173 post] or in the [https://github.com/Danp2/WebDriver/wiki/Connecting-to-existing-browser-instance Github wiki].&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
(Last modified: 2019/12/28)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further information sources:&lt;br /&gt;
* W3C: https://www.w3.org/TR/webdriver/&lt;br /&gt;
* Danp2&#039;s thread in the &#039;&#039;&#039;Example Scripts&#039;&#039;&#039; forum: https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12242019&lt;br /&gt;
* Danp2&#039;s thread in the &#039;&#039;&#039;General Help and Support&#039;&#039;&#039; forum: https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13768</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=FAQ&amp;diff=13768"/>
		<updated>2018-03-02T12:52:46Z</updated>

		<summary type="html">&lt;p&gt;Danp2: /* How can I control (click, edit etc) an external (html) application? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of frequently asked questions asked on the forums.&lt;br /&gt;
&lt;br /&gt;
Other FAQs include:&lt;br /&gt;
* The one found in the [http://www.autoitscript.com/autoit3/docs/faq.htm AutoIt HelpFile].  Much of it is about the transition from V2 to V3, but most is still relevant and should be a port of call, as well as this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I debug my script?==&lt;br /&gt;
&lt;br /&gt;
=== In SciTE ===&lt;br /&gt;
This one has a myriad of answers, but the most effective is to begin by using the [http://www.autoitscript.com/autoit3/scite/ SciTE4AutoIt3 Editor] to create or edit scripts. This program is useful in debugging for the following reasons:&lt;br /&gt;
&lt;br /&gt;
* Syntax highlighting allows for immediate viewing of any mistakes from unended script tags or quotes. This allows the scripter to visibly see the difference between the following portions of code.&lt;br /&gt;
[[File:FAQ_Q1_2.jpg|center|Incorrect code]]&lt;br /&gt;
And the correct version: &lt;br /&gt;
[[File:FAQ_Q1_3.jpg|center||Correct Code]]&lt;br /&gt;
* Global syntax check built directly into the tools menu allows you to check an entire script for problems all at once.&lt;br /&gt;
* Built-in code tidying program that correctly indents untidy code and repairs messy scripts to allow them to be more readable. It also corrects problems with incorrectly capitalised function names and variables.&lt;br /&gt;
* Per-line trace insertion allows you to log every line of code executed to debug errors.&lt;br /&gt;
* Debug MsgBoxes or ConsoleWrites are able to be added anywhere in the script directly from SciTE. ConsoleWrite lines are less intrusive and prevent the added annoyance to the user of MsgBoxes.&lt;br /&gt;
&lt;br /&gt;
You can also use AutoIt3Wrapper directive:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#AutoIt3Wrapper_Run_Debug_Mode=Y&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:FAQ_Q1_4.jpg|center|Picture of SciTE4AutoIt3]]&lt;br /&gt;
&lt;br /&gt;
=== Using more code to check @error value ===&lt;br /&gt;
Nearly all functions will return something.  Most of the time when a function fails, it returns 0 and sets @error.  You can use this information not only to create scripts that handle for different errors but to debug and find out exactly why you are having problems.  Check the help file for specific functions and their return values.&lt;br /&gt;
&lt;br /&gt;
=== Via the Tray icon===&lt;br /&gt;
You can add this line at the top of your script (1 is on, 0 is off) to enable debugging from the tray icon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;AutoItSetOption (&amp;quot;TrayIconDebug&amp;quot;, 1);0-off&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then if you run the script (uncompiled as an AU3 file), you can mouse over the AutoIt icon in the system tray (down by the clock) to display debugging information.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_1.jpg|center|Example output for TrayIconDebug]]&lt;br /&gt;
&lt;br /&gt;
=== OutputDebugString native call ===&lt;br /&gt;
You can also debug a script on any computer by adding the following code to your script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _MyDebug($sMessage, $iError = @error, $iExtended = @extended)&lt;br /&gt;
	If $iError Or $iExtended Then&lt;br /&gt;
		$sMessage &amp;amp;= &#039;[ @error = &#039; &amp;amp; $iError &amp;amp; &#039; @extended = &#039; &amp;amp; $iExtended &amp;amp; &#039; ]&#039;&lt;br /&gt;
	EndIf&lt;br /&gt;
	DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;none&amp;quot;, &amp;quot;OutputDebugString&amp;quot;, &amp;quot;str&amp;quot;, $sMessage)&lt;br /&gt;
	Return SetError($iError, $iExtended, &#039;&#039;)&lt;br /&gt;
EndFunc   ;==&amp;gt;_MyDebug&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, when you need to add a debug line, call it as necessary. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;_MyDebug(&amp;quot;The value of Variable 1 at this time is &amp;quot; &amp;amp; $var1)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This debugging is completely transparent to the user, and is only viewable with a program such as DebugView from SysInternals. This method of debugging has the added advantage of being available to the developer in situations where is not acceptable or feasable to install SciTE on a client&#039;s unit.&lt;br /&gt;
&lt;br /&gt;
=== Graphical debugger ===&lt;br /&gt;
Stumpii created a [http://www.autoitscript.com/forum/index.php?showtopic=21834 Graphical AutoIt Debugger], similar to Dev-C++&#039;s debugging style.&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q1_5.jpg|center|Stumpii&#039;s Graphical AutoIt Debugger]]&lt;br /&gt;
&lt;br /&gt;
=== Another debugger for AutoIt ===&lt;br /&gt;
Heron created a [http://www.autoitscript.com/forum/index.php?showtopic=103142 Another debugger for AutoIt].&lt;br /&gt;
&lt;br /&gt;
The latest version by asdf8 is here:&lt;br /&gt;
https://www.autoitscript.com/forum/topic/103142-another-debugger-for-autoit/?do=findComment&amp;amp;comment=1303208&lt;br /&gt;
&lt;br /&gt;
==How can I run something that is not an exe file [.txt, .msi, .pdf,.jpg etc.] [or] How can I open a webpage in the default browser?==&lt;br /&gt;
It was for this reason that the ShellExecute function was created. Here is one example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;edit&amp;quot;, @SW_MAXIMIZE)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify a web address this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;http://www.autoitscript.com/forum&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;open&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you normally are able to right-click the file and select print, then you can also print the file from AutoIt using this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\boot.ini&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;print&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to open the file with the default program, you can do as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;ShellExecute(&amp;quot;C:\autoitscripts\test.au3&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish your script to wait until the process is finished, you can use the ShellExecuteWait function with the same parameters.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
The default verb is the verb configured in the registry. If no verb is set as default in the registry then the &amp;quot;open&amp;quot; verb is used. If the &amp;quot;open&amp;quot; verb is not present then the first verb listed in the registry is used.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent more than one copy of my script from running at once, or detect another copy of my script running?==&lt;br /&gt;
&lt;br /&gt;
=== _Singleton function ===&lt;br /&gt;
There are a few different ways to go about this. You can use a function called _Singleton to detect multiple instances of your script. An example of how to use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
_Singleton(&amp;quot;TheNameOfMyScript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, the script will bring up some messages explaining to the user of the occurring events. &lt;br /&gt;
This example will show you how the above function can be used in a real world application.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _Singleton(&amp;quot;MyScriptName&amp;quot;, 1) = 0 Then&lt;br /&gt;
    ; If successful, running our script a second time should cause us to fall through here&lt;br /&gt;
    MsgBox($MB_ICONERROR, &amp;quot;User Generated Error Message&amp;quot;, &amp;quot;Error: This script is already running!&amp;quot;)&lt;br /&gt;
Else&lt;br /&gt;
    ; We have detected that we are the only instance running, now we will run a second instance to display _Singleton&#039;s function!&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We are the first instance of this script, press OK to run another instance and trigger the error message!&amp;quot;)&lt;br /&gt;
    Switch @Compiled&lt;br /&gt;
        Case 1&lt;br /&gt;
            Run(FileGetShortName(@ScriptFullPath));when running an app, it&#039;s usually better to use its short name&lt;br /&gt;
        Case 0&lt;br /&gt;
            Run(FileGetShortName(@AutoItExe) &amp;amp; &#039; /AutoIt3ExecuteScript &#039; &amp;amp; FileGetShortName(@ScriptFullPath))&lt;br /&gt;
    EndSwitch&lt;br /&gt;
    Sleep(1000)&lt;br /&gt;
    MsgBox($MB_ICONINFORMATION, &amp;quot;Information!&amp;quot;, &amp;quot;We ran a second instance, you should have recieved an error message!&amp;quot;, 5)&lt;br /&gt;
EndIf&lt;br /&gt;
Exit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===_MutexExists function ===&lt;br /&gt;
Another method is to use _MutexExists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If _MutexExists(&amp;quot;MydeswswScriptName&amp;quot;) Then&lt;br /&gt;
	; We know the script is already running. Let the user know.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;Script Name&amp;quot;, &amp;quot;This script is already running. Using multiple copies of this script at the same time is unsupported!&amp;quot;)&lt;br /&gt;
	Exit&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
;Function Author- Martin&lt;br /&gt;
Func _MutexExists($sOccurenceName)&lt;br /&gt;
	Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError&lt;br /&gt;
	$sOccurenceName = StringReplace($sOccurenceName, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;); to avoid error&lt;br /&gt;
	$handle = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;CreateMutex&amp;quot;, &amp;quot;int&amp;quot;, 0, &amp;quot;long&amp;quot;, 1, &amp;quot;str&amp;quot;, $sOccurenceName)&lt;br /&gt;
	$lastError = DllCall(&amp;quot;kernel32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetLastError&amp;quot;)&lt;br /&gt;
	Return $lastError[0] = $ERROR_ALREADY_EXISTS&lt;br /&gt;
EndFunc;==&amp;gt;_MutexExists&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I run my script as a service?==&lt;br /&gt;
This is also a question with multiple answers, and none of them are the only way to do it. The first question to ask yourself is whether or not you wish to install the service on other computers besides your own.&lt;br /&gt;
&lt;br /&gt;
=== On your own computer - One time only ===&lt;br /&gt;
The easiest way to do this is to use Pirmasoft RunAsSvc. This program makes services easy to install and easy to remove when necessary.&lt;br /&gt;
&lt;br /&gt;
=== On all computers that run your script===&lt;br /&gt;
To do this you can use SRVANY.EXE and [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3]. You can then use this code to install your script as a service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_CreateService(&amp;quot;&amp;quot;, $servicename, &amp;quot;My AutoIt Script&amp;quot;, &amp;quot;C:\Path_to_\srvany.exe&amp;quot;, &amp;quot;LocalSystem&amp;quot;, &amp;quot;&amp;quot;, 0x110)&lt;br /&gt;
RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; $servicename &amp;amp; &amp;quot;\Parameters&amp;quot;, &amp;quot;Application&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use the following code to delete this service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;ServiceControl.au3&amp;quot;&lt;br /&gt;
$servicename = &amp;quot;MyServiceName&amp;quot;&lt;br /&gt;
_DeleteService(&amp;quot;&amp;quot;, $servicename)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is one caveat to setting up AutoIt as a service. If the service is not installed using the above code, it must have the &amp;quot;allow service to interact with the desktop&amp;quot; setting or else automation functions such as Control* or Win* functions will not function. To assure the service does indeed have this setting, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SYSTEM\CurrentControlSet\Services\[ServiceName]&amp;quot;, &amp;quot;Type&amp;quot;, &amp;quot;REG_DWORD&amp;quot;, 0x110)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I create/start/stop or otherwise control a service?==&lt;br /&gt;
There are two include libraries that are designed specifically to interact with services. These are the following:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=6487 ServiceControl.au3] made by SumTingWong. Functionality:&lt;br /&gt;
** _StartService()&lt;br /&gt;
** _StopService()&lt;br /&gt;
** _ServiceExists()&lt;br /&gt;
** _ServiceRunning()&lt;br /&gt;
** _CreateService()&lt;br /&gt;
** _DeleteService()&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=22165 _NTServices.au3] made by CatchFish. Functionality:&lt;br /&gt;
** _ServiceStart()&lt;br /&gt;
** _ServiceStop()&lt;br /&gt;
** _ServiceStatus()&lt;br /&gt;
** _ServicePause()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I display a progress bar while copying files or directories?==&lt;br /&gt;
There are a many different topics on how to do this.  For more, just search the forums for [http://www.autoitscript.com/forum/index.php?act=Search&amp;amp;CODE=show&amp;amp;searchid=22030d4d4effe5e32da23fdb69ed772f&amp;amp;search_in=posts&amp;amp;result_type=topics&amp;amp;highlite=%2BCopy%2B Progress Copy + Progress].&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11313 Copy with progress dialog]... By ezztabi&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=11888 Yet another copy with progress]... By SumTingWong&lt;br /&gt;
* [http://www.autoit.de/index.php?page=Thread&amp;amp;postID=58875 _MultiFileCopy]... By Oscar (German Forums)&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=19370&amp;amp;st=45&amp;amp;p=186198&amp;amp;#entry186198 _FileCopy]... By Jos&lt;br /&gt;
&lt;br /&gt;
[[File:FAQ_Q6_1.jpg|center|Copy progress dialog by ezztabi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make a hotkey that only works in my GUI?==&lt;br /&gt;
It used to be quite tedious setting hotkeys to only work in your GUI.  Now there is an easier way with the function GUISetAccelerators.&lt;br /&gt;
&lt;br /&gt;
(From Helpfile example)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; A simple custom messagebox that uses the MessageLoop mode&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GUICreate(&amp;quot;Custom Msgbox&amp;quot;, 210, 80)&lt;br /&gt;
&lt;br /&gt;
GUICtrlCreateLabel(&amp;quot;Please click a button!&amp;quot;, 10, 10)&lt;br /&gt;
$YesID = GUICtrlCreateButton(&amp;quot;Yes&amp;quot;, 10, 50, 50, 20)&lt;br /&gt;
$NoID = GUICtrlCreateButton(&amp;quot;No&amp;quot;, 80, 50, 50, 20)&lt;br /&gt;
$ExitID = GUICtrlCreateButton(&amp;quot;Exit&amp;quot;, 150, 50, 50, 20)&lt;br /&gt;
&lt;br /&gt;
; Set accelerators for Ctrl+y and Ctrl+n&lt;br /&gt;
Dim $AccelKeys[2][2]=[[&amp;quot;^y&amp;quot;, $YesID], [&amp;quot;^n&amp;quot;, $NoID]]&lt;br /&gt;
GUISetAccelerators($AccelKeys)&lt;br /&gt;
&lt;br /&gt;
GUISetState(); display the GUI&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
	$msg = GUIGetMsg()&lt;br /&gt;
&lt;br /&gt;
	Select&lt;br /&gt;
		Case $msg = $YesID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Yes&amp;quot;)&lt;br /&gt;
		Case $msg = $NoID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;No&amp;quot;)&lt;br /&gt;
		Case $msg = $ExitID&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Exit&amp;quot;)&lt;br /&gt;
		Case $msg = $GUI_EVENT_CLOSE&lt;br /&gt;
			MsgBox($MB_OK, &amp;quot;You clicked on&amp;quot;, &amp;quot;Close&amp;quot;)&lt;br /&gt;
	EndSelect&lt;br /&gt;
Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I perform an action while a key is held down?==&lt;br /&gt;
You can use the _IsPressed() function to determine when a key is held down. The values that can be specified in this function are listed in the AutoIt Help File under User Defined Functions -&amp;gt; Misc Management -&amp;gt; _IsPressed. The following example will press the left mouse button while the k key is held down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Misc.au3&amp;gt;&lt;br /&gt;
$pressed = 0&lt;br /&gt;
While 1&lt;br /&gt;
	If _IsPressed(&amp;quot;4B&amp;quot;) Then&lt;br /&gt;
		If Not $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;K Key being held down&amp;quot;)&lt;br /&gt;
			MouseDown(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 1&lt;br /&gt;
		EndIf&lt;br /&gt;
	Else&lt;br /&gt;
		If $pressed Then&lt;br /&gt;
			ToolTip(&amp;quot;&amp;quot;)&lt;br /&gt;
			MouseUp(&amp;quot;left&amp;quot;)&lt;br /&gt;
			$pressed = 0&lt;br /&gt;
		EndIf&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(250)&lt;br /&gt;
WEnd&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I run my script on a remote computer over the network?==&lt;br /&gt;
The answer to this question depends on how much experience you have in networking. If the target system is a Windows system to which you have administrator access then you may use one of the following programs:&lt;br /&gt;
&lt;br /&gt;
* PsExec from SysInternals&lt;br /&gt;
* BeyondExec from BeyondLogic&lt;br /&gt;
&lt;br /&gt;
With either of these programs it is possible to launch any process on a remote system and even copy your script to the target computer before starting it. Neither these programs nor any others will work with Windows XP Home Edition unless you create a custom &amp;quot;command listener&amp;quot; that you manually install on the target system.&lt;br /&gt;
&lt;br /&gt;
NOTE: Those of you with more advanced programming skills and a little imagination can figure out how to use the service control libraries and srvany.exe to do this same thing without either of the above mentioned programs.&lt;br /&gt;
&lt;br /&gt;
==How can I make a User Defined Function with optional parameters like the ones I see in the Help File?==&lt;br /&gt;
You can specify optional parameters by giving them a default value in the Func declaration. An example of how this is done:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Func testme($param1, $param2 = &amp;quot;nothing&amp;quot;, $param3 = 5)&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;&amp;quot;, &amp;quot;Parameter one is required. The value of Parameter 1 is &amp;quot; &amp;amp; $param1 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 2 is optional. The value of Parameter 2 is &amp;quot; &amp;amp; $param2 &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Parameter 3 is optional. The value of Parameter 3 is &amp;quot; &amp;amp; $param3)&lt;br /&gt;
EndFunc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If testme() is called with only one parameter [I.E. testme(&amp;quot;test&amp;quot;)] then the output is:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is nothing&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
However, if the function is called with more than one parameter like this testme(&amp;quot;test&amp;quot;, &amp;quot;something&amp;quot;), then the output is&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Parameter one is required. The value of Parameter 1 is test&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 2 is optional. The value of Parameter 2 is something&amp;lt;br /&amp;gt;&lt;br /&gt;
Parameter 3 is optional. The value of Parameter 3 is 5&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I make my script start every time windows starts?==&lt;br /&gt;
You can use one of the following codes to allow your script to start with Windows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;RegWrite(&amp;quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&amp;quot;, &amp;quot;MyProgramName&amp;quot;, &amp;quot;REG_SZ&amp;quot;, @ScriptFullPath)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;FileCreateShortcut(@ScriptFullPath, @StartupCommonDir &amp;amp; &amp;quot;\MyProgramName.lnk&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or place a Shortcut in the Startup folder, or the entire Executable.  For Win8+ systems, use the Win+R keys to open a Run box, then &amp;quot;Shell:Startup&amp;quot; to access the Startup folder. Due to Windows User Account Control (UAC) restrictions, your script may require [https://www.autoitscript.com/autoit3/docs/keywords/RequireAdmin.htm #RequireAdmin].&lt;br /&gt;
&lt;br /&gt;
==How can I have the script delete itself?==&lt;br /&gt;
The following function will delete the running script or .exe once it has finished execution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING: Make a copy of your script before calling this function!!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Func _SelfDelete($iDelay = 0)&lt;br /&gt;
	Local $sCmdFile&lt;br /&gt;
	FileDelete(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;)&lt;br /&gt;
	$sCmdFile = &#039;ping -n &#039; &amp;amp; $iDelay &amp;amp; &#039; 127.0.0.1 &amp;gt; nul&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;:loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot;&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;if exist &amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; goto loop&#039; &amp;amp; @CRLF _&lt;br /&gt;
			 &amp;amp; &#039;del %0&#039;&lt;br /&gt;
	FileWrite(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, $sCmdFile)&lt;br /&gt;
	Run(@TempDir &amp;amp; &amp;quot;\scratch.bat&amp;quot;, @TempDir, @SW_HIDE)&lt;br /&gt;
EndFunc;==&amp;gt;_SelfDelete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I create a clickable website hyperlink in my gui?==&lt;br /&gt;
[[File:FAQ_Q13_1.jpg|center|Example GUI using Gary&#039;s UDF.]]&lt;br /&gt;
&lt;br /&gt;
Gary Frost has made great advances in this area and has provided a [http://www.autoitscript.com/forum/index.php?showtopic=23111&amp;amp;st=0 UDF here] to help with doing this.&lt;br /&gt;
&lt;br /&gt;
==How can I change the screen resolution / refresh rate / color depth?==&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=20121 ChangeResolution.au3] is a library function created to make changes to these settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How can I get the screen resolution in multiple monitor setups?==&lt;br /&gt;
The following code was worked out by Larry to determine the total screen resolution of multiple monitors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$aTSR = _GetTotalScreenResolution()&lt;br /&gt;
MsgBox($MB_OK, &amp;quot;Total Screen Resolution&amp;quot;, &amp;quot;Width = &amp;quot; &amp;amp; $aTSR[0] &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Height = &amp;quot; &amp;amp; $aTSR[1])&lt;br /&gt;
&lt;br /&gt;
;Original code by Larry.&lt;br /&gt;
;Edited by BrettF&lt;br /&gt;
Func _GetTotalScreenResolution()&lt;br /&gt;
	Local $aRet[2]&lt;br /&gt;
	Global Const $SM_VIRTUALWIDTH = 78&lt;br /&gt;
	Global Const $SM_VIRTUALHEIGHT = 79&lt;br /&gt;
	$VirtualDesktopWidth = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALWIDTH)&lt;br /&gt;
	$aRet[0] = $VirtualDesktopWidth[0]&lt;br /&gt;
	$VirtualDesktopHeight = DllCall(&amp;quot;user32.dll&amp;quot;, &amp;quot;int&amp;quot;, &amp;quot;GetSystemMetrics&amp;quot;, &amp;quot;int&amp;quot;, $SM_VIRTUALHEIGHT)&lt;br /&gt;
	$aRet[1] = $VirtualDesktopHeight[0]&lt;br /&gt;
	Return $aRet&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  How can I register a file type with my program [or] How can I make files with a certain extension open in my program?==&lt;br /&gt;
[[File:FAQ_Q16_1.jpg|center|Example of how a file type can be registered.]]&lt;br /&gt;
File registration can be a tricky business for those who have not done it before. The first thing to be done is to modify your script to allow it to accept files from the command line. Here is one example of how to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;$cmdline[0] is the number of parameters passed&lt;br /&gt;
If $cmdline[0] &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
	$filename = $cmdline[1]&lt;br /&gt;
;Do something with the file here&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;The file name passed to the command line is &amp;quot;&#039; &amp;amp; $filename &amp;amp; &#039;&amp;quot;&#039;)&lt;br /&gt;
Else&lt;br /&gt;
; We did not get any command line parameters.&lt;br /&gt;
; If this is a command line only program, you would want to&lt;br /&gt;
; alert the user that the command line parameters were incorrect.&lt;br /&gt;
; If this is a GUI program (like a notepad program), you would&lt;br /&gt;
; want to simply continue from here without opening a file.&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;UXYFixer&amp;quot;, &#039;Command line parameters incorrect.&#039; &amp;amp; @CRLF &amp;amp; &#039;Command line usage: &amp;quot;&#039; &amp;amp; @ScriptName &amp;amp; &#039;&amp;quot; &amp;quot;file to process&amp;quot;&#039;)&lt;br /&gt;
 EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After your script is ready to accept files, you can begin to register the file type you need with your program. To prevent errors, this-is-me has created a UDF that will allow you to do this easily:&lt;br /&gt;
&lt;br /&gt;
Here is an example of how to register and unregister a file extension using this UDF:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;quot;FileRegister.au3&amp;quot;&lt;br /&gt;
;================================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileRegister($ext, $cmd, $verb [, $def [, $icon = &amp;quot;&amp;quot; [, $desc = &amp;quot;&amp;quot; ]]])&lt;br /&gt;
;			   Registers a file type in Explorer&lt;br /&gt;
;&lt;br /&gt;
; Parameter(s): $ext -  File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;		$cmd -  Program path with arguments eg. &#039;&amp;quot;C:\test\testprog.exe&amp;quot; &amp;quot;%1&amp;quot;&#039;&lt;br /&gt;
;			 (%1 is 1st argument, %2 is 2nd, etc.)&lt;br /&gt;
;		$verb - Name of action to perform on file&lt;br /&gt;
;			 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;		$def -  Action is the default action for this filetype&lt;br /&gt;
;			 (1 for true 0 for false)&lt;br /&gt;
;			 If the file is not already associated, this will be the default.&lt;br /&gt;
;		$icon - Default icon for filetype including resource # if needed&lt;br /&gt;
;			 eg. &amp;quot;C:\test\testprog.exe,0&amp;quot; or &amp;quot;C:\test\filetype.ico&amp;quot;&lt;br /&gt;
;		$desc - File Description eg. &amp;quot;Zip File&amp;quot; or &amp;quot;ProgramName Document&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;================================================&lt;br /&gt;
&lt;br /&gt;
 FileRegister(&amp;quot;uxy&amp;quot;, &#039;&amp;quot;&#039; &amp;amp; @ScriptFullPath &amp;amp; &#039;&amp;quot; &amp;quot;%1&amp;quot;&#039;, &amp;quot;Open in UXYFixer&amp;quot;, 1, @ScriptFullPath &amp;amp; &#039;,0&#039;, &amp;quot;UXYFixer Document&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;========================================&lt;br /&gt;
;&lt;br /&gt;
; Description:	FileUnRegister($ext, $verb)&lt;br /&gt;
;			   UnRegisters a verb for a file type in Explorer&lt;br /&gt;
; Parameter(s):  $ext - File Extension without period eg. &amp;quot;zip&amp;quot;&lt;br /&gt;
;			   $verb - Name of file action to remove&lt;br /&gt;
;					 eg. &amp;quot;Open with ProgramName&amp;quot; or &amp;quot;Extract Files&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;========================================&lt;br /&gt;
&lt;br /&gt;
 FileUnRegister(&amp;quot;uxy&amp;quot;, &amp;quot;Open in UXYFixer&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download here:&#039;&#039;&#039;&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?app=core&amp;amp;module=attach&amp;amp;section=attach&amp;amp;attach_id=26378 FileRegister.au3]&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my combobox (GUICtrlCreateCombo) show a dropdown list when clicked?==&lt;br /&gt;
When using GUICtrlCreateCombo be sure to enter the desired height for your combobox list in the &amp;quot;height&amp;quot; parameter. Windows XP automatically selects an appropriate height for combo boxes, but other versions of Windows usually do not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,20)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Would correctly be changed to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;$combo = GUICtrlCreateCombo(&amp;quot;&amp;quot;,10,10,200,200)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my thread getting any replies?==&lt;br /&gt;
&lt;br /&gt;
=== Asking the right question right ===&lt;br /&gt;
Did you give a good description of the problem? If your title or explanation of the issue is not descriptive, users are likely to bypass your issue instead of helping. Post titles such as &amp;quot;Help Me&amp;quot;, &amp;quot;I Have A Problem&amp;quot;, &amp;quot;Question&amp;quot;, &amp;quot;Help me fix my code&amp;quot;, &amp;quot;This code doesn&#039;t work&amp;quot; or similarly worded titles will not readily draw forum users to your post. Experienced users (which are your best hope of resolving the issue) will often skip your post altogether in cases like this. An example of a post title descriptive enough to attract users to assist you is &amp;quot;Problem with WinWaitClose&amp;quot; or &amp;quot;Loop never ends&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Example for reproduction ===&lt;br /&gt;
Did you post example code? If you have not posted an example of the code you are having an issue with, then you will not recieve support. When posting a non-working script, please do so in the smallest amount of stand-alone code possible. If the code you post cannot run by itself on another person&#039;s computer, they will not be able to recreate the issue.&lt;br /&gt;
&lt;br /&gt;
=== Speak English and speak it right ===&lt;br /&gt;
Did you use proper English? Here are guidelines for posting properly in the English language:&lt;br /&gt;
* Use proper case.  THIS IS CONSIDERED YELLING. If you post in ALL UPPERCASE or all lowercase then you will not be taken seriously.&lt;br /&gt;
* Use proper punctuation. Complete sentences need only one trailing punctuation mark. Twelve exclamation points after every sentence &amp;lt;b&amp;gt;will not&amp;lt;/b&amp;gt; get you an answer more quickly (just the opposite) Writing a sentence without simple punctuation such as commas reflects badly on your attention to detail, and is considered a good judge of the poster&#039;s coding style. If you cannot summon the intellect to write a sentence with correct punctuation, you will most likely miss simple coding mistakes such as unterminated quotes.&lt;br /&gt;
&lt;br /&gt;
=== Breaking forum rules, law, modesty, or common sense ===&lt;br /&gt;
Show common sense by following the forum rules, http://www.autoitscript.com/forum/topic/169097-forum-rules/, as well as generally accepted forum etiquette. Repeated failure to do so will result in sanctions by the Moderation team as it ruins the experience for everyone.&lt;br /&gt;
&lt;br /&gt;
==Why does the Ctrl key get stuck down after I run my script?==&lt;br /&gt;
&lt;br /&gt;
=== Keys virtually stuck ===&lt;br /&gt;
It could equally be the Shift or the Alt key.&lt;br /&gt;
&lt;br /&gt;
If you use Send in a script and you have a problem with keys being stuck down then Send is the most likely culprit. A similar problem can occur with BlockInput. The solution is generally quite simple. If there is a key like Shift or Alt held down at the start of the Send sequence, but that key is released by the time the Send sequence finishes then the key will get &#039;stuck&#039; down. As an example of a solution, you could replace the Send function in your script with the _SendEx function below.&lt;br /&gt;
&lt;br /&gt;
The _SendEx function waits for the Shift, Alt and Ctrl keys to be released or pops up a warning if the $warn parameter is not an empty string. Therefore it is not intended to be used when one of these modifier keys has been set to be down using any combination of {ALTDOWN}, {SHIFTDOWN} and {ALTDOWN}.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt; Misc.au3 &amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys are still down.&lt;br /&gt;
;Requires misc.au3 to be included in the script for the _IsPressed function.&lt;br /&gt;
&lt;br /&gt;
Func _SendEx($ss, $warn = &amp;quot;&amp;quot;)&lt;br /&gt;
	Local $iT = TimerInit()&lt;br /&gt;
&lt;br /&gt;
	While _IsPressed(&amp;quot;10&amp;quot;) Or _IsPressed(&amp;quot;11&amp;quot;) Or _IsPressed(&amp;quot;12&amp;quot;)&lt;br /&gt;
		If $warn &amp;lt;&amp;gt; &amp;quot;&amp;quot; And TimerDiff($iT) &amp;gt; 1000 Then&lt;br /&gt;
			MsgBox($MB_TOPMOST, &amp;quot;Warning&amp;quot;, $warn)&lt;br /&gt;
		EndIf&lt;br /&gt;
		Sleep(50)&lt;br /&gt;
	WEnd&lt;br /&gt;
	Send($ss)&lt;br /&gt;
EndFunc;==&amp;gt;_SendEx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== General unstuck method ===&lt;br /&gt;
Shilbiz also discovered that the following can &#039;clear&#039; locked down keys.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt; ControlSend(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;text&amp;quot;, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use Pixel functions?==&lt;br /&gt;
&lt;br /&gt;
=== Using a color change as an event ===&lt;br /&gt;
The following is an example of using the pixel to check if the colour has changed in a specific region.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $PixelCheck = 0, $NewCheck&lt;br /&gt;
$PixelCheck = PixelCheckSum(40, 50, 60, 70); Get the checksum for this area.&lt;br /&gt;
While 1; Keep going&lt;br /&gt;
	$NewCheck = PixelCheckSum(40, 50, 60, 70)&lt;br /&gt;
	If $PixelCheck &amp;lt;&amp;gt; $NewCheck Then&lt;br /&gt;
		; The old pixel checksum and the new one are different.&lt;br /&gt;
		$PixelCheck = $NewCheck; Update the $PixelCheck to the new value&lt;br /&gt;
		; Let us know it has changed.  Change this to what you want to happen when the colour in the region changes.&lt;br /&gt;
		Msgbox($MB_ICONWARNING,&amp;quot;PixelChecksum&amp;quot;,&amp;quot;Pixel region has changed !&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
	Sleep(50); Just to give the CPU a bit of a break.&lt;br /&gt;
Wend&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Searching for a specific pixel color ===&lt;br /&gt;
This is an example of searching for a specific pixel (red), both pure red (0xFF0000) and red in a few different shades.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
; Find a pure red pixel in the range 0,0-20,300&lt;br /&gt;
&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Find a pure red pixel or a red pixel within 10 shades variations of pure red&lt;br /&gt;
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )&lt;br /&gt;
If Not @error Then&lt;br /&gt;
	MsgBox($MB_OK, &amp;quot;X and Y are:&amp;quot;, $coord[0] &amp;amp; &amp;quot;,&amp;quot; &amp;amp; $coord[1])&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t my script work on a locked workstation?==&lt;br /&gt;
On a locked station any window will never be active (active is only dialog with text &amp;quot;Press Ctrl+Alt+Del&amp;quot;).  In Windows locked state applications run hidden (behind that visible dialog) and do not have focus and active status.  So generally don&#039;t use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc.  Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc.  Doing so allows you to interact with an application regardless of whether it is active or not. It&#039;s possible to run such a script from scheduler on locked Windows stations.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn AutoIt? Are there any tutorials?==&lt;br /&gt;
AutoIt is a constantly growing and evolving language with a diverse and engaged community of volunteers. This wiki, along with the official forum, will always be your best place for answers to questions as well as examples and tutorials. With this in mind, below are a few resources that can also help you as you become familiar with the language:&lt;br /&gt;
&lt;br /&gt;
AutoIt 1-2-3, an interactive classroom by Valuater:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=21048 http://www.autoitscript.com/forum/index.php?showtopic=21048]&lt;br /&gt;
&lt;br /&gt;
BrettF&#039;s updated AutoIt tutorial:&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php?showtopic=84960 http://www.autoitscript.com/forum/index.php?showtopic=84960]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Learn To Program Using FREE Tools with AutoIt&amp;quot; PDF Book by Jfish&lt;br /&gt;
[https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/ Learn To Program Using FREE Tools with AutoIt]&lt;br /&gt;
&lt;br /&gt;
YouTube has a number of videos available:&lt;br /&gt;
[http://www.youtube.com/results?search_query=autoit+tutorial&amp;amp;search_type=&amp;amp;aq=0&amp;amp;oq=AutoIt YouTube AutoIt tutorials list]&lt;br /&gt;
&lt;br /&gt;
As always, when asking questions about a video or script you saw on an external source, please ensure you are adhering to the [[FAQ#Breaking_forum_rules.2C_law.2C_modesty.2C_or_common_Sense|forum rules]].&lt;br /&gt;
&lt;br /&gt;
==Why does my script no longer decompile?==&lt;br /&gt;
Decompilation is no longer supported, and is only available for the older versions of AutoIt (Version 3.2.5.1 and earlier compiled scripts).&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;do not&#039;&#039;&#039; post on this topic; see the [[Decompiling FAQ]] for more information. Topics discussing decompilation of scripts will be locked immediately. Posting the source of a decompiled script with lead to immediate sanctions from the Moderation team, as it directly violates AutoIt EULA (End-User-License-Agreement).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;i&amp;gt;You may not reverse engineer or disassemble the SOFTWARE PRODUCT or compiled scripts that were created with the SOFTWARE PRODUCT.&amp;lt;/i&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How can I get a window handle when all I have is a PID?==&lt;br /&gt;
Refer to the following example showing converting and use when manipulating the window. The function is based on work by Smoke_N/Hubertus and Helge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Run process&lt;br /&gt;
$iPID = Run(&amp;quot;Notepad.exe&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;Allow window to initialize...&lt;br /&gt;
Sleep (500)&lt;br /&gt;
&lt;br /&gt;
;Get HWND.&lt;br /&gt;
$hWnd = _GetHwndFromPID($iPID)&lt;br /&gt;
&lt;br /&gt;
;Maximize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MAXIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Minimize&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_MINIMIZE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Restore window&lt;br /&gt;
WinSetState($hWnd, &amp;quot;&amp;quot;, @SW_RESTORE)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Move top left corner of screen, and resize to 800x600&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, 0, 0, 800, 600)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Calculate Center of screen.&lt;br /&gt;
$x = (@DesktopWidth / 2) - 400; Desktop width divided by 2, then minus half the width of the window&lt;br /&gt;
$y = (@DesktopHeight / 2) - 300; Desktop height divided by 2, then minus half the height of the window&lt;br /&gt;
&lt;br /&gt;
;Move to center of screen&lt;br /&gt;
WinMove($hWnd, &amp;quot;&amp;quot;, $x, $y)&lt;br /&gt;
&lt;br /&gt;
;Wait 2 seconds&lt;br /&gt;
Sleep(2000)&lt;br /&gt;
&lt;br /&gt;
;Close notepad&lt;br /&gt;
WinClose($hWnd)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Function for getting HWND from PID&lt;br /&gt;
Func _GetHwndFromPID($PID)&lt;br /&gt;
	$hWnd = 0&lt;br /&gt;
	$winlist = WinList()&lt;br /&gt;
	Do&lt;br /&gt;
		For $i = 1 To $winlist[0][0]&lt;br /&gt;
			If $winlist[$i][0] &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
				$iPID2 = WinGetProcess($winlist[$i][1])&lt;br /&gt;
				If $iPID2 = $PID Then&lt;br /&gt;
					$hWnd = $winlist[$i][1]&lt;br /&gt;
					ExitLoop&lt;br /&gt;
				EndIf&lt;br /&gt;
			EndIf&lt;br /&gt;
		Next&lt;br /&gt;
	Until $hWnd &amp;lt;&amp;gt; 0&lt;br /&gt;
	Return $hWnd&lt;br /&gt;
EndFunc;==&amp;gt;_GetHwndFromPID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I use single or double quotes in strings?==&lt;br /&gt;
It is a fairly simple concept once you get the basics down.  Basically there are a few different ways to go about mixing quotes in strings.&lt;br /&gt;
&lt;br /&gt;
A string in AutoIt can be encased in either single(&#039;) or double (&amp;quot;) quotes.  So if you want to add only one type of quote into your string, your first port of call is to use the other type of quote to encase the string.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &amp;quot;I am a &#039;quote&#039; inside the string&amp;quot;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&lt;br /&gt;
$var = &#039;I wish I could be a &amp;quot;quote&amp;quot; inside the string!&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have to have both types of quotes in the string, the easiest way is to escape the quote ending the string as so to speak.  To do this, use two quotes instead of one.  Like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$var = &#039;I am a single &#039;&#039;quote&#039;&#039; inside the string made using &amp;quot;single quote!&amp;quot;&#039;&lt;br /&gt;
MsgBox ($MB_OK, &amp;quot;Test 1&amp;quot;, $var)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==When should I bump my threads?==&lt;br /&gt;
As a courtesy to other users you should only bump your post once in a 24 hour period.  Doing this allows all users the chance to get helped equally.  Also refer to [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;view=findpost&amp;amp;p=688050 Why isn&#039;t my thread getting any replies?], as this will help you get replies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can I protect my code from decompilation?==&lt;br /&gt;
The fact of the matter is &#039;&#039;&#039;you can&#039;t fully protect your code&#039;&#039;&#039;.  AutoIt is an  interpreted language, so all scripts are interpreted, and that script has to get stored somewhere.  There is still hope though.  You can take certain measures to make the decompiled code less usable to the person that decompiled it.  The first step is to obfuscate your code.  This causes the code to become less readable.  Basically variables and functions are renamed, making it very hard to make head or tail of what is what.&lt;br /&gt;
&lt;br /&gt;
Please see the [[Decompiling FAQ]] for more information.&lt;br /&gt;
&lt;br /&gt;
==How can I decompile my AutoIt EXEs?==&lt;br /&gt;
You cannot decompile your AutoIt compiled scripts unless it was compiled with AutoIt 3.2.5.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
In order to be able to recover your script from the compiled executable, you can use the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;;Original Author SmokeN&lt;br /&gt;
If $CMDLINE[0] Then&lt;br /&gt;
	If $CMDLINE[1] == &amp;quot;/SOURCE&amp;quot; AND $CMDLINE[2] == &amp;quot;MYPASSWORD&amp;quot; Then&lt;br /&gt;
		FileInstall(&amp;quot;ThisSCript.au3&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\DecompiledScript.au3&amp;quot;)&lt;br /&gt;
	EndIf&lt;br /&gt;
EndIf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then if you run the compiled script with the following command line parameters your source will be extracted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;myscript.exe /SOURCE MYPASSWORD&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What is proper forum etiquette?  What rules are there for the forum?==&lt;br /&gt;
Proper forum etiquette will ensure you will stay a member of these forums.  So try to follow these rules.  Also see this [http://www.autoitscript.com/forum/index.php?showtopic=95704&amp;amp;st=15&amp;amp;p=688050&amp;amp;#entry688050 FAQ post], as you should follow what is outlined there as well.&lt;br /&gt;
&lt;br /&gt;
* Use proper English.  MSN speak and the like makes it very hard to understand what you want.  Keep posts in proper case because UPPERCASE is considered yelling and lowercase makes you look stupid.  Don&#039;t use more punctuation marks than necessary. For example ?!!!? and ????? is completely unnecessary.&lt;br /&gt;
* Before posting help with a script, make sure you follow these steps:&lt;br /&gt;
*# Search for your issue.&lt;br /&gt;
*#* There are many thousands of posts on this forum, and chances are your question has been asked before.  Make sure to use a variety of terms to maximize your results.&lt;br /&gt;
*# Read the helpfile&lt;br /&gt;
*#* Most if not all things in the help file will have an example (native functions) or two.  Give them a go to try see how the functions work.  Most of the time it helps!&lt;br /&gt;
*# Give it a go&lt;br /&gt;
*#* Seriously, if you can&#039;t be bothered to give it a go, then why should we be bothered to help you?  If you feel you can&#039;t do it and you don&#039;t try then how will you ever know?  We always prefer that you give it a go because you can learn from your mistakes and hopefully understand it better.&lt;br /&gt;
*# Post your problem&lt;br /&gt;
*#* Make sure you post in the correct forum.&lt;br /&gt;
*#** &amp;lt;b&amp;gt;AutoIt Specific&amp;lt;/b&amp;gt;&lt;br /&gt;
*#*** [https://www.autoitscript.com/forum/forum/2-autoit-general-help-and-support/ General Help and Support] (Most support questions)&lt;br /&gt;
*#*** [https://www.autoitscript.com/forum/forum/10-autoit-gui-help-and-support/ GUI Support] (Support for the Graphical User Interface)&lt;br /&gt;
*#*** [https://www.autoitscript.com/forum/forum/14-autoitx-help-and-support/ AutoItX Support] (Support for the COM, DLL, PowerShell and .NET add-ons for AutoIt)&lt;br /&gt;
*#** &amp;lt;b&amp;gt;Non-AutoIt&amp;lt;/b&amp;gt;&lt;br /&gt;
*#*** Chat&lt;br /&gt;
*#*** Developer Chat&lt;br /&gt;
*#* Include a detailed description in the content of the post, and a detailed title&lt;br /&gt;
*#** Titles such as &#039;Help&#039; and &#039;What&#039;s wrong?&#039; are not acceptable.  To get the most help with your problem, be as descriptive as you can in the title, but keep in mind your title cannot be too long.&lt;br /&gt;
*#** Make sure you also include a descriptive question.  Just saying &#039;what is wrong with the following&#039; is also not acceptable, as we will have no idea what the problem is.  Describe what you think is wrong and what is not working.  It makes our job easier.&lt;br /&gt;
*#* Always include your code&lt;br /&gt;
*#** It shows us that you have tried and gives us a head start with something to play with.&lt;br /&gt;
* Usually asking for a script is not taken too well, within reason.  Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.  If you do need something written for you, maybe try  [http://www.rentacoder.com/ RentACoder], as they are more suited to requests.&lt;br /&gt;
* Don&#039;t PM other members asking for them to look at threads of to help you unless they request it.  It is actually quite rude and annoying to receive PMs of that nature.&lt;br /&gt;
* Lurk a little before you dive right in. Read a number of posts, or check out the group&#039;s archives. Get a feel for the tone of the forum so you can participate accordingly.&lt;br /&gt;
* Say online exactly what you would say in person. In other words, if you wouldn&#039;t say it to the person&#039;s face in front of your Grandmother, you shouldn&#039;t type it here.&lt;br /&gt;
* Remember your face doesn&#039;t show. Words alone can convey sentiment, but without benefit of inflection or facial expression, they can be misconstrued. Use descriptive wording, emoticons or .gifs to ensure your meaning is clear. By the same token, don&#039;t jump to conclusions about another person&#039;s intent in posting an unclear comment. When in doubt, ask for clarification.&lt;br /&gt;
* Be respectful. Internet etiquette is similar to standard etiquette in this area. Appreciate that your opinion is one of many. You can disagree with another person without being disrespectful or rude to other people.&lt;br /&gt;
* Ignore Trolls. If you engage in conversation with one, you&#039;ll raise your blood pressure and empower the troll. You can&#039;t win a flame war, and you can&#039;t sway a troll&#039;s opinion. Often, they don&#039;t even care about the subject.  They live for the conflict and nothing more. Trolls are common and not worthy of your time. Ignore their posts no matter how inflammatory and eventually they&#039;ll get bored and move on.&lt;br /&gt;
* When you have found an answer for your question:&lt;br /&gt;
*# Do not edit your post to be blank or to have worthless information.  People may be searching for the same issue you have, so be courteous to them by leaving your question there.&lt;br /&gt;
*# It is also optional to add the word [SOLVED] into the title, as well as selecting the post that best answered your question. It can make the lives of people searching easier.&lt;br /&gt;
* Finally follow the rules:&lt;br /&gt;
** [http://www.autoitscript.com/forum/topic/169097-forum-rules/ Forum rules]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=54168 Rules for the Chat forum]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=65889 Rules for asking for source code]&lt;br /&gt;
** [http://www.autoitscript.com/forum/index.php?showtopic=37739 General policies and forum settings]&lt;br /&gt;
&lt;br /&gt;
Some general points taken from [http://www.ehow.com/how_2106033_use-proper-forum-etiquette.html here].&lt;br /&gt;
&lt;br /&gt;
==Are there forums available in my local language?==&lt;br /&gt;
Yes there are some available.  Some forum members here participate in multiple forums.&lt;br /&gt;
* [http://www.autoit.de/ German Forums]&lt;br /&gt;
* [http://www.autoit.fr/  French Forums]&lt;br /&gt;
* [http://www.autoit.es/ Spanish Forums]&lt;br /&gt;
* [http://autoit-script.ru/ Russian Forums]&lt;br /&gt;
* [http://forum.autoitbrasil.com/ Portuguese Forums]&lt;br /&gt;
&lt;br /&gt;
Please note that these are independent, community-run message boards and not just a translation of this board.&lt;br /&gt;
&lt;br /&gt;
==How can I control (click, edit etc) an external (html) application?==&lt;br /&gt;
You can use the control* functions of autoit see helpfile&lt;br /&gt;
of use specific udf libraries&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ IUIAutomation for multiple applications]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/154439-chrome-udf/ chrome chrome.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/149526-librariesieau3/ Internet explorer ie.au3]&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ firefox ff.au3] (End of life)&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/ java]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?&amp;amp;q=Selenium Selenium]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version/ WebDriver UDF (IE, Chrome, FireFox)]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should use spy applications to identify objects like&lt;br /&gt;
* au3inf part of AutoIT&lt;br /&gt;
* [http://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ simplespy in the zip]&lt;br /&gt;
* jabsimplespy in examples section of the AutoIt forum&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/126716-control-viewer-autoit-window-info-tool/ control viewer]&lt;br /&gt;
* inspect as part of windows SDK&lt;br /&gt;
* VisualUIAVerifyNative.exe as part of windows SDK (8.1)&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If above spy tools are not identifying your object you could try commercial tools (trials) like&lt;br /&gt;
* ranorex spy&lt;br /&gt;
* Testcomplete&lt;br /&gt;
* HP UFT&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And your last recognition can be bitmaps&lt;br /&gt;
* search for GDI&lt;br /&gt;
* search for findBMP&lt;br /&gt;
* search for imagesearch&lt;br /&gt;
&lt;br /&gt;
==Does AutoIt support database connections, such as SQL?==&lt;br /&gt;
Yes! UDFs exist for several popular SQL solutions, including SQLite, Firebird, MySQL, MSSQL and ODBC connections for PostGreSQL and others.&lt;br /&gt;
&lt;br /&gt;
For an illustrative list, see this link:&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections Database and Web Connections]&lt;br /&gt;
&lt;br /&gt;
A DBF UDF also exists&lt;br /&gt;
&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/145142-dbf-udf-dbase-database-read-and-write-with-dll/ DBF UDF dBase with DLL]&lt;br /&gt;
&lt;br /&gt;
==How can I include some files into my compiled Autoit&#039;s EXE?==&lt;br /&gt;
Use FileInstall() or ResourcesEx UDF from the forum Examples.  Additional resources can also be included at compile time, click the &amp;quot;Res Add Files&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
==How can I test if checkbox / radiobutton is checked?==&lt;br /&gt;
Use this small function: If IsChecked($checkbox1) Then ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Zedna&lt;br /&gt;
Func IsChecked($control)&lt;br /&gt;
	Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED&lt;br /&gt;
EndFunc   ;==&amp;gt;IsChecked&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to use the {enter} key as a Tab?==&lt;br /&gt;
Use &lt;br /&gt;
[https://www.autoitscript.com/autoit3/docs/functions/GUISetAccelerators.htm Accelerator keys]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; by Melba23&lt;br /&gt;
#include &amp;lt;GUIConstantsEx.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;WinAPI.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$hGUI = GUICreate(&amp;quot;Test&amp;quot;, 500, 500)&lt;br /&gt;
&lt;br /&gt;
$cInput_1 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 10, 200, 20)&lt;br /&gt;
$cInput_2 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 50, 200, 20)&lt;br /&gt;
$cInput_3 = GUICtrlCreateInput(&amp;quot;&amp;quot;, 10, 90, 200, 20)&lt;br /&gt;
&lt;br /&gt;
$cButton_1 = GUICtrlCreateButton(&amp;quot;Button 1&amp;quot;, 250, 10, 80, 30)&lt;br /&gt;
$cButton_2 = GUICtrlCreateButton(&amp;quot;Button 2&amp;quot;, 250, 50, 80, 30)&lt;br /&gt;
$cButton_3 = GUICtrlCreateButton(&amp;quot;Button 3&amp;quot;, 250, 90, 80, 30)&lt;br /&gt;
&lt;br /&gt;
$cEnter = GUICtrlCreateDummy()&lt;br /&gt;
&lt;br /&gt;
GUISetState()&lt;br /&gt;
&lt;br /&gt;
Local $aAccelKeys[2][2] = [[&amp;quot;{ENTER}&amp;quot;, $cEnter], [&amp;quot;{TAB}&amp;quot;, $cEnter]] ; Make {TAB} an accelerator&lt;br /&gt;
GUISetAccelerators($aAccelKeys)&lt;br /&gt;
&lt;br /&gt;
While 1&lt;br /&gt;
&lt;br /&gt;
	Switch GUIGetMsg()&lt;br /&gt;
		Case $GUI_EVENT_CLOSE&lt;br /&gt;
			Exit&lt;br /&gt;
		Case $cEnter&lt;br /&gt;
			Switch _WinAPI_GetFocus()&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_1)&lt;br /&gt;
					; Check the input content&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						; Correct so move to next input&lt;br /&gt;
						GUICtrlSetState($cInput_2, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
					; Not correct so stay in current input&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_2)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						GUICtrlSetState($cInput_3, $GUI_FOCUS)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case GUICtrlGetHandle($cInput_3)&lt;br /&gt;
					If checkEntry() = True Then&lt;br /&gt;
						ConsoleWrite(&amp;quot;End&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
					EndIf&lt;br /&gt;
				Case Else&lt;br /&gt;
					GUISetAccelerators(0) ; Remove accelerator link&lt;br /&gt;
					ControlSend($hGUI, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;{TAB}&amp;quot;) ; Send {TAB} to the GUI&lt;br /&gt;
					GUISetAccelerators($aAccelKeys) ; Reset the accelerator&lt;br /&gt;
&lt;br /&gt;
			EndSwitch&lt;br /&gt;
	EndSwitch&lt;br /&gt;
&lt;br /&gt;
WEnd&lt;br /&gt;
&lt;br /&gt;
Func checkEntry()&lt;br /&gt;
&lt;br /&gt;
	; Random chance of correct answer or fail&lt;br /&gt;
	If Mod(@SEC, 2) = 0 Then&lt;br /&gt;
		MsgBox($MB_SYSTEMMODAL, &amp;quot;Test Fail&amp;quot;, &amp;quot;Press Enter to close this message box&amp;quot;)&lt;br /&gt;
		Return False&lt;br /&gt;
	EndIf&lt;br /&gt;
	Return True&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;checkEntry&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Why are my number sort results wrong?==&lt;br /&gt;
AutoIt by default uses an alpha sort algorithm. This means that ABC is sorted correctly, but it sorts numbers as 1,10,2,22,3,31 where the user expects 1,2,3,10,22,31.&lt;br /&gt;
This can be remedied by using a custom sort function. An example of such a custom number sort by Valuater appears below.  Search the Forum for [https://www.autoitscript.com/forum/topic/95383-sorting-numbers/ Number Sort] and [https://www.autoitscript.com/forum/topic/83626-natural-order-string-comparison/ Natural Order String Comparison] &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Valuater&lt;br /&gt;
#include &amp;lt;array.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$Array = StringSplit(&amp;quot;2,5,3,4,6,1,8,9,7&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
_ArraySortNum($Array)&lt;br /&gt;
&lt;br /&gt;
_ArrayDisplay($Array, &amp;quot;Sorted Array&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Func _ArraySortNum(ByRef $n_array, $i_descending = 0, $i_start = 1)&lt;br /&gt;
	Local $i_ub = UBound($n_array)&lt;br /&gt;
	For $i_count = $i_start To $i_ub - 2&lt;br /&gt;
		Local $i_se = $i_count&lt;br /&gt;
		If $i_descending Then&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;lt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		Else&lt;br /&gt;
			For $x_count = $i_count To $i_ub - 1&lt;br /&gt;
				If Number($n_array[$i_se]) &amp;gt; Number($n_array[$x_count]) Then $i_se = $x_count&lt;br /&gt;
			Next&lt;br /&gt;
		EndIf&lt;br /&gt;
		Local $i_hld = $n_array[$i_count]&lt;br /&gt;
		$n_array[$i_count] = $n_array[$i_se]&lt;br /&gt;
		$n_array[$i_se] = $i_hld&lt;br /&gt;
	Next&lt;br /&gt;
EndFunc   ;==&amp;gt;_ArraySortNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How do I include AutoIt functions in a C# / C++ / VB programme? AutoItX==&lt;br /&gt;
AutoIt is also supplied as a combined COM and DLL version of AutoIt called AutoItX that allows you to add the unique features of AutoIt to your own favourite scripting or programming languages!&lt;br /&gt;
[https://www.autoitscript.com/site/autoit/ Info on AutoItX] &lt;br /&gt;
&lt;br /&gt;
From AutoItX.chm:&lt;br /&gt;
AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs.&lt;br /&gt;
&lt;br /&gt;
Here are some C++ source code samples from various projects by [https://www.autoitscript.com/forum/profile/1-jon/ Jon]. Most are free to use but check any license files that accompany the downloads for details.  All code was created in Microsoft Visual C (6 and 7) but most would probably compile under mingw32 as well.&lt;br /&gt;
[https://www.autoitscript.com/site/code/ Download C++ examples for AutoItX] &lt;br /&gt;
&lt;br /&gt;
You don&#039;t need to regsvr it if you are using the c# library. The c# library uses the non-COM part of the DLL so it just needs to be in the same folder as the exe and add the assembly.dll to your project. From the documenation:&lt;br /&gt;
&lt;br /&gt;
Using the Assembly from VB/C# within in Visual Studio is very easy:&lt;br /&gt;
* Add a reference to AutoItX3.Assembly.dll to your project&lt;br /&gt;
* Add a using AutoIt; statement in the files you want to use AutoIt functions&lt;br /&gt;
* Distribute your final executable with the files AutoItX3.Assembly.dll, AutoItX3.dll, AutoItX3_x64.dll.&lt;br /&gt;
* Write code like this C# example:&lt;br /&gt;
    using AutoIt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; by Jon&lt;br /&gt;
   // Wow, this is C#!&lt;br /&gt;
    AutoItX.Run(&amp;quot;notepad.exe&amp;quot;);&lt;br /&gt;
    AutoItX.WinWaitActive(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.Send(&amp;quot;I&#039;m in notepad&amp;quot;);&lt;br /&gt;
    IntPtr winHandle = AutoItX.WinGetHandle(&amp;quot;Untitled&amp;quot;);&lt;br /&gt;
    AutoItX.WinKill(winHandle);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the AutoItX Help File (included in the default AutoIt install):&lt;br /&gt;
AutoItX can be used as a standard DLL from any language capable of calling functions in external DLLs.&lt;br /&gt;
&lt;br /&gt;
The following files are provided to allow you to use the DLL in C++:&lt;br /&gt;
&lt;br /&gt;
* AutoItX3_DLL.h - C language header file showing the exported functions and parameters&lt;br /&gt;
* AutoItX3_DLL.lib - Microsoft format import library (x86)&lt;br /&gt;
* AutoItX3_x64_DLL.lib - Microsoft format import library (x64)&lt;br /&gt;
* AutoItX3.dll - The main AutoItX DLL (x86)&lt;br /&gt;
* AutoItX3_x64.dll - The main AutoItX DLL (x64)&lt;br /&gt;
&lt;br /&gt;
==How can I search an image in another image? ==&lt;br /&gt;
You can use the Pixel* functions of AutoIt. See the help file for more information and examples.&lt;br /&gt;
You can also use one of the UDFs below; most of which use GDI:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/158264-bmpsearch-search-for-bitmap-within-bitmap-assembly-version/ FASM example]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/140478-bitmap-processing-using-raw-code/ asm bitmap processing]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/ find bitmap in bitmap]&lt;br /&gt;
* [https://www.autoitscript.com/forum/search/?type=all&amp;amp;q=_GDIPlus_BitmapLockBits/ GDI bitmaps]&lt;br /&gt;
Other libraries can be found that make use of a specific external dll but those above are considered &amp;quot;native&amp;quot; as no external dlls are required.&lt;br /&gt;
&lt;br /&gt;
==Multithreading==&lt;br /&gt;
Multithreading basically is running multiple scripts/programs that have acces to the same variables, normally by sharing memory. &lt;br /&gt;
&lt;br /&gt;
The AutoIt language is not threadsafe and multithreading is firmly on the &amp;lt;b&amp;gt;NOT TO DO&amp;lt;/b&amp;gt; list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Multitasking and Multi&amp;lt;i&amp;gt;processing&amp;lt;/i&amp;gt; are closely related, however, and multiple solutions have been explored:&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25350-multithread/ Multithread technical discussion]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/25494-threaded-dll-sample/ Multithread with external DLL]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/146794-multi-thread-autoit/ Multithread with external DLL 2]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/64390-how-to-multi-process-in-autoit/ Multi process]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/187334-using-net-libary-with-autoit-possible/ Using C# - Host .NET]&lt;br /&gt;
&lt;br /&gt;
==Test automation==&lt;br /&gt;
Many people are looking for freeware tools to do test automation and cannot afford the commercial tools like HP LeanFT, Ranorex, Squish etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
So how can AutoIt help you.&amp;lt;br /&amp;gt;&lt;br /&gt;
Out of the box install the base full zip package and start Scite.Exe as a simple IDE.&amp;lt;br /&amp;gt;&lt;br /&gt;
If you want to do more these links will help you.&amp;lt;br /&amp;gt;&lt;br /&gt;
Read FAQ 31 for the basic stuff on which technologies are readable and which spying tools there are&amp;lt;br /&amp;gt;&lt;br /&gt;
Read FAQ 38 for the bitmap stuff&amp;lt;br /&amp;gt;&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/136766-isn-autoit-studio/ Alternative project IDE]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/188158-net-common-language-runtime-clr-framework/ .NET stuff]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ WinHTTP]&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/185401-restwhich-udf-to-use-webdriver-of-edge/ webdriver]&lt;br /&gt;
Android can be reached thru ADB and Webdriver&amp;lt;br /&amp;gt;&lt;br /&gt;
iOS is limited to normal webdriver stuff thru WinHTTP library. So most likely you have to install additional iOS webdriver solutions&amp;lt;br /&amp;gt;&lt;br /&gt;
And after reading FAQ just ask your questions in the support forum&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Danp2</name></author>
	</entry>
</feed>