<?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=MLipok</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=MLipok"/>
	<link rel="alternate" type="text/html" href="https://www.autoitscript.com/wiki/Special:Contributions/MLipok"/>
	<updated>2026-04-10T18:24:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=15152</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=15152"/>
		<updated>2025-07-09T21:37:45Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* References */ List of Chromium Command Line Switches - current source 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;
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;
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;
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;
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;
== Getting started example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;wd_helper.au3&amp;quot;&lt;br /&gt;
#include &amp;quot;wd_capabilities.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
_Example()&lt;br /&gt;
&lt;br /&gt;
Func _Example()&lt;br /&gt;
	# REMARK&lt;br /&gt;
	#   This is not functional script&lt;br /&gt;
	#   It only shows the concept how to use WebDriver UDF&lt;br /&gt;
&lt;br /&gt;
	#Region ; initialize webdriver sesion&lt;br /&gt;
&lt;br /&gt;
	; you should take care about download/update dirver&lt;br /&gt;
	If $IDYES = MsgBox($MB_YESNO + $MB_TOPMOST + $MB_ICONQUESTION + $MB_DEFBUTTON1, &amp;quot;Question&amp;quot;, _&lt;br /&gt;
			&amp;quot;Do you want to download/update driver ?&amp;quot;) Then&lt;br /&gt;
		_WD_UpdateDriver(&#039;chrome&#039;)&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	; specify driver, port and other options&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;DriverParams&#039;, &#039;--verbose --log-path=&amp;quot;&#039; &amp;amp; @ScriptDir &amp;amp; &#039;\chrome.log&amp;quot;&#039;)&lt;br /&gt;
&lt;br /&gt;
	; start the driver&lt;br /&gt;
	_WD_Startup()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; create capabilites for session&lt;br /&gt;
	_WD_CapabilitiesStartup()&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;alwaysMatch&#039;, &#039;chrome&#039;)&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;w3c&#039;, True)&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;excludeSwitches&#039;, &#039;enable-automation&#039;)&lt;br /&gt;
	Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&lt;br /&gt;
	; create session with given Capabilities&lt;br /&gt;
	Local $WD_SESSION = _WD_CreateSession($sCapabilities)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; initialize webdriver sesion&lt;br /&gt;
&lt;br /&gt;
	#Region ; do your&#039;s stuff&lt;br /&gt;
&lt;br /&gt;
	; navigate to some website&lt;br /&gt;
	Local $sURL = &#039;******&#039;&lt;br /&gt;
	_WD_Navigate($WD_SESSION, $sURL)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; wait for loading process ends&lt;br /&gt;
	_WD_LoadWait($WD_SESSION, 1000)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; for example find element&lt;br /&gt;
	Local $sXPath = &amp;quot;*****&amp;quot;&lt;br /&gt;
	Local $sElement = _WD_FindElement($WD_SESSION, $_WD_LOCATOR_ByXPath, $sXPath)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; get element text&lt;br /&gt;
	Local $sText = _WD_ElementAction($WD_SESSION, $sElement, &#039;text&#039;)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
	ConsoleWrite($sText &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
	; or click the element&lt;br /&gt;
	_WD_ElementAction($WD_SESSION, $sElement, &#039;click&#039;)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; do your&#039;s stuff&lt;br /&gt;
&lt;br /&gt;
	#Region ; Clean Up&lt;br /&gt;
&lt;br /&gt;
	; on the end session should be deleted&lt;br /&gt;
	_WD_DeleteSession($WD_SESSION)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; and driver should be closed&lt;br /&gt;
	_WD_Shutdown()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; Clean Up&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;_Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function reference ==&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;
==== 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;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 for FireFox] or [https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/page/2/#comment-1505978  this post for Google Chrome].&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 (or any other) 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;
&lt;br /&gt;
In order to preset autodowloading another file type you have to change it accordingly by providing your desired MIME type:&lt;br /&gt;
&lt;br /&gt;
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types&lt;br /&gt;
&lt;br /&gt;
specifically here:&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;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;
&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-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: Use _WD_CapabilitiesDefine() function like int the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesDefine($_WD_CAPS_TYPES__SPECIFICVENDOR_ARRAY, &#039;NewCapabilityArray&#039;)&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-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 use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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-FAQ18&amp;quot;&amp;gt;18. How to troubleshoot when you can&#039;t locate the desired element using _WD_FindElement() ?&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-FAQ18&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
When you encounter a problem locating an item with _WD_FindElement() you should follow this procedure:&lt;br /&gt;
&lt;br /&gt;
WIP....&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) is valid&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find one or multiple instances of the element&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find element in different frame or if this is within #shadow-root&lt;br /&gt;
* use _WD_FrameList() to check if you have multiple even nested frames in website you are trying to automate&lt;br /&gt;
* use _WD_LocateElement() to check Element location within multiple even nested frames&lt;br /&gt;
* use _WD_FrameEnter() to change frame to be able to use _WD_FindElement() in order to find element within desired frame&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&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;
== 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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for Firefox], [https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof Save Page WE for Chrome])&lt;br /&gt;
* [https://github.com/openstyles/stylus Stylus]﻿ ﻿Stylus is a fork of Stylish for Chrome, also compatible with Firefox as a WebExtension&lt;br /&gt;
&lt;br /&gt;
== References ==&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/208633-webdriver-udf-w3c-compliant-version-20221003/ 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;
** [https://github.com/mlipok/Au3WebDriver-testing Au3WebDriver-testing - Some complex template for testing Au3WebDriver cases]&lt;br /&gt;
** [https://github.com/Sven-Seyfert/au3webdriver-boilerplate The project &amp;quot;au3webdriver-boilerplate&amp;quot; - A quick entry point for the au3WebDriver project]&lt;br /&gt;
** [https://chromium.googlesource.com/chromium/src.git/+/refs/heads/master/chrome/common/chrome_switches.cc List of Chromium Command Line Switches - current source code]&lt;br /&gt;
** [https://peter.sh/experiments/chromium-command-line-switches/ List of Chromium Command Line Switches - a human readable docs]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=15151</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=15151"/>
		<updated>2025-07-09T20:55:37Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* References */ List of Chromium Command Line Switches&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;
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;
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;
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;
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;
== Getting started example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;wd_helper.au3&amp;quot;&lt;br /&gt;
#include &amp;quot;wd_capabilities.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
_Example()&lt;br /&gt;
&lt;br /&gt;
Func _Example()&lt;br /&gt;
	# REMARK&lt;br /&gt;
	#   This is not functional script&lt;br /&gt;
	#   It only shows the concept how to use WebDriver UDF&lt;br /&gt;
&lt;br /&gt;
	#Region ; initialize webdriver sesion&lt;br /&gt;
&lt;br /&gt;
	; you should take care about download/update dirver&lt;br /&gt;
	If $IDYES = MsgBox($MB_YESNO + $MB_TOPMOST + $MB_ICONQUESTION + $MB_DEFBUTTON1, &amp;quot;Question&amp;quot;, _&lt;br /&gt;
			&amp;quot;Do you want to download/update driver ?&amp;quot;) Then&lt;br /&gt;
		_WD_UpdateDriver(&#039;chrome&#039;)&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	; specify driver, port and other options&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;DriverParams&#039;, &#039;--verbose --log-path=&amp;quot;&#039; &amp;amp; @ScriptDir &amp;amp; &#039;\chrome.log&amp;quot;&#039;)&lt;br /&gt;
&lt;br /&gt;
	; start the driver&lt;br /&gt;
	_WD_Startup()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; create capabilites for session&lt;br /&gt;
	_WD_CapabilitiesStartup()&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;alwaysMatch&#039;, &#039;chrome&#039;)&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;w3c&#039;, True)&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;excludeSwitches&#039;, &#039;enable-automation&#039;)&lt;br /&gt;
	Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&lt;br /&gt;
	; create session with given Capabilities&lt;br /&gt;
	Local $WD_SESSION = _WD_CreateSession($sCapabilities)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; initialize webdriver sesion&lt;br /&gt;
&lt;br /&gt;
	#Region ; do your&#039;s stuff&lt;br /&gt;
&lt;br /&gt;
	; navigate to some website&lt;br /&gt;
	Local $sURL = &#039;******&#039;&lt;br /&gt;
	_WD_Navigate($WD_SESSION, $sURL)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; wait for loading process ends&lt;br /&gt;
	_WD_LoadWait($WD_SESSION, 1000)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; for example find element&lt;br /&gt;
	Local $sXPath = &amp;quot;*****&amp;quot;&lt;br /&gt;
	Local $sElement = _WD_FindElement($WD_SESSION, $_WD_LOCATOR_ByXPath, $sXPath)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; get element text&lt;br /&gt;
	Local $sText = _WD_ElementAction($WD_SESSION, $sElement, &#039;text&#039;)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
	ConsoleWrite($sText &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
	; or click the element&lt;br /&gt;
	_WD_ElementAction($WD_SESSION, $sElement, &#039;click&#039;)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; do your&#039;s stuff&lt;br /&gt;
&lt;br /&gt;
	#Region ; Clean Up&lt;br /&gt;
&lt;br /&gt;
	; on the end session should be deleted&lt;br /&gt;
	_WD_DeleteSession($WD_SESSION)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; and driver should be closed&lt;br /&gt;
	_WD_Shutdown()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; Clean Up&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;_Example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Function reference ==&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;
==== 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;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 for FireFox] or [https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/page/2/#comment-1505978  this post for Google Chrome].&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 (or any other) 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;
&lt;br /&gt;
In order to preset autodowloading another file type you have to change it accordingly by providing your desired MIME type:&lt;br /&gt;
&lt;br /&gt;
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types&lt;br /&gt;
&lt;br /&gt;
specifically here:&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;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;
&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-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: Use _WD_CapabilitiesDefine() function like int the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesDefine($_WD_CAPS_TYPES__SPECIFICVENDOR_ARRAY, &#039;NewCapabilityArray&#039;)&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-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 use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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-FAQ18&amp;quot;&amp;gt;18. How to troubleshoot when you can&#039;t locate the desired element using _WD_FindElement() ?&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-FAQ18&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
When you encounter a problem locating an item with _WD_FindElement() you should follow this procedure:&lt;br /&gt;
&lt;br /&gt;
WIP....&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) is valid&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find one or multiple instances of the element&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find element in different frame or if this is within #shadow-root&lt;br /&gt;
* use _WD_FrameList() to check if you have multiple even nested frames in website you are trying to automate&lt;br /&gt;
* use _WD_LocateElement() to check Element location within multiple even nested frames&lt;br /&gt;
* use _WD_FrameEnter() to change frame to be able to use _WD_FindElement() in order to find element within desired frame&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&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;
== 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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for Firefox], [https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof Save Page WE for Chrome])&lt;br /&gt;
* [https://github.com/openstyles/stylus Stylus]﻿ ﻿Stylus is a fork of Stylish for Chrome, also compatible with Firefox as a WebExtension&lt;br /&gt;
&lt;br /&gt;
== References ==&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/208633-webdriver-udf-w3c-compliant-version-20221003/ 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;
** [https://github.com/mlipok/Au3WebDriver-testing Au3WebDriver-testing - Some complex template for testing Au3WebDriver cases]&lt;br /&gt;
** [https://github.com/Sven-Seyfert/au3webdriver-boilerplate The project &amp;quot;au3webdriver-boilerplate&amp;quot; - A quick entry point for the au3WebDriver project]&lt;br /&gt;
** [https://peter.sh/experiments/chromium-command-line-switches/ List of Chromium Command Line Switches]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14892</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14892"/>
		<updated>2024-04-25T08:12:38Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* References */  &amp;quot;au3webdriver-boilerplate&amp;quot;&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;
== Getting started example ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2023/09/09)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;wd_helper.au3&amp;quot;&lt;br /&gt;
#include &amp;quot;wd_capabilities.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
_Example()&lt;br /&gt;
&lt;br /&gt;
Func _Example()&lt;br /&gt;
	# REMARK&lt;br /&gt;
	#   This is not functional script&lt;br /&gt;
	#   It only shows the concept how to use WebDriver UDF&lt;br /&gt;
&lt;br /&gt;
	#Region ; initialize webdriver sesion&lt;br /&gt;
&lt;br /&gt;
	; you should take care about download/update dirver&lt;br /&gt;
	If $IDYES = MsgBox($MB_YESNO + $MB_TOPMOST + $MB_ICONQUESTION + $MB_DEFBUTTON1, &amp;quot;Question&amp;quot;, _&lt;br /&gt;
			&amp;quot;Do you want to download/update driver ?&amp;quot;) Then&lt;br /&gt;
		_WD_UpdateDriver(&#039;chrome&#039;)&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	; specify driver, port and other options&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;DriverParams&#039;, &#039;--verbose --log-path=&amp;quot;&#039; &amp;amp; @ScriptDir &amp;amp; &#039;\chrome.log&amp;quot;&#039;)&lt;br /&gt;
&lt;br /&gt;
	; start the driver&lt;br /&gt;
	_WD_Startup()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; create capabilites for session&lt;br /&gt;
	_WD_CapabilitiesStartup()&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;alwaysMatch&#039;, &#039;chrome&#039;)&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;w3c&#039;, True)&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;excludeSwitches&#039;, &#039;enable-automation&#039;)&lt;br /&gt;
	Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&lt;br /&gt;
	; create session with given Capabilities&lt;br /&gt;
	Local $WD_SESSION = _WD_CreateSession($sCapabilities)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; initialize webdriver sesion&lt;br /&gt;
&lt;br /&gt;
	#Region ; do your&#039;s stuff&lt;br /&gt;
&lt;br /&gt;
	; navigate to some website&lt;br /&gt;
	Local $sURL = &#039;******&#039;&lt;br /&gt;
	_WD_Navigate($WD_SESSION, $sURL)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; wait for loading process ends&lt;br /&gt;
	_WD_LoadWait($WD_SESSION, 1000)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; for example find element&lt;br /&gt;
	Local $sXPath = &amp;quot;*****&amp;quot;&lt;br /&gt;
	Local $sElement = _WD_FindElement($WD_SESSION, $_WD_LOCATOR_ByXPath, $sXPath)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; get element text&lt;br /&gt;
	Local $sText = _WD_ElementAction($WD_SESSION, $sElement, &#039;text&#039;)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
	ConsoleWrite($sText &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
	; or click the element&lt;br /&gt;
	_WD_ElementAction($WD_SESSION, $sElement, &#039;click&#039;)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; do your&#039;s stuff&lt;br /&gt;
&lt;br /&gt;
	#Region ; Clean Up&lt;br /&gt;
&lt;br /&gt;
	; on the end session should be deleted&lt;br /&gt;
	_WD_DeleteSession($WD_SESSION)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; and driver should be closed&lt;br /&gt;
	_WD_Shutdown()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; Clean Up&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;_Example&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 for FireFox] or [https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/page/2/#comment-1505978  this post for Google Chrome].&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 (or any other) 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;
&lt;br /&gt;
In order to preset autodowloading another file type you have to change it accordingly by providing your desired MIME type:&lt;br /&gt;
&lt;br /&gt;
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types&lt;br /&gt;
&lt;br /&gt;
specifically here:&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;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;
&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-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: Use _WD_CapabilitiesDefine() function like int the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesDefine($_WD_CAPS_TYPES__SPECIFICVENDOR_ARRAY, &#039;NewCapabilityArray&#039;)&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-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 use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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-FAQ18&amp;quot;&amp;gt;18. How to troubleshoot when you can&#039;t locate the desired element using _WD_FindElement() ?&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-FAQ18&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
When you encounter a problem locating an item with _WD_FindElement() you should follow this procedure:&lt;br /&gt;
&lt;br /&gt;
WIP....&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) is valid&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find one or multiple instances of the element&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find element in different frame or if this is within #shadow-root&lt;br /&gt;
* use _WD_FrameList() to check if you have multiple even nested frames in website you are trying to automate&lt;br /&gt;
* use _WD_LocateElement() to check Element location within multiple even nested frames&lt;br /&gt;
* use _WD_FrameEnter() to change frame to be able to use _WD_FindElement() in order to find element within desired frame&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&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;
== 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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for Firefox], [https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof Save Page WE for Chrome])&lt;br /&gt;
* [https://github.com/openstyles/stylus Stylus]﻿ ﻿Stylus is a fork of Stylish for Chrome, also compatible with Firefox as a WebExtension&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/208633-webdriver-udf-w3c-compliant-version-20221003/ 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;
** [https://github.com/mlipok/Au3WebDriver-testing Au3WebDriver-testing - Some complex template for testing Au3WebDriver cases]&lt;br /&gt;
** [https://github.com/Sven-Seyfert/au3webdriver-boilerplate The project &amp;quot;au3webdriver-boilerplate&amp;quot; - A quick entry point for the au3WebDriver project]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14891</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14891"/>
		<updated>2024-04-25T08:12:05Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* References */  &amp;quot;au3webdriver-boilerplate&amp;quot;&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;
== Getting started example ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2023/09/09)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;wd_helper.au3&amp;quot;&lt;br /&gt;
#include &amp;quot;wd_capabilities.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
_Example()&lt;br /&gt;
&lt;br /&gt;
Func _Example()&lt;br /&gt;
	# REMARK&lt;br /&gt;
	#   This is not functional script&lt;br /&gt;
	#   It only shows the concept how to use WebDriver UDF&lt;br /&gt;
&lt;br /&gt;
	#Region ; initialize webdriver sesion&lt;br /&gt;
&lt;br /&gt;
	; you should take care about download/update dirver&lt;br /&gt;
	If $IDYES = MsgBox($MB_YESNO + $MB_TOPMOST + $MB_ICONQUESTION + $MB_DEFBUTTON1, &amp;quot;Question&amp;quot;, _&lt;br /&gt;
			&amp;quot;Do you want to download/update driver ?&amp;quot;) Then&lt;br /&gt;
		_WD_UpdateDriver(&#039;chrome&#039;)&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	; specify driver, port and other options&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;DriverParams&#039;, &#039;--verbose --log-path=&amp;quot;&#039; &amp;amp; @ScriptDir &amp;amp; &#039;\chrome.log&amp;quot;&#039;)&lt;br /&gt;
&lt;br /&gt;
	; start the driver&lt;br /&gt;
	_WD_Startup()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; create capabilites for session&lt;br /&gt;
	_WD_CapabilitiesStartup()&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;alwaysMatch&#039;, &#039;chrome&#039;)&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;w3c&#039;, True)&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;excludeSwitches&#039;, &#039;enable-automation&#039;)&lt;br /&gt;
	Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&lt;br /&gt;
	; create session with given Capabilities&lt;br /&gt;
	Local $WD_SESSION = _WD_CreateSession($sCapabilities)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; initialize webdriver sesion&lt;br /&gt;
&lt;br /&gt;
	#Region ; do your&#039;s stuff&lt;br /&gt;
&lt;br /&gt;
	; navigate to some website&lt;br /&gt;
	Local $sURL = &#039;******&#039;&lt;br /&gt;
	_WD_Navigate($WD_SESSION, $sURL)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; wait for loading process ends&lt;br /&gt;
	_WD_LoadWait($WD_SESSION, 1000)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; for example find element&lt;br /&gt;
	Local $sXPath = &amp;quot;*****&amp;quot;&lt;br /&gt;
	Local $sElement = _WD_FindElement($WD_SESSION, $_WD_LOCATOR_ByXPath, $sXPath)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; get element text&lt;br /&gt;
	Local $sText = _WD_ElementAction($WD_SESSION, $sElement, &#039;text&#039;)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
	ConsoleWrite($sText &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
	; or click the element&lt;br /&gt;
	_WD_ElementAction($WD_SESSION, $sElement, &#039;click&#039;)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; do your&#039;s stuff&lt;br /&gt;
&lt;br /&gt;
	#Region ; Clean Up&lt;br /&gt;
&lt;br /&gt;
	; on the end session should be deleted&lt;br /&gt;
	_WD_DeleteSession($WD_SESSION)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; and driver should be closed&lt;br /&gt;
	_WD_Shutdown()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; Clean Up&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;_Example&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 for FireFox] or [https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/page/2/#comment-1505978  this post for Google Chrome].&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 (or any other) 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;
&lt;br /&gt;
In order to preset autodowloading another file type you have to change it accordingly by providing your desired MIME type:&lt;br /&gt;
&lt;br /&gt;
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types&lt;br /&gt;
&lt;br /&gt;
specifically here:&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;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;
&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-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: Use _WD_CapabilitiesDefine() function like int the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesDefine($_WD_CAPS_TYPES__SPECIFICVENDOR_ARRAY, &#039;NewCapabilityArray&#039;)&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-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 use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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-FAQ18&amp;quot;&amp;gt;18. How to troubleshoot when you can&#039;t locate the desired element using _WD_FindElement() ?&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-FAQ18&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
When you encounter a problem locating an item with _WD_FindElement() you should follow this procedure:&lt;br /&gt;
&lt;br /&gt;
WIP....&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) is valid&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find one or multiple instances of the element&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find element in different frame or if this is within #shadow-root&lt;br /&gt;
* use _WD_FrameList() to check if you have multiple even nested frames in website you are trying to automate&lt;br /&gt;
* use _WD_LocateElement() to check Element location within multiple even nested frames&lt;br /&gt;
* use _WD_FrameEnter() to change frame to be able to use _WD_FindElement() in order to find element within desired frame&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&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;
== 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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for Firefox], [https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof Save Page WE for Chrome])&lt;br /&gt;
* [https://github.com/openstyles/stylus Stylus]﻿ ﻿Stylus is a fork of Stylish for Chrome, also compatible with Firefox as a WebExtension&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/208633-webdriver-udf-w3c-compliant-version-20221003/ 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;
** [https://github.com/mlipok/Au3WebDriver-testing Au3WebDriver-testing - Some complex template for testing Au3WebDriver cases]&lt;br /&gt;
** [https://github.com/Sven-Seyfert/au3webdriver-boilerplate The project &amp;quot;au3webdriver-boilerplate&amp;quot; - A quick entry point for the au3WebDriver project. The intention is, give people a easy start with WebDriver for AutoIt.]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14890</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14890"/>
		<updated>2024-04-25T08:10:33Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* References */  added link to Sven-Seyfert &amp;quot;au3webdriver-boilerplate&amp;quot;&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;
== Getting started example ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2023/09/09)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;wd_helper.au3&amp;quot;&lt;br /&gt;
#include &amp;quot;wd_capabilities.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
_Example()&lt;br /&gt;
&lt;br /&gt;
Func _Example()&lt;br /&gt;
	# REMARK&lt;br /&gt;
	#   This is not functional script&lt;br /&gt;
	#   It only shows the concept how to use WebDriver UDF&lt;br /&gt;
&lt;br /&gt;
	#Region ; initialize webdriver sesion&lt;br /&gt;
&lt;br /&gt;
	; you should take care about download/update dirver&lt;br /&gt;
	If $IDYES = MsgBox($MB_YESNO + $MB_TOPMOST + $MB_ICONQUESTION + $MB_DEFBUTTON1, &amp;quot;Question&amp;quot;, _&lt;br /&gt;
			&amp;quot;Do you want to download/update driver ?&amp;quot;) Then&lt;br /&gt;
		_WD_UpdateDriver(&#039;chrome&#039;)&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	; specify driver, port and other options&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;DriverParams&#039;, &#039;--verbose --log-path=&amp;quot;&#039; &amp;amp; @ScriptDir &amp;amp; &#039;\chrome.log&amp;quot;&#039;)&lt;br /&gt;
&lt;br /&gt;
	; start the driver&lt;br /&gt;
	_WD_Startup()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; create capabilites for session&lt;br /&gt;
	_WD_CapabilitiesStartup()&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;alwaysMatch&#039;, &#039;chrome&#039;)&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;w3c&#039;, True)&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;excludeSwitches&#039;, &#039;enable-automation&#039;)&lt;br /&gt;
	Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&lt;br /&gt;
	; create session with given Capabilities&lt;br /&gt;
	Local $WD_SESSION = _WD_CreateSession($sCapabilities)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; initialize webdriver sesion&lt;br /&gt;
&lt;br /&gt;
	#Region ; do your&#039;s stuff&lt;br /&gt;
&lt;br /&gt;
	; navigate to some website&lt;br /&gt;
	Local $sURL = &#039;******&#039;&lt;br /&gt;
	_WD_Navigate($WD_SESSION, $sURL)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; wait for loading process ends&lt;br /&gt;
	_WD_LoadWait($WD_SESSION, 1000)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; for example find element&lt;br /&gt;
	Local $sXPath = &amp;quot;*****&amp;quot;&lt;br /&gt;
	Local $sElement = _WD_FindElement($WD_SESSION, $_WD_LOCATOR_ByXPath, $sXPath)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; get element text&lt;br /&gt;
	Local $sText = _WD_ElementAction($WD_SESSION, $sElement, &#039;text&#039;)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
	ConsoleWrite($sText &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
	; or click the element&lt;br /&gt;
	_WD_ElementAction($WD_SESSION, $sElement, &#039;click&#039;)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; do your&#039;s stuff&lt;br /&gt;
&lt;br /&gt;
	#Region ; Clean Up&lt;br /&gt;
&lt;br /&gt;
	; on the end session should be deleted&lt;br /&gt;
	_WD_DeleteSession($WD_SESSION)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; and driver should be closed&lt;br /&gt;
	_WD_Shutdown()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; Clean Up&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;_Example&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 for FireFox] or [https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/page/2/#comment-1505978  this post for Google Chrome].&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 (or any other) 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;
&lt;br /&gt;
In order to preset autodowloading another file type you have to change it accordingly by providing your desired MIME type:&lt;br /&gt;
&lt;br /&gt;
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types&lt;br /&gt;
&lt;br /&gt;
specifically here:&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;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;
&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-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: Use _WD_CapabilitiesDefine() function like int the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesDefine($_WD_CAPS_TYPES__SPECIFICVENDOR_ARRAY, &#039;NewCapabilityArray&#039;)&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-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 use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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-FAQ18&amp;quot;&amp;gt;18. How to troubleshoot when you can&#039;t locate the desired element using _WD_FindElement() ?&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-FAQ18&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
When you encounter a problem locating an item with _WD_FindElement() you should follow this procedure:&lt;br /&gt;
&lt;br /&gt;
WIP....&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) is valid&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find one or multiple instances of the element&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find element in different frame or if this is within #shadow-root&lt;br /&gt;
* use _WD_FrameList() to check if you have multiple even nested frames in website you are trying to automate&lt;br /&gt;
* use _WD_LocateElement() to check Element location within multiple even nested frames&lt;br /&gt;
* use _WD_FrameEnter() to change frame to be able to use _WD_FindElement() in order to find element within desired frame&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&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;
== 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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for Firefox], [https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof Save Page WE for Chrome])&lt;br /&gt;
* [https://github.com/openstyles/stylus Stylus]﻿ ﻿Stylus is a fork of Stylish for Chrome, also compatible with Firefox as a WebExtension&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/208633-webdriver-udf-w3c-compliant-version-20221003/ 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;
** [https://github.com/mlipok/Au3WebDriver-testing Au3WebDriver-testing - Some complex template for testing Au3WebDriver cases]&lt;br /&gt;
** [https://github.com/Sven-Seyfert/au3webdriver-boilerplate - The project &amp;quot;au3webdriver-boilerplate&amp;quot; can be used as quick entry point for the au3WebDriver project. The intention is, give people a easy start with WebDriver for AutoIt.]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14870</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14870"/>
		<updated>2023-09-19T18:29:28Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* FAQ */ 12. How to download PDF (or any other) file automatically?&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;
== Getting started example ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2023/09/09)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;wd_helper.au3&amp;quot;&lt;br /&gt;
#include &amp;quot;wd_capabilities.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
_Example()&lt;br /&gt;
&lt;br /&gt;
Func _Example()&lt;br /&gt;
	# REMARK&lt;br /&gt;
	#   This is not functional script&lt;br /&gt;
	#   It only shows the concept how to use WebDriver UDF&lt;br /&gt;
&lt;br /&gt;
	#Region ; initialize webdriver sesion&lt;br /&gt;
&lt;br /&gt;
	; you should take care about download/update dirver&lt;br /&gt;
	If $IDYES = MsgBox($MB_YESNO + $MB_TOPMOST + $MB_ICONQUESTION + $MB_DEFBUTTON1, &amp;quot;Question&amp;quot;, _&lt;br /&gt;
			&amp;quot;Do you want to download/update driver ?&amp;quot;) Then&lt;br /&gt;
		_WD_UpdateDriver(&#039;chrome&#039;)&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	; specify driver, port and other options&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;DriverParams&#039;, &#039;--verbose --log-path=&amp;quot;&#039; &amp;amp; @ScriptDir &amp;amp; &#039;\chrome.log&amp;quot;&#039;)&lt;br /&gt;
&lt;br /&gt;
	; start the driver&lt;br /&gt;
	_WD_Startup()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; create capabilites for session&lt;br /&gt;
	_WD_CapabilitiesStartup()&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;alwaysMatch&#039;, &#039;chrome&#039;)&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;w3c&#039;, True)&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;excludeSwitches&#039;, &#039;enable-automation&#039;)&lt;br /&gt;
	Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&lt;br /&gt;
	; create session with given Capabilities&lt;br /&gt;
	Local $WD_SESSION = _WD_CreateSession($sCapabilities)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; initialize webdriver sesion&lt;br /&gt;
&lt;br /&gt;
	#Region ; do your&#039;s stuff&lt;br /&gt;
&lt;br /&gt;
	; navigate to some website&lt;br /&gt;
	Local $sURL = &#039;******&#039;&lt;br /&gt;
	_WD_Navigate($WD_SESSION, $sURL)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; wait for loading process ends&lt;br /&gt;
	_WD_LoadWait($WD_SESSION, 1000)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; for example find element&lt;br /&gt;
	Local $sXPath = &amp;quot;*****&amp;quot;&lt;br /&gt;
	Local $sElement = _WD_FindElement($WD_SESSION, $_WD_LOCATOR_ByXPath, $sXPath)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; get element text&lt;br /&gt;
	Local $sText = _WD_ElementAction($WD_SESSION, $sElement, &#039;text&#039;)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
	ConsoleWrite($sText &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
	; or click the element&lt;br /&gt;
	_WD_ElementAction($WD_SESSION, $sElement, &#039;click&#039;)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; do your&#039;s stuff&lt;br /&gt;
&lt;br /&gt;
	#Region ; Clean Up&lt;br /&gt;
&lt;br /&gt;
	; on the end session should be deleted&lt;br /&gt;
	_WD_DeleteSession($WD_SESSION)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; and driver should be closed&lt;br /&gt;
	_WD_Shutdown()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; Clean Up&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;_Example&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 for FireFox] or [https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/page/2/#comment-1505978  this post for Google Chrome].&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 (or any other) 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;
&lt;br /&gt;
In order to preset autodowloading another file type you have to change it accordingly by providing your desired MIME type:&lt;br /&gt;
&lt;br /&gt;
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types&lt;br /&gt;
&lt;br /&gt;
specifically here:&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;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;
&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-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: Use _WD_CapabilitiesDefine() function like int the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesDefine($_WD_CAPS_TYPES__SPECIFICVENDOR_ARRAY, &#039;NewCapabilityArray&#039;)&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-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 use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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-FAQ18&amp;quot;&amp;gt;18. How to troubleshoot when you can&#039;t locate the desired element using _WD_FindElement() ?&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-FAQ18&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
When you encounter a problem locating an item with _WD_FindElement() you should follow this procedure:&lt;br /&gt;
&lt;br /&gt;
WIP....&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) is valid&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find one or multiple instances of the element&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find element in different frame or if this is within #shadow-root&lt;br /&gt;
* use _WD_FrameList() to check if you have multiple even nested frames in website you are trying to automate&lt;br /&gt;
* use _WD_LocateElement() to check Element location within multiple even nested frames&lt;br /&gt;
* use _WD_FrameEnter() to change frame to be able to use _WD_FindElement() in order to find element within desired frame&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&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;
== 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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for Firefox], [https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof Save Page WE for Chrome])&lt;br /&gt;
* [https://github.com/openstyles/stylus Stylus]﻿ ﻿Stylus is a fork of Stylish for Chrome, also compatible with Firefox as a WebExtension&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/208633-webdriver-udf-w3c-compliant-version-20221003/ 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;
** [https://github.com/mlipok/Au3WebDriver-testing Au3WebDriver-testing - Some complex template for testing Au3WebDriver cases]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14869</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14869"/>
		<updated>2023-09-09T16:23:47Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Getting started example */ Getting started example - Last modified&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;
== Getting started example ==&lt;br /&gt;
&amp;lt;small&amp;gt;(Last modified: 2023/09/09)&amp;lt;br&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;wd_helper.au3&amp;quot;&lt;br /&gt;
#include &amp;quot;wd_capabilities.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
_Example()&lt;br /&gt;
&lt;br /&gt;
Func _Example()&lt;br /&gt;
	# REMARK&lt;br /&gt;
	#   This is not functional script&lt;br /&gt;
	#   It only shows the concept how to use WebDriver UDF&lt;br /&gt;
&lt;br /&gt;
	#Region ; initialize webdriver sesion&lt;br /&gt;
&lt;br /&gt;
	; you should take care about download/update dirver&lt;br /&gt;
	If $IDYES = MsgBox($MB_YESNO + $MB_TOPMOST + $MB_ICONQUESTION + $MB_DEFBUTTON1, &amp;quot;Question&amp;quot;, _&lt;br /&gt;
			&amp;quot;Do you want to download/update driver ?&amp;quot;) Then&lt;br /&gt;
		_WD_UpdateDriver(&#039;chrome&#039;)&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	; specify driver, port and other options&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;DriverParams&#039;, &#039;--verbose --log-path=&amp;quot;&#039; &amp;amp; @ScriptDir &amp;amp; &#039;\chrome.log&amp;quot;&#039;)&lt;br /&gt;
&lt;br /&gt;
	; start the driver&lt;br /&gt;
	_WD_Startup()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; create capabilites for session&lt;br /&gt;
	_WD_CapabilitiesStartup()&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;alwaysMatch&#039;, &#039;chrome&#039;)&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;w3c&#039;, True)&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;excludeSwitches&#039;, &#039;enable-automation&#039;)&lt;br /&gt;
	Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&lt;br /&gt;
	; create session with given Capabilities&lt;br /&gt;
	Local $WD_SESSION = _WD_CreateSession($sCapabilities)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; initialize webdriver sesion&lt;br /&gt;
&lt;br /&gt;
	#Region ; do your&#039;s stuff&lt;br /&gt;
&lt;br /&gt;
	; navigate to some website&lt;br /&gt;
	Local $sURL = &#039;******&#039;&lt;br /&gt;
	_WD_Navigate($WD_SESSION, $sURL)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; wait for loading process ends&lt;br /&gt;
	_WD_LoadWait($WD_SESSION, 1000)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; for example find element&lt;br /&gt;
	Local $sXPath = &amp;quot;*****&amp;quot;&lt;br /&gt;
	Local $sElement = _WD_FindElement($WD_SESSION, $_WD_LOCATOR_ByXPath, $sXPath)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; get element text&lt;br /&gt;
	Local $sText = _WD_ElementAction($WD_SESSION, $sElement, &#039;text&#039;)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
	ConsoleWrite($sText &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
	; or click the element&lt;br /&gt;
	_WD_ElementAction($WD_SESSION, $sElement, &#039;click&#039;)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; do your&#039;s stuff&lt;br /&gt;
&lt;br /&gt;
	#Region ; Clean Up&lt;br /&gt;
&lt;br /&gt;
	; on the end session should be deleted&lt;br /&gt;
	_WD_DeleteSession($WD_SESSION)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; and driver should be closed&lt;br /&gt;
	_WD_Shutdown()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; Clean Up&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;_Example&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 for FireFox] or [https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/page/2/#comment-1505978  this post for Google Chrome].&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: Use _WD_CapabilitiesDefine() function like int the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesDefine($_WD_CAPS_TYPES__SPECIFICVENDOR_ARRAY, &#039;NewCapabilityArray&#039;)&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-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 use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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-FAQ18&amp;quot;&amp;gt;18. How to troubleshoot when you can&#039;t locate the desired element using _WD_FindElement() ?&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-FAQ18&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
When you encounter a problem locating an item with _WD_FindElement() you should follow this procedure:&lt;br /&gt;
&lt;br /&gt;
WIP....&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) is valid&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find one or multiple instances of the element&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find element in different frame or if this is within #shadow-root&lt;br /&gt;
* use _WD_FrameList() to check if you have multiple even nested frames in website you are trying to automate&lt;br /&gt;
* use _WD_LocateElement() to check Element location within multiple even nested frames&lt;br /&gt;
* use _WD_FrameEnter() to change frame to be able to use _WD_FindElement() in order to find element within desired frame&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&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;
== 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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for Firefox], [https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof Save Page WE for Chrome])&lt;br /&gt;
* [https://github.com/openstyles/stylus Stylus]﻿ ﻿Stylus is a fork of Stylish for Chrome, also compatible with Firefox as a WebExtension&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/208633-webdriver-udf-w3c-compliant-version-20221003/ 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;
** [https://github.com/mlipok/Au3WebDriver-testing Au3WebDriver-testing - Some complex template for testing Au3WebDriver cases]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14868</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14868"/>
		<updated>2023-09-09T16:22:23Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Installation */ Getting started 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: 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;
== Getting started example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;wd_helper.au3&amp;quot;&lt;br /&gt;
#include &amp;quot;wd_capabilities.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
_Example()&lt;br /&gt;
&lt;br /&gt;
Func _Example()&lt;br /&gt;
	# REMARK&lt;br /&gt;
	#   This is not functional script&lt;br /&gt;
	#   It only shows the concept how to use WebDriver UDF&lt;br /&gt;
&lt;br /&gt;
	#Region ; initialize webdriver sesion&lt;br /&gt;
&lt;br /&gt;
	; you should take care about download/update dirver&lt;br /&gt;
	If $IDYES = MsgBox($MB_YESNO + $MB_TOPMOST + $MB_ICONQUESTION + $MB_DEFBUTTON1, &amp;quot;Question&amp;quot;, _&lt;br /&gt;
			&amp;quot;Do you want to download/update driver ?&amp;quot;) Then&lt;br /&gt;
		_WD_UpdateDriver(&#039;chrome&#039;)&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	; specify driver, port and other options&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;DriverParams&#039;, &#039;--verbose --log-path=&amp;quot;&#039; &amp;amp; @ScriptDir &amp;amp; &#039;\chrome.log&amp;quot;&#039;)&lt;br /&gt;
&lt;br /&gt;
	; start the driver&lt;br /&gt;
	_WD_Startup()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; create capabilites for session&lt;br /&gt;
	_WD_CapabilitiesStartup()&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;alwaysMatch&#039;, &#039;chrome&#039;)&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;w3c&#039;, True)&lt;br /&gt;
	_WD_CapabilitiesAdd(&#039;excludeSwitches&#039;, &#039;enable-automation&#039;)&lt;br /&gt;
	Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&lt;br /&gt;
	; create session with given Capabilities&lt;br /&gt;
	Local $WD_SESSION = _WD_CreateSession($sCapabilities)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; initialize webdriver sesion&lt;br /&gt;
&lt;br /&gt;
	#Region ; do your&#039;s stuff&lt;br /&gt;
&lt;br /&gt;
	; navigate to some website&lt;br /&gt;
	Local $sURL = &#039;******&#039;&lt;br /&gt;
	_WD_Navigate($WD_SESSION, $sURL)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; wait for loading process ends&lt;br /&gt;
	_WD_LoadWait($WD_SESSION, 1000)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; for example find element&lt;br /&gt;
	Local $sXPath = &amp;quot;*****&amp;quot;&lt;br /&gt;
	Local $sElement = _WD_FindElement($WD_SESSION, $_WD_LOCATOR_ByXPath, $sXPath)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; get element text&lt;br /&gt;
	Local $sText = _WD_ElementAction($WD_SESSION, $sElement, &#039;text&#039;)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
	ConsoleWrite($sText &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
	; or click the element&lt;br /&gt;
	_WD_ElementAction($WD_SESSION, $sElement, &#039;click&#039;)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; do your&#039;s stuff&lt;br /&gt;
&lt;br /&gt;
	#Region ; Clean Up&lt;br /&gt;
&lt;br /&gt;
	; on the end session should be deleted&lt;br /&gt;
	_WD_DeleteSession($WD_SESSION)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	; and driver should be closed&lt;br /&gt;
	_WD_Shutdown()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, 0) ; always remember to check and handle error&#039;s&lt;br /&gt;
&lt;br /&gt;
	#EndRegion ; Clean Up&lt;br /&gt;
&lt;br /&gt;
EndFunc   ;==&amp;gt;_Example&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 for FireFox] or [https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/page/2/#comment-1505978  this post for Google Chrome].&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: Use _WD_CapabilitiesDefine() function like int the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesDefine($_WD_CAPS_TYPES__SPECIFICVENDOR_ARRAY, &#039;NewCapabilityArray&#039;)&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-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 use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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-FAQ18&amp;quot;&amp;gt;18. How to troubleshoot when you can&#039;t locate the desired element using _WD_FindElement() ?&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-FAQ18&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
When you encounter a problem locating an item with _WD_FindElement() you should follow this procedure:&lt;br /&gt;
&lt;br /&gt;
WIP....&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) is valid&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find one or multiple instances of the element&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find element in different frame or if this is within #shadow-root&lt;br /&gt;
* use _WD_FrameList() to check if you have multiple even nested frames in website you are trying to automate&lt;br /&gt;
* use _WD_LocateElement() to check Element location within multiple even nested frames&lt;br /&gt;
* use _WD_FrameEnter() to change frame to be able to use _WD_FindElement() in order to find element within desired frame&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&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;
== 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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for Firefox], [https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof Save Page WE for Chrome])&lt;br /&gt;
* [https://github.com/openstyles/stylus Stylus]﻿ ﻿Stylus is a fork of Stylish for Chrome, also compatible with Firefox as a WebExtension&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/208633-webdriver-udf-w3c-compliant-version-20221003/ 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;
** [https://github.com/mlipok/Au3WebDriver-testing Au3WebDriver-testing - Some complex template for testing Au3WebDriver cases]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=User_Defined_Functions&amp;diff=14857</id>
		<title>User Defined Functions</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=User_Defined_Functions&amp;diff=14857"/>
		<updated>2023-07-29T08:37:04Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Contact and support */  added link to &amp;quot;AutoIt Projects and Collaboration&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
===Preface===&lt;br /&gt;
This page is a listing of libraries of &#039;&#039;&#039;user defined functions&#039;&#039;&#039; (UDF). These libraries have been written to allow easy integration into your own scripts and are a very valuable resource for any programmer.&amp;lt;br /&amp;gt;&lt;br /&gt;
This list is probably not complete (378 UDFs on 2023-07-27), but constantly supplemented.&lt;br /&gt;
If you do not find a solution here, ask a new question on the [https://www.autoitscript.com/forum/forum/2-general-help-and-support/ forum].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
The listed UDFs might have been written for older versions of AutoIt. So there is no guarantee that every UDF works smoothly with newer versions.&amp;lt;br /&amp;gt;&lt;br /&gt;
None of the UDFs has been tested by the maintainers of this list so you as a user need to make sure that they deliver the expected results.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Added in the past two years===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Date !! Section !! Creator !! Description&lt;br /&gt;
|-&lt;br /&gt;
|2023-07-27 || [[User_Defined_Functions#Files.2C_Databases_and_web_connections|Files, Databases and web connections]] || AspirinJunkie || [https://www.autoitscript.com/forum/imndex.php?showtopic=209526 xlsxNative (by AspirinJunkie)] - Read and write xlsx files without excel.&lt;br /&gt;
|-&lt;br /&gt;
|2023-07-27 || [[User_Defined_Functions#OpenOffice.2FLibreOffice|OpenOffice/LibreOffice]] || donnyh13 || [https://www.autoitscript.com/forum/index.php?showtopic=210514 LibreOffice Writer] - A huge list of functions for LibreOffice Writer.&lt;br /&gt;
|-&lt;br /&gt;
|2023-02-03 || [[User_Defined_Functions#Graphics_and_image|Graphics and image]] || Starg || [https://www.autoitscript.com/forum/index.php?showtopic=152950 S3D] - Draw simple 3D graphics with GDI+.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Files.2C_Databases_and_web_connections|Files, Databases and web connections]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209502 JSON] - Interacting with JSON data in AutoIt.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging|Script Coding/Analyzing/Debugging]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209529 Set] - Provides a set data type and brings the corresponding mathematical functions.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Maths|Maths]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209527 Stat] - Statistics for Autoit.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging|Script Coding/Analyzing/Debugging]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209523 ArrayPlus] - Functions for flexible Array handling (creating, extracting, rebuilding, sorting, filtering, finding, printing).&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging|Script Coding/Analyzing/Debugging]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209528 ArrayCombinations] - Different ways of composing elements of a set.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-04 || [[User_Defined_Functions#Sound|Sound]] || MattyD || [https://www.autoitscript.com/forum/index.php?showtopic=208116 MIDI UDF] - Wrap of the Windows MIDI functions.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-06-19 || [[User_Defined_Functions#Internet protocol suite|Internet protocol suite]] || Beege || [https://www.autoitscript.com/forum/index.php?showtopic=207859 cURLX64] - cURL UDF with x64 support.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-05-24 || [[User_Defined_Functions#Controls|Controls]] || kurtykurtyboy || [https://www.autoitscript.com/forum/index.php?showtopic=197654 GuiFlatButton] - Change colors of regular buttons.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-04-25 || [[User_Defined_Functions#Social_Media_and_other_Website_API|Social Media and other Website API]] || Ascer || [https://www.autoitscript.com/forum/index.php?showtopic=192391 oAuth] - Open standard for access delegation, commonly used to grant websites or applications access to other websites.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-02-22 || [[User_Defined_Functions#Files.2C_Databases_and_web_connections|Files, Databases and web connections]] || czardas || [https://www.autoitscript.com/forum/index.php?showtopic=155748 CSVSplit] - Convert to and from CSV format.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-02-11 || [[User_Defined_Functions#Inter_Process_Communications|Inter Process Communications]] || Nine || [https://www.autoitscript.com/forum/index.php?showtopic=204734 Overlapped Named Pipe IPC] - Very fast interprocess communication that could be used between VBS or AutoIt.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-01-11 || [[User_Defined_Functions#Media|Media]] || MrKm || [https://www.autoitscript.com/forum/index.php?showtopic=206133 OCRSpace] - Convert Images to text with the OCRSpace API. &lt;br /&gt;
|-&lt;br /&gt;
| 2022-01-11 || [[User_Defined_Functions#Media|Media]] || Danyfirex || [https://www.autoitscript.com/forum/index.php?showtopic=207324 UWPOCR] - Universal Windows Platform Optical Character Recognition API.&lt;br /&gt;
|-&lt;br /&gt;
| 2021-08-18 || [[User_Defined_Functions#Graphics_and_image|Graphics and image]] || smbape || [https://www.autoitscript.com/forum/index.php?showtopic=206432 OpenCV v4+] -  OpenCV UDF with support for OpenCV v4+.&lt;br /&gt;
|-&lt;br /&gt;
| 2021-08-04 || [[User_Defined_Functions#Windows|Windows]] || DonChunior || [https://www.autoitscript.com/forum/index.php?showtopic=206400 BITS] - Background Intelligent Transfer Service to download/upload files from/to HTTP web servers and SMB file shares.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Contact and support===&lt;br /&gt;
&#039;&#039;&#039;When will an UDF be added to this list?&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
It should meet all/most of the general requirements for UDFs as described [[UDF-spec|here]].&amp;lt;br&amp;gt;&lt;br /&gt;
In addition the following requirements should be met:&lt;br /&gt;
* &#039;&#039;&#039;Documentation&#039;&#039;&#039;: So users can tell what the UDF is intended to do (&#039;&#039;mandatory&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;Examples&#039;&#039;&#039;: So users can get an idea how to use the UDF. The more the better (&#039;&#039;mandatory&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;Operating&#039;&#039;&#039; systems: Should support the latest Microsoft OS (&#039;&#039;mandatory&#039;&#039;) plus as many predecessors as possible (&#039;&#039;optional&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;AutoIt&#039;&#039;&#039;: Should support the latest version of AutoIt (&#039;&#039;mandatory&#039;&#039;) plus as many predecessors as possible (&#039;&#039;optional&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;Author&#039;&#039;&#039;: The author should still be active on the forum so he can reply to questions (&#039;&#039;optional&#039;&#039;)&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;What to do when one of your UDFs is missing?&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Please send a [https://www.autoitscript.com/forum/messenger/compose/?to=7903 PM] to user water. Add a short description of the UDF and a link to your post in the [https://www.autoitscript.com/forum/forum/9-autoit-example-scripts/ Example Scripts forum] or [https://www.autoitscript.com/forum/forum/49-autoit-projects-and-collaboration/ AutoIt Projects and Collaboration].&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Automation ==&lt;br /&gt;
&lt;br /&gt;
===Browsers===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154439 Chrome (by seangriffin)] - Automate the most common tasks in Chrome with this UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95595 Firefox (by Stilgar)] - A little less support for automation than IE, but still very good.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167661 Firefox (by Danp2)] - Modified newer version of Stilgar Firefox UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/224-firefox-profile-backup/ FireFox Profile Backup 1.0 (by careca)] - Backup or restore your firefox profile. The application searches for the profile in home drive that will be the one to backup.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124330 _FF_AutoLogin (by Stilgar)] - This is a auto-login function and login-function-generator for FireFox and the FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=92035 _FF_DM (by Stilgar)] - UDF to control the FireFox Download-Manager (not the download-window).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91650 _FF_FoxBox (by Stilgar)] - UDF to control Fox!Box (A Mozilla Firefox extension for the AVM FRITZ!Box) with FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91665 _FF_Screengrab (by Stilgar)] - UDF to control Screengrab! (FireFox-AddOn) with FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124330 _HTML (by Stilgar)] - Get informations from any HTML (XML) source, without any browser.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166542 HTMLDocumentEvents (by SmOke_N)] - Track IE document events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167035 IEEx (by SmOke_N)] - IE extended library with some Javascript options.&lt;br /&gt;
* Internet Explorer (by DaleHohm et al.) - IE library that is now supplied with a standard AutoIt install.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=153520 IUIAutomation MS framework (by junkew)] - IUIAutomation MS framework to automate chrome, FF, IE etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149203 NavInfo (by Nessie)] - With this UDF you can check if a specified browser/software is installed and which version is being used.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=61090 Opera (by MrCreatoR,)] - Automate the most common tasks in Opera with this UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191990 WebDriver (by Danp2)] - W3C compliant Webriver UDF.&lt;br /&gt;
&lt;br /&gt;
===Microsoft Office===&lt;br /&gt;
Some features of Microsoft&#039;s Office products are proprietary and cannot readily be manipulated.  Sometimes workarounds are required.&amp;lt;br&amp;gt;&amp;lt;u&amp;gt;[[Known issues with Microsoft Office automation.|This page]]&amp;lt;/u&amp;gt; is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32144 Microsoft Office Access (by randallc)] - Automate Microsoft Access.&lt;br /&gt;
* Microsoft Office Excel (by water et al.) - This UDF is included in AutoIt. Link to the [[Excel_UDF|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135312 Microsoft Office Excel Charts (by water, GreenCan)] - Creating charts using Microsoft Excel.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=204034 Microsoft Office Excel Pivot Tables (by SudeepJD)] - Create and Update Excel Pivot Tables and Charts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126305 Microsoft Office Outlook (Items) (by water)] - Automate Microsoft Outlook Items. Link to the [[OutlookEX_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202451 Microsoft Office Outlook (GUI) (by water)] - Automate Microsoft Outlook GUI. Link to the [[OutlookEX_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197346 Microsoft Office Outlook Tools (by water)] - Built on top of the OutlookEX UDF it offers some often needed extended functionality (import/export ics/vcf files etc.). Link to the [[OutlookTools|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50254 Microsoft Office PowerPoint (by Toady)] - Automate Microsoft PowerPoint.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=178783 Microsoft Office PowerPoint (by water)] - Automate Microsoft PowerPoint. Link to the [[Powerpoint|documentation]] pages.&lt;br /&gt;
* Microsoft Office Word (by water et al.) - This UDF is included in AutoIt. Link to the [[Word_UDF|documentation]] pages.&lt;br /&gt;
&lt;br /&gt;
===OpenOffice/LibreOffice===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=210514 LibreOffice Writer (by donnyh13)] - A huge list of functions for LibreOffice Writer.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151530 OOo/LibO Calc (by GMK)] - OpenOfficeCalc UDF (works also for Libre Office).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=185932 OpenOffice/LibreOffice Spell Checker (by GMK)] - Function to validate words, and show spell alternatives.&lt;br /&gt;
&lt;br /&gt;
===Other Applications===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106163 Active Directory (by water)] - Extensive library to control and manipulate the Windows active directory ([https://www.autoitscript.com/forum/files/file/355-ad-active-directory-udf/ Download]). Link to the [[Active_Directory_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87956 Java (by seangriffin)] - Creates an access bridge between your application and a Java application. Allowing you to automate some Java applications.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=86574 SAP (by seangriffin)] - SAP business management automation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149540 SAPWizard (by ozmike)] - SAPWizard UDF.&lt;br /&gt;
&lt;br /&gt;
== Script Coding/Analyzing/Debugging ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209528 ArrayCombinations (by AspirinJunkie)] - Different ways of composing elements of a set.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155442 ArrayMultiColSort (by Melba23)] - Function to sort a 2D array on several columns.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209523 ArrayPlus (by AspirinJunkie)] - Functions for flexible Array handling (creating, extracting, rebuilding, sorting, filtering, finding, printing)&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=180467 ArrayWorkshop (by czardas)] - Multidimensional array functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=59174 Associative array functions (by Nutster)] - Manage a version of associative arrays in single AutoIt variables. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=198929 AutoIt error logger (AUERLO) (by user4157124)] - File- and stdout (etc.) output of messages, regular- and COM Object errors, exit method and -code, etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=110379 AutoItObject (by ProgAndy and others)] - Brings the Object Orientation programming paradigm to AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=112879 AutoIt Syntax Highlight (by MrCreatoR)] - Highlights AutoIt v3 syntax code to html/bbcode format.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191488 cDebug (by c.haslam)] - Dumps the values of all AutoIt subtypes and expressions including nested arrays, DLL structs and maps.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195882 ErrorLog (by mLipok)] - Logs program activities and errors to different output locations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143167 GetOpt (by dany)] - Parse GNU and DOS style command line options similar to getopt().&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=156196 Log4a (by zorphnog)] - Logging library loosely based upon the log4j and NLog libaries.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195862 Loga (by Danyfirex)] - Simple logging library to keep track of code with an integrated console.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119032 Log UDF (by Yashied)] - Create a text log files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202832 OnDebugMsgBox (by argumentum)] - Catch the dreaded &amp;quot;AutoIt Error&amp;quot; MsgBox and prettify or hide it.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209529 Set (by AspirinJunkie)] - Provides a set data type and brings the corresponding mathematical functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=200660 Variants and Safearrays (by LarsJ)] - Create/access/process Variants and SafeArrays.&lt;br /&gt;
&lt;br /&gt;
=== Inter Process Communications ===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202485 AppInteract (by MrCreatoR)] - Reliably pass arrays or other types between processes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=205109 AutoItSharedData (by SEuBo)] - Create a shared data storage, a simple AutoItObject-Object, using AutoItObject_Internal.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=188991 Autoit-Socket-IO (by tarretarretarre)] - Event driven TCP/IP wrapper inspired by Socket.IO with focus on user friendliness and long term sustainability.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126936 Container (by MrCreatoR)] - Scripts interaction method. Allows to transfer whole arrays as data, and even COM objects.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=55994 DDEML (by doudou)] - Use your AutoIt script as DDE client or server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=193277 FMIPC (by argumentum)] - IPC via FileMapping.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127615 Interprocess (by JScript)] - Remotely execute a function in another script (using Mailslot).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=193158 IPC_IO (by JohnWIlling)] - IPC library supporting multiple connection types (such as: Named Pipe, File, TCP, SharedMemory, MailSlot).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202618 IPC Techniques through ROT Objects (by LarsJ)] - Implementing IRunningObjectTable Interface.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106710 Mailslot (by trancexx)] - IPC using Mailslots.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=204734 Overlapped Named Pipe IPC (by Nine)] - Very fast interprocess communication that could be used between VBS or AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169797 Pool - Post Office for Organized Labour (by RTFC)] - Provides multiple AutoIt processes with an infrastructure for exchanging messages, data, and remote-control instructions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202587 WCD IPC (by Nine)] - Framework for Inter Process Communication using Windows Messages WM_COPYDATA.&lt;br /&gt;
&lt;br /&gt;
== Files, Databases and web connections ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=180850 ADO (by mLipok)] - A modifed version of the _SQL UDF to access all kind of databases (MSSQL, MySQL, PostgreSQL, SQLite, MS ACCESS, XLS, TXT, and many other which use ADO and ODBC).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105875 ADODB (by spudw2k)] - ADODB Example.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=176895 AXML (by Aipion)] - This is a Wrapper for Pugixml, made with C++.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145142 DBF (by funkey)] - dBase database read and write with DLL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/114406-csv-file-to-multidimensional-array/?do=findComment&amp;amp;comment=799820 CSV (by ProgAndy)] - Read/write CSV files to/from 2D arrays.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197909 CSV (by seangriffin)] - Manipulate CSV files using SQLite.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155748 CSVSplit (by czardas)] - Convert to and from CSV format.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119238 Excel file generation (by jerome)] - Excel file generation (multi-sheet workbook) without the need to have Excel installed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143866 Excel XML (by FireFox)] - Work with SpreadsheetML (Open XML file formats).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155905 EXml (by jdelaney)] - Create Excel file (SpreadsheetML) through &amp;quot;Microsoft.XMLDOM&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116072 EzMySql (by Yoriz)] - Use MySQL Databases with AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148232 _FileGetProperty (by BrewManNH)] - Retrieve properties of a file.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94920 FireBird (by eltorro)] - FireBird, Interbase DLL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197421 jq (by TheXman)] - Brings the power and flexibility of jq (an open-source command-line based JSON processor) to AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209502 JSON (by AspirinJunkie)] - Interacting with JSON data in AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=104150 JSON (by Gabriel13)] - RFC4627 compliant JSON encode/decode.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148114 JSON (by Ward)] - JSMN - A Non-Strict JSON UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=156794 JSON (by ozmike)] - Bridge to Native Windows JSON plus OO extension for AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173797 JSONgen: JSON generator (by Jefrey)] - Generate JSON.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127101 MS SQL (by TheLuBu)] - MSSQL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51952 MS SQL (by ChrisL)] - _SQL. ADODB Connection.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20814 MySQL (by cdkid)] - MySQL relational database management system.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=85617 MySQL (by ProgAndy)] - MySQL UDFs (without ODBC - working with libmysql.dll).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=122360 MySQL (by James)] - MySQL ODBC Connector.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=187223 romaSQL (rynow)] - Built on the concept of Laravel Query &amp;amp; doctrine. Connection string is based on ADODB / ODBC.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143331 Sharepoint 2007/2010 (by schoppet)] - Access the SOAP-Webservices of Sharepoint 2007/2010.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=17099 SQLite (by ptrex)] - SQLite is a library that implements a self-contained, embeddable, zero-configuration SQL database engine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=142977 SQLite Array Functions (by SmOke_N)] - SQLite Array Functions - a faster method for unique arrays and sorting methods.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140521 SQLite - Database (by PhoenixXL)] - UDF for SQLite so that beginners will also be able to do the stuff.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157853 SQLiteEx (by 57ar7up)] - SQLiteEx UDF v0.5.1 - Simplest work with SQLite.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163633 Xbase I/O (by RTFC)] - Transfer data between Xbase Data file (*.dbf) and AutoIt array written in pure AutoIt (no SQL, no ADO, no dlls, no external dependencies).&lt;br /&gt;
* [https://www.autoitscript.com/forum/imndex.php?showtopic=209526 xlsxNative (by AspirinJunkie)] - Read and write xlsx files without excel.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=19848 XML DOM Wrapper (by eltorro)] - Supports CRUD operations on XML. Including XSL and XPath.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=176895 XML (by mLipok)] - New version of XML DOM Wrapper, with many new features.&lt;br /&gt;
&lt;br /&gt;
== Data compression ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=85094 7z, zip, gzip, bzip2, tar (by rasim)] - Extensive library that uses a external DLL that must be provided with the script.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=92958 gZip (by Zinthose)] - Based on the parsing of gZip.exe output. It can work with memory, it doesn&#039;t work with files. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87441 LZMA (by trancexx)] - LZMA (Native Windows).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138838 Package (by Yashied)] - Package UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=129529 pZip (by asdf8)] - PureZIP_L library UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=76176 UnRAR (by rasim)] - UnRAR.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=17727 XZip (by eltorro)] - Another UDF for &amp;quot;XStandard XZIP Component&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161847 XZip (by mLipok)] - UDF for &amp;quot;XStandard XZIP Component&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=44524 Zip plugin (by eltorro)] - Zip plugin.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=73425 ZIP (by torels)] - ZIP UDF in pure AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116565 zip (by wraithdu)] - Create ZIP files and unpack ZIP files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135565 ZIP (by joakim)] - ZIP STRUCTS UDF (from scratch).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87284 ZLib (by monoceres)] - Based on ZLib.dll. It can compress/uncompress data in memory, it doesn&#039;t work with files.&lt;br /&gt;
&lt;br /&gt;
== Encryption and hash ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81332 _Base64Encode, _Base64Decode (by trancexx)] - Fast _Base64Encode, _Base64Decode.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=153246 Base91 and Base128 (by Beege)] - Base91 and Base128 functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155538 Codecrypter (by RTFC)] - Encrypt scripts without placing the key inside the script.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=201002 Cryptography API: Next Gen (by TheXman)] - Microsoft&#039;s long-term replacement for their CryptoAPI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=203990 GDPR (by mLipok)] - Functions to encrypt/decrypt strings and files with the GDPR in mind.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95558 Hashes for files (by trancexx)] - Fast RC32, MD4, MD5, SHA1 calculation for big files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=107784 TrueCrypt (by FuryCell)] - TrueCrypt UDFs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140737 WinTrust (by kasty)] - verify the integrity of a file with its embedded signature or a given catalog.&lt;br /&gt;
&lt;br /&gt;
== GUI Additions ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97241 3D Pie chart (by WideBoyDixon)] - 3D Pie chart.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173924 Chart_UDF (by Kanashius)] - This UDF can be used to Display bar charts in a window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=96258 ContextHelp (by Yashied)] - Management of context help ([https://www.autoitscript.com/forum/index.php?showtopic=72152-contexthelp/ original]).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=109096 ExtMsgBox (by Melba23)] - A very customisable replacement for MsgBox.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105582 GUICtrlOnChangeRegister (by Mat)] - Call a function when an edits content is changed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145149 GUIExtender (by Melba23)] - Expand and contract sections of your GUI ([https://www.autoitscript.com/forum/index.php?showtopic=117909 original]).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197654 GuiFlatButton (by kurtykurtyboy)] - Change colors of regular buttons.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119505 GUIFrame (by Melba23 &amp;amp; Kip)] - Divide a GUI into adjustable frames.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=144207 GUI Panel (by FireFox)] - Manage child GUIs as panel ctrls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113723 GUI Scrollbars (by Melba23)] - Automatically sized scrollbars with a single command.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161184 MetroGUI (by BBs19)] - Windows 10 style buttons, toggles, radios etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20967 Modern tray menu (by Holger)] - Allows the creation of modern, fancy GUI and tray menus with icons and colors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=194693 MTSkin (by Taskms4)] - Simply create modern looking GUIs (borderless GUI, Interactive menu panel (with mouse-over detection), a bunch of skins).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182136 Notifications (by S3cret91)] - Display permanent desktop notifications.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=136149 Notify (by Melba23)] - Small notifications on the edge of the display.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161750 Pie chart (by Andreik)] - Pie chart.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75429 Real Vista Aero Glass (by James)] - Real Vista Aero Glass UDF - you can apply glass effect to your GUI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=71811 SetOnEvent (by martin)] - Provides an easy way for an event to call functions with parameters.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=103871 _SysTray (by wraithdu)] - Get info about and manipulate Systray icons.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108445 Toast (by Melba23)] - Small message GUIs which pop out of the Systray.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=110003 Tray Icon Bar Graph (by BeeGee)] - Creates a scrolling bar graph as the tray icon.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=132864 Uskin (by JScript)] - Allows you to skin your GUI using the Windows &#039;&#039;.MSstyles&#039;&#039; files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191821 Wi3SMenu (by NHD)] - Create a slide menu with Windows 10 style. Supports color, icon and opacity.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=129196 WinSnap (by Beege)] - Automatic Window Alignment by applying that &amp;quot;snappy edge&amp;quot; effect to your GUI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32494 XSkin (by Valuater)] - Allows skinning of your GUI and to apply custom skins.&lt;br /&gt;
&lt;br /&gt;
=== Controls ===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202529 BrowseForFolder (by MrCreatoR)] - Handle SHBrowseForFolderW with more options, such as multi selection (checkboxes), window position, controls text and more. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=146406 Calendar (by jmon)] - Calendar UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=125293 ChooseFileFolder (byMelba23)] - Single and multiple selections from specified path treeview listing.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=96464 Colorpicker (by Yashied)] - Create a button for the user to select a color.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=123409 Explorer Frame UDF (by Beege)] - Takes any frame created by GUIFrame and turns it into a MS-Windows like Explorer window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173929 GDIPlus Slider UDF (by Kanashius)] - This UDF can be used to create a slider with an imagebackground and an image to move.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=79412 Graph control (by andybiochem)] - Easily create and show bar chart and line charts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=104399 GraphGDIPlus UDF (by andybiochem)] - Easily create and show bar chart and line charts with GDI+ to take advantage of double-buffering.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105682 GUICtrlCreateFinder (by Mat)] - Allows you to create a window finder control like the one seen in AutoIt Window Info.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=107965 GUIHotkey (by Mat)] - UDF for using native hotkey controls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182492 GUIListViewEx (by Melba23)] - Insert, delete, move, drag, sort, edit and colour ListView items.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111438 GUIPager (by Mat)] - Create and control native pager controls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20967 GUI/Tray Menu (by Holger, LarsJ, AZJIO)] - GUI/Tray Menu with icons and colors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166594 GUITreeViewEx (by Melba23)] - Check/clear parent and child checkboxes in a TreeView.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=90598 Hotkey input control (by Yashied)] - Hotkeys Input Control UDF Library (Non-native).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173932 ListView Edit UDF (by Kanashius)] - This UDF can be used to simply edit an Listview.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=109355 ListView - Explorer like ListView UDF (by Beege)] - This UDF simplify creating MS Explorer-like ListViews.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143711 Marquee (by Melba23)] - Make tickertape info bars.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143380 Predict Text UDF (by PhoenixXL)] - Sub classes the edit control and matches the current word through the Database &amp;amp; sets selection in accordance.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163939 Progressbar new style (by Muzaiyan)] - New styles for your progress bar.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=74649 Progressbar with GDIplus (by ProgAndy)] - You even can use full textured images.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151636 RestrictEdit_SRE UDF (by PhoenixXL)] - Restrict the text that can be entered in an editbox through a String Regular Expression.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=128242 Ribbon (by trancexx)] - UDF for Windows Ribbon framework.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114034 StringSize (by Melba23)] - Automatically size controls to fit the text you want to put in them.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126958 Syslink (by Yashied)] - Provides a convenient way to embed hypertext links in a window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105814 Table (by andybiochem)] - Table UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=125251 TVExplorer (by Yashied)] - Allows to create TreeView (TV) Explorer controls that display a tree of files and folders.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=190659 Virtual Listview (by LarsJ)] - Virtual Listview for large amounts of data with a large number of rows.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195053 Windows Message Monitor (by LarsJ)] - Monitor Windows Messages of a window or control.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=118317 Battery UDF (by Yashied)] - Retrieves a various information and current status of the battery(s).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154727 BuildPartitionTable (by RTFC)] - Scans a physical drive&#039;s partition table and returns a partition_table, allocation_table and volumes_table.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155674 CommAPI (by therealhanuta)] - Serial and parallel communication (COM port, RS-232, LPT port) - without installing DLL&#039;s (using Windows API calls).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=77731 Device Management (by weaponx)] - Device Management API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97487 DirectShow (by monoceres)] - DirectShow UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164700 DirectSound (by eukalyptus)] - DirectSound UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164701 Direct2D (by eukalyptus)] - Direct2D UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=99713 Drive Info (by NerdFencer)] - Gathers drive info for Hard Drives, Disk Drives, and Floppy Drives.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138989 FritzBox (by Allow2010)] - _FB_Tools - manage your FritzBox from Autoit.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121084 I/O Port Functions (by Ascend4nt)] - Input/Output UDF for interacting with ports (x64 Parallel Port, Keyboard etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=203207 MediaDevice (by Danyfirex)] - Transfer files to portable devices like phones, storages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154350 Monitor Configuration (by jaberwacky)] - Monitor Configuration UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155469 Mouse (by AlmarM)] - AutoIt powered mouse events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=147325 MouseTrapEvent (by ozmike)] - MouseTrapEvent UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149083 NetInfo (by Nessie)] - UDF for test internet download speed and upload speed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155539 Network configuration (by jguinch)] - Network configuration UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182684 Nitgen (by Jefrey)] - UDF to work with Nitgen fingerprint readers that use NGenBio SDK.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155485 Printers management with WMI (by jguinch)] - Allows to manage printers: add/delete printer, driver, port, or obtain configuration, set default printer ...&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=189190 Serial port UDF / COM port UDF (by MazeM)] - Another UDF for the serial port. It is very similar to CommAPI using kernel32.dll, but all code is packed into a single file without any dependencies.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=128546 Serial Port/COM (by martin)] - Serial Port /COM Port UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27755 SMARTDRIVE (by ptrex)] - SMART drive Analysis.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158640 SPI Hardware Interface (by Blinky)] - Communicate with the MAX335 chip using the SPI protocol via the LPT (printer) port.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=8188 VISA/GPIB (by Angel)] - VISA/GPIB library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=68866 Webcam (by LIMITER)] - Webcam UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70857 Webcam (by ludocus)] - Webcam UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91018 WiFi (by MattyD)] - Low level control over your wireless LAN.&lt;br /&gt;
&lt;br /&gt;
== Information gathering ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=29404 Computer information (by JSThePatriot)] - A general purpose library to get various details about a Windows machine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151920 NetworkStatistics (by Ascend4nt)] - Network Interface Info, Statistics, and Traffic.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=54039 WinPcap (by JRSmile)] - Wrapper for the windows packet capture library WinPcap.&lt;br /&gt;
* [https://opensource.grisambre.net/pcapau3/ WinPcap (by Nicolas Ricquemaque)] - A library to access the main functionalities offered by the WinPcap driver.&lt;br /&gt;
&lt;br /&gt;
== Internet protocol suite ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=207859 cURLX64 (by Beege)] - cURL UDF with x64 support.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=137456 cURL (by seangriffin)] - A UDF for transferring data with URL syntax.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=187718 HTTP lib (by Jefrey)] - HTTP lib (GET, POST and upload) UDF to simplify HTTP requests, mainly when dealing about POST data or file uploads.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202895 HttpApi (by TheXman)] - HTTP Server API enables applications to communicate over HTTP without using MS Internet Information Server (IIS).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=40243 IMAP (by mikeytown2)] - IMAP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108422 IMAP4 (by Tipulatoid)] - IMAP4 UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=43515 IRC (by McGod)] - A lightweight library for communicating with IRC servers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=159285 IRC (by rcmaehl)] - IRC UDF - Updated Version of Chips&#039; IRC UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=22838 POP3 (by Apzo)] - POP3 library for retrieving email messages. Not compatible with Gmail because it uses SSL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167339 POP3 (by mLipok)] - POP3 UDF According to the 1939 RFC, modified version with Quoted Printable decoder.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154530 Prowl (by mrflibblehat)] - Push notifications to iPhone, iPod touch or iPad using Prowl (Growl client for iOS).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138095 SFTP (by Lupo73)] - UDF to support SFTP protocol using PSFTP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154054 Socket UDF (by funkey)] - Socket UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=23860 SMTP (by Jos)] - Smtp Mailer That Supports Html And Attachments.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167292 SMTP Mailer UDF (by mLipok)] - Smtp Mailer That Supports Html And Attachments - Modified Version with support to save EML files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81687 SNMP (by enaiman)] - SNMP_UDF for SNMPv1 and SNMPv2c.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70759 SNMP - MIB protocol (by ptrex)] - Reading toner status from SNMP device with WMI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166579 SSH (by jeanphile)] - Use the SSH protocol very easily in your code.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=185329 STUN (by j0kky)] - STUN is a protocol that permits you to know your external IP but, more interesting, your external port associated to your internal port.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=184817 SyslogSend (by Irios)] - This allows sending (BSD) messages to a syslog server using UDP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169774 TCPServer (by Jefrey)] - Multi client, event-based, able to bind console app to socket.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=57022 UPnP Protocol (by ptrex)] - UPnP - Read and Control your devices in side out.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=84133 WinHTTP (by trancexx)] - Access the HTTP protocol for creating GET and POST requests and submitting them with conforming standards, cookies not supported.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=77503 WinInet (by -Ultima-)] - Access standard Internet protocols (FTP, Gopher and HTTP). Supports GET/POST requests and cookies.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=181645 Winsock (by j0kky)] - Create client/server application using native winsock functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191954 WSA_NBTCP (by ripdad)] - Windows Sockets API - Non-Blocking Transmission Control Protocol.&lt;br /&gt;
&lt;br /&gt;
== Maths ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170658 Advanced Math UDF (by scintilla4evr)] - Advanced mathematical functions (primes, number sequences, interpolate, calculate values of functions like Riemann zeta etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=102686 Advanced rounding (by Mat)] - Support for different measures of accuracy and 8 ways to resolve tie breaks.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83529 Big number (by eukalyptus)] - Make calculations with extremely large numbers that AutoIt normally is not able to support.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106551 Decimal To fraction (by Malkey)] - Converts any decimal number to a fraction. Example: 1.2 to 6/5.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/319-eigen4autoit/ Eigen4AutoIt (by RFTC)] - Allows to perform fast matrix operations on large numerical data sets, and much more ....&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140789 MathsEx UDF (by PhoenixXL)] - Functions for Carrying Out More Advanced Mathematical Calculations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81189 Number base conversion (by james3mg)] - From, to and between positive bases less than 63 (decimals supported).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=117156 NumToWord (by Mat)] - Convert numerals to a human readable string.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108803 Polynomials (by Mat)] - Functions for using polynomials.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83091 Primes (by jennico)] - Many functions dealing with prime number generation and calculations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94770 Roman Numerals (by AZJIO)] - Roman Numerals.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=98160 Root function (by Mat)] - Working out real roots of numbers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209527 Stat (by AspirinJunkie)] - Statistics for Autoit.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163899 StringAPL (by minx)] - inline APL interpreter.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=82722 Trigonometric and math functions (by trancexx)] - _ATan2(), _Cosh(), _Frexp(), _Hypot(), _Ldexp(), _Logb(), _Sinh(), _Tanh().&lt;br /&gt;
&lt;br /&gt;
== Media ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95357 FreeImage library (by ProgAndy)] - Various operations on images, such as rotate, resize, flip.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127263 HtmlHelp (by Geodetic)] - HtmlHelp functions for context-sensitive help from CHM (compiled HTML) files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116009 HyperCam (by seangriffin)] - HyperCam (Screen Recording) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182535 HyCam2 (by willichan)] - Automation for HyCam2 screen recording utility.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50608 OCR (by ptrex)] - Real OCR in AU3 - MODI with MS Office 2003.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=89542 OCR (by seangriffin)] - Tesseract (Screen OCR) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=206133 OCRSpace (by MrKm)] - Convert Images to text with the OCRSpace API. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51054 Printer controller (by martin)] - Print text in any font, size and colour at any position on the page, draw lines, curves, elipses, pies in any colour, and print images.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=73993 Printing (by GRS)] - Printing from AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202621 QRCreator (by BugFix)] - Simple QR-code creation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161831 RTF_Printer (by mLipok)] - Printing RichEdit in the background.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94834 Simple DirectMedia Layer (by AdmiralClaws)] - Adds support for joysticks, CDs, 2D graphics, timers. See [https://www.libsdl.org/ SDL website] for more information.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=207324 UWPOCR (by Danyfirex)] - Universal Windows Platform Optical Character Recognition API.&lt;br /&gt;
&lt;br /&gt;
===Graphics and image===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202987 AutoYolo3 (by smartee)] - Real-Time Object Detection using YOLOv3 wrapper.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113881 au3Irrlicht2 (by JRowe)] - Combining Irrlicht and AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=86748 AVI writing udf (by monoceres)] - Create uncompressed avi&#039;s from bitmap files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27362 Bitmap Library (by evilertoaster)] - Bitmap Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202663 GIF animation (by Nine)] - Fast cached GIF animation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150231 GTK+  (by prazetto)] - GTK+ Framework | Widgets.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=13096 ImageGetInfo (by Lazycat)] - Read info from JPEG, TIFF, BMP, PNG and GIF - size, color depth, resolution.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/471-image-search-udf Image Search (by VIP)] - Search for an image on the desktop. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70506 IrrLicht (by A. Percy)] - A 3D graphics engine suitable for creating games.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160732 OpenCV (by myliseJ)] - UDF for the OpenCV library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=206432 OpenCV v4+ (by smbape)] - OpenCV UDF with support for OpenCV v4+.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151011 OpenGL (by LarsJ)] - OpenGL without external libraries etc. For JPEG files it also retrieves various Exif information.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148129 OpenGL (2.0) (by minx)] - New set of UDFs for OpenGL + AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=152950 S3D (by Starg)] - Draw simple 3D graphics with GDI+.&lt;br /&gt;
&lt;br /&gt;
===Players===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114143 VLC (by seangriffin)] - VLC (Media Player) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91316 VLC Media Player (by ptrex)] - VLC Media Player.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27352 WMP (by ConsultingJoe)] - Windows Media Player UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=44008 WMP - Media Controls (by CFire)] - Another Windows Media Player UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=203154 WMP - GUI Control (by SudeepJD)] - IE based WMP Control.&lt;br /&gt;
&lt;br /&gt;
===Sound===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83481 BASS Function Library (by BrettF)] - Sound and Music via wrappers for Bass, BassEnc, Bass FX, BassSFX, BassAsio and BassCd DLLs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173808 libZPlay (by Danyfirex)] - Multimedia library for playing mp3, mp2, mp1, ogg, flac, ac3, aac, oga, wav and pcm files and streams.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=37072 MIDI (by eynstyne)] - MIDI UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=208116 MIDI (by MattyD)] - Wrap of the Windows MIDI functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114742 SAPIListBox (by seangriffin)] - SAPIListBox (Speech Recognition) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=100439 TTS (by Beege)] - Text-to-Speech UDF.&lt;br /&gt;
&lt;br /&gt;
== PDF ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162195 Acrobat Reader - ActiveX Viewer (by mLipok)] - Make your own PDF Viewer GUI with Acrobat Reader ActiveX COM Object &amp;quot;AcroPDF.PDF.1&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164469 Debenu PDF Viewer SDK (by mLipok)] - A collection of functions to display PDF files in your applications using Debenu PDF Viewer SDK.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160875 Debenu Quick PDF Library (by mLipok)] - A collection of functions for Debenu Quick PDF Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75832 FoxIt Reader (by ptrex)] - PDF Reader in AU3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=118827 MPDF (by taietel)] - Create PDF from your application.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=42776 PDFCreator (by ptrex)] - Automation of PDFCreator allows you to create and manipulate PDF files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170550 PDFCreator (by mLipok)] - UDF for PDFCreator v1.x.x with working EVENTs Handler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32261 _StringToPDF (by Tam0r)] - Write a string to a PDF file and specify font size, type etc.&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145158 Firewall (by JLogan3o13)] - Control and manipulate the Windows Firewall (enable/disable, Exclusions list, enable/disable ports etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=194015 Firewall policy2 (by Bilgus)]- Provides access to the firewall policy for Windows Vista+.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150819 VirusTotal (by Danyfirex)] - VirusTotal API 2.0 UDF.&lt;br /&gt;
&lt;br /&gt;
== Social Media and other Website API ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=159254 Cex.io (by AquilesCrespo)] - UDF script for using with the web api from https://cex.io/ server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169333 CrowdinAPI (by mLipok)] - Uses the [https://crowdin.com/page/api crowdin.net website API] for some functions (create projects, add and update files, download translations or integrate localization).&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/290-dropbox-authenticator/ Dropbox authenticator (by Gimerly)] - Dropbox authenticator.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158106 Easypost (by dcat127)] - Print USPS Postage Labels.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114801 eBay (by seangriffin)] - eBay UDF (functions GetItemStatus and GetSingleItem from the &amp;quot;Shopping API&amp;quot;).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=141340 Gmail (by PhoenixXL)] - Remote Gmail (UDF).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=192422 Gmail API (by Ascer)] - Automate communication with Gmail using oAuth 2.0 security. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=98504 Google Functions (by Beege)] - Google Functions (Suggestions, Definitions, Translate, Convert).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=115437 Google Maps (by seangriffin)] - Google Maps UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70675 iTunes (by torels)] - iTunes UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=101802 iTunes (by Beege)] - Another iTunes UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150985 No-IP (by Nessie)] - Simply update your no-ip hostname(s) and retrieve the ip address of an no-ip address.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=192391 oAuth (by Ascer)] - Open standard for access delegation, commonly used to grant websites or applications access to other websites.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150838 PasteBin (by mrflibblehat)] - Pastebin UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121767 Skype (by FireFox)] - Skype4COM provides an ActiveX interface to the Skype API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113234 Teamspeak 3 (by chipDE)] - Teamspeak 3 UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186944 TeamViewer API (by mLipok)] - A collection of function for use with TeamViewer API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186381 Telegram Bot (by LinkOut)] - UDF for [https://core.telegram.org/api Telegram messenger API].&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166547 TVmaze.com API (by BBs19)] - TVmaze.com API UDF (TV-Series).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116600 Twitter (by seangriffin)] - Manage Twitter.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149247 Yahoo Weather (by Nessie)] - Yahoo Weather API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=112775 Youtube Uploader (by BrettF)] - AYTU - AutoIt Youtube Uploader.&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50880 ACL (by ptrex)] - Set ACL on windows Objects.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=134508 ACL (by FredAl)] - Do most everything with the DACL and ownership on all types of objects: Files or folders, Registry keys, services, Kernel and WMI objects, etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=206400 BITS (by DonChunior)] - Background Intelligent Transfer Service to download files from or upload files to HTTP web servers and SMB file shares.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=184937 CertUtil (by mLipok)] - Wrapper for windows certutil.exe (command-line program that is installed in Windows as part of Certificate Services).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113560 FileSystemMonitor (by seangriffin)] - Monitors the file system by recording all file system events occurring within a given path.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111018 ITaskBarList (by Beege)] - ITaskBarList UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=74118 Local account (by engine)] - Manage local accounts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161193 Magnifier Functions (by Ascend4nt)] - Exposes most of the useful Magnifier API functions available since Windows Vista.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75250 Registry (by engine)] - Windows Registry UDFs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50551 Registry (by seanhart)] - RegWriteAllUsers / RegDeleteAllUsers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=80201 Service (by arcker)] - Build your own service with AutoIt code.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124508 Startup (by guinness)] - Create Startup entries in the Startup Folder or Registry.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164756 SCCM (by JLogan3o13)] - Systems Center Configuration Manager Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=134628 System restore (by FredAI)] - System restore UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186111 SubstWrapper (by mLipok)] - Wrapper for windows subst.exe command - (Associates a path with a drive letter).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135994 Taskplanner/Taskscheduler COM (by Allow2010)] - an UDF for using the Windows Taskplaner / Task Scheduler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83355 Task Scheduler (by dbzfanatic)] - Task Scheduler UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=200068 TaskScheduler (by water)] - Brushed up Task Scheduler UDF. Link to the [[TaskScheduler|documentation pages]].&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173934 TTS (by Kanashius)] - Used with SAPI Automation Object - text-to-speech (TTS) engine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158377 UAC (by AdamUL)] - User Account Control (UAC) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=175719 Utter (by Surya)] - Utilizing more of SAPI (Speech Recognition UDF).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127075 WIMGAPI (by Homes32)] - Manipulate Windows Image Files (.wim) without ImageX.exe.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=28436 Windows Events (by Emperor)] - Create your own Windows events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=6487 Windows Service Control functions (by SumTingWong)] - Some limited functions to control services (create, start, stop, delete, check ...).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81880 Windows Services (by engine)] - Windows Services UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163178 WRMF (by Luigi)] - WRMF - Windows Registry Monitor Call Function.&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&amp;lt;!-- Removed 2020-05-30 as adequate documentation is missing * [https://www.autoitscript.com/forum/topic/178871-dllcall-with-c-example/#comment-1285754 SMSApi (by mLipok)] - UDF for SMSAPi which provides SMS services. --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Removed 2020-05-30 as adequate documentation is missing * [https://www.autoitscript.com/forum/index.php?showtopic=178589 BulkSMS (by Skysnake)] - UDF for BulkSMS which provides SMS services. --&amp;gt;&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145099 _AdlibEnhance (by JScript)] - Enhance Adlib to call functions with parameters, pause and resume.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160936 Android (by Moriba)] - Control any Android device.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97826 Animated tray icons (by Yashied)] - Make animated tray icons easily.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163577 Atom Table (by Ascend4nt)] - Store (add, find, delete, and query) strings locally (at program level) or globally (at OS level) with unique numerical identifiers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170087 Barcode generators (by willichan)] - Creates a Code128A/B/C or Creates a Code39 or Code39Extended optimized barcode from supplied data.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87735 BlockInputEx (by MrCreatoR)] - Supports a few features that built-in BlockInput() function does not.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=199762 BlockInputEx (by Nine)] - Block all input coming from mouse and/or keyboard, without having an UAC warning displayed. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=29763 Clipboard (by eltorro)] - When apps need to watch the clipboard.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170630 ClipboardEx (by ozmike)] - Allows to have more than 1 item in the Clipboard. Handles all data types, not just text.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81267 Clipboard History (by wraithdu)] - Save and restore the entire clipboard contents. Inspired by AHK&#039;s ClipboardAll.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169610 CmdLine (by Jefrey)] - Collection of functions to parse command line arguments.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126569 Console (by Shaggi)] - Functions and features to work wiht Console input/output.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121833 Copy (by Yashied)] - Copy or move files and directories without suspending your script. Retrieve the current state (copied bytes, error code etc.) while copying.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154684 Date / Time convert (by Melba23)] - Transform date/time formats.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=99106 _DLLStructDisplay (by Ascend4nt)] - Show Struct in ListView.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157689 _FileGetMimeType (by Wiliat87)] - Retrieve MIME types based on the extension of the filename/filepath/URL provided.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=117033 File locking with cooperative semaphores (by willichan)] - Simple file locking without a server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157241 FindMimeFromData (by twbradio)] - FindMimeFromData using urlmon.dll.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=181997 Font Icon (by J2TeaM)] - Use Font Awesome in your AutoIt project.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=68422 HotString (by jvanegmond)] - Similar to the HotKey function but trigger on a string, instead of a key or key combination.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173946 LASM - Light Assembler (by minxomat)] - Inline UDF for an Assembler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161628 LFN (by orbs)] - Overcome MAX_PATH limit of 256 chars.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111492 Link Grammar for AutoIt (by JRowe)] -  Input is a regular sentence in English, German or Italian, output is a pattern parsed from the structure of the sentence.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/147-mruau3 MRU (by Yashied)] - Most Recently Used (MRU) List Automation functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186853 _Multiprocess (by jguinch)] - Run several external programs at the same time and retrieve the exit code of each process.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=188158 .NET Common Language Runtime (CLR) Framework (by Danyfirex, Junkew, Larsj, ptrex, Trancexx)] - Allows AutoIt to access .NET Class Libraries.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=101733 NoFocusLines (by Melba23)] - Remove the dotted focus lines from buttons, sliders, radios and checkboxes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149176 NotifyIcon (by FireFox)] - Create, delete and manage self notify icons (formerly TrayIconEx). &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=63318 PixelGetColor (by Manadar)] - Get or Read Pixel from memory.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167024 RDC (by Yashied)] - ReadDirectoryChanges Wrapper.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51103 Resources (by Zedna)] - Embed any binary data into your AutoIt compiled EXE files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162499 ResourcesEx (by guinness)] - Up to date version of Zedna&#039;s Resources UDF. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111215 Restart (by Yashied)] - Allows to restart a script from any location with full restoration of the original command line parameters.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51547 SciLexer (by Kip)] - Editing control, supports multiple editors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=152093 ScriptEditor (by pandel)] - ScriptEditor with I18N support and customizable lexer completely written in AutoIt (based on SciLexer).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162033 Spell Checker (by iCode)] - Spell Checker functions to call Hunspell, Hyphenate and MyThes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164444 Synology filestation (by nend)] - Functions to interact with a Synology NAS server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163328 TimeConvert (by orbs)] - Convert UTC to/from local time, and/or reformat the string representation.&lt;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=User_Defined_Functions&amp;diff=14856</id>
		<title>User Defined Functions</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=User_Defined_Functions&amp;diff=14856"/>
		<updated>2023-07-29T08:35:46Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Introduction */ reorder&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
===Preface===&lt;br /&gt;
This page is a listing of libraries of &#039;&#039;&#039;user defined functions&#039;&#039;&#039; (UDF). These libraries have been written to allow easy integration into your own scripts and are a very valuable resource for any programmer.&amp;lt;br /&amp;gt;&lt;br /&gt;
This list is probably not complete (378 UDFs on 2023-07-27), but constantly supplemented.&lt;br /&gt;
If you do not find a solution here, ask a new question on the [https://www.autoitscript.com/forum/forum/2-general-help-and-support/ forum].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
The listed UDFs might have been written for older versions of AutoIt. So there is no guarantee that every UDF works smoothly with newer versions.&amp;lt;br /&amp;gt;&lt;br /&gt;
None of the UDFs has been tested by the maintainers of this list so you as a user need to make sure that they deliver the expected results.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Added in the past two years===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Date !! Section !! Creator !! Description&lt;br /&gt;
|-&lt;br /&gt;
|2023-07-27 || [[User_Defined_Functions#Files.2C_Databases_and_web_connections|Files, Databases and web connections]] || AspirinJunkie || [https://www.autoitscript.com/forum/imndex.php?showtopic=209526 xlsxNative (by AspirinJunkie)] - Read and write xlsx files without excel.&lt;br /&gt;
|-&lt;br /&gt;
|2023-07-27 || [[User_Defined_Functions#OpenOffice.2FLibreOffice|OpenOffice/LibreOffice]] || donnyh13 || [https://www.autoitscript.com/forum/index.php?showtopic=210514 LibreOffice Writer] - A huge list of functions for LibreOffice Writer.&lt;br /&gt;
|-&lt;br /&gt;
|2023-02-03 || [[User_Defined_Functions#Graphics_and_image|Graphics and image]] || Starg || [https://www.autoitscript.com/forum/index.php?showtopic=152950 S3D] - Draw simple 3D graphics with GDI+.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Files.2C_Databases_and_web_connections|Files, Databases and web connections]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209502 JSON] - Interacting with JSON data in AutoIt.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging|Script Coding/Analyzing/Debugging]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209529 Set] - Provides a set data type and brings the corresponding mathematical functions.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Maths|Maths]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209527 Stat] - Statistics for Autoit.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging|Script Coding/Analyzing/Debugging]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209523 ArrayPlus] - Functions for flexible Array handling (creating, extracting, rebuilding, sorting, filtering, finding, printing).&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging|Script Coding/Analyzing/Debugging]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209528 ArrayCombinations] - Different ways of composing elements of a set.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-04 || [[User_Defined_Functions#Sound|Sound]] || MattyD || [https://www.autoitscript.com/forum/index.php?showtopic=208116 MIDI UDF] - Wrap of the Windows MIDI functions.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-06-19 || [[User_Defined_Functions#Internet protocol suite|Internet protocol suite]] || Beege || [https://www.autoitscript.com/forum/index.php?showtopic=207859 cURLX64] - cURL UDF with x64 support.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-05-24 || [[User_Defined_Functions#Controls|Controls]] || kurtykurtyboy || [https://www.autoitscript.com/forum/index.php?showtopic=197654 GuiFlatButton] - Change colors of regular buttons.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-04-25 || [[User_Defined_Functions#Social_Media_and_other_Website_API|Social Media and other Website API]] || Ascer || [https://www.autoitscript.com/forum/index.php?showtopic=192391 oAuth] - Open standard for access delegation, commonly used to grant websites or applications access to other websites.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-02-22 || [[User_Defined_Functions#Files.2C_Databases_and_web_connections|Files, Databases and web connections]] || czardas || [https://www.autoitscript.com/forum/index.php?showtopic=155748 CSVSplit] - Convert to and from CSV format.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-02-11 || [[User_Defined_Functions#Inter_Process_Communications|Inter Process Communications]] || Nine || [https://www.autoitscript.com/forum/index.php?showtopic=204734 Overlapped Named Pipe IPC] - Very fast interprocess communication that could be used between VBS or AutoIt.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-01-11 || [[User_Defined_Functions#Media|Media]] || MrKm || [https://www.autoitscript.com/forum/index.php?showtopic=206133 OCRSpace] - Convert Images to text with the OCRSpace API. &lt;br /&gt;
|-&lt;br /&gt;
| 2022-01-11 || [[User_Defined_Functions#Media|Media]] || Danyfirex || [https://www.autoitscript.com/forum/index.php?showtopic=207324 UWPOCR] - Universal Windows Platform Optical Character Recognition API.&lt;br /&gt;
|-&lt;br /&gt;
| 2021-08-18 || [[User_Defined_Functions#Graphics_and_image|Graphics and image]] || smbape || [https://www.autoitscript.com/forum/index.php?showtopic=206432 OpenCV v4+] -  OpenCV UDF with support for OpenCV v4+.&lt;br /&gt;
|-&lt;br /&gt;
| 2021-08-04 || [[User_Defined_Functions#Windows|Windows]] || DonChunior || [https://www.autoitscript.com/forum/index.php?showtopic=206400 BITS] - Background Intelligent Transfer Service to download/upload files from/to HTTP web servers and SMB file shares.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Contact and support===&lt;br /&gt;
&#039;&#039;&#039;When will an UDF be added to this list?&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
It should meet all/most of the general requirements for UDFs as described [[UDF-spec|here]].&amp;lt;br&amp;gt;&lt;br /&gt;
In addition the following requirements should be met:&lt;br /&gt;
* &#039;&#039;&#039;Documentation&#039;&#039;&#039;: So users can tell what the UDF is intended to do (&#039;&#039;mandatory&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;Examples&#039;&#039;&#039;: So users can get an idea how to use the UDF. The more the better (&#039;&#039;mandatory&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;Operating&#039;&#039;&#039; systems: Should support the latest Microsoft OS (&#039;&#039;mandatory&#039;&#039;) plus as many predecessors as possible (&#039;&#039;optional&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;AutoIt&#039;&#039;&#039;: Should support the latest version of AutoIt (&#039;&#039;mandatory&#039;&#039;) plus as many predecessors as possible (&#039;&#039;optional&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;Author&#039;&#039;&#039;: The author should still be active on the forum so he can reply to questions (&#039;&#039;optional&#039;&#039;)&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;What to do when one of your UDFs is missing?&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Please send a [https://www.autoitscript.com/forum/messenger/compose/?to=7903 PM] to user water. Add a short description of the UDF and a link to your post in the [https://www.autoitscript.com/forum/forum/9-autoit-example-scripts/ Example Scripts forum].&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Automation ==&lt;br /&gt;
&lt;br /&gt;
===Browsers===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154439 Chrome (by seangriffin)] - Automate the most common tasks in Chrome with this UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95595 Firefox (by Stilgar)] - A little less support for automation than IE, but still very good.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167661 Firefox (by Danp2)] - Modified newer version of Stilgar Firefox UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/224-firefox-profile-backup/ FireFox Profile Backup 1.0 (by careca)] - Backup or restore your firefox profile. The application searches for the profile in home drive that will be the one to backup.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124330 _FF_AutoLogin (by Stilgar)] - This is a auto-login function and login-function-generator for FireFox and the FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=92035 _FF_DM (by Stilgar)] - UDF to control the FireFox Download-Manager (not the download-window).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91650 _FF_FoxBox (by Stilgar)] - UDF to control Fox!Box (A Mozilla Firefox extension for the AVM FRITZ!Box) with FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91665 _FF_Screengrab (by Stilgar)] - UDF to control Screengrab! (FireFox-AddOn) with FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124330 _HTML (by Stilgar)] - Get informations from any HTML (XML) source, without any browser.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166542 HTMLDocumentEvents (by SmOke_N)] - Track IE document events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167035 IEEx (by SmOke_N)] - IE extended library with some Javascript options.&lt;br /&gt;
* Internet Explorer (by DaleHohm et al.) - IE library that is now supplied with a standard AutoIt install.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=153520 IUIAutomation MS framework (by junkew)] - IUIAutomation MS framework to automate chrome, FF, IE etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149203 NavInfo (by Nessie)] - With this UDF you can check if a specified browser/software is installed and which version is being used.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=61090 Opera (by MrCreatoR,)] - Automate the most common tasks in Opera with this UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191990 WebDriver (by Danp2)] - W3C compliant Webriver UDF.&lt;br /&gt;
&lt;br /&gt;
===Microsoft Office===&lt;br /&gt;
Some features of Microsoft&#039;s Office products are proprietary and cannot readily be manipulated.  Sometimes workarounds are required.&amp;lt;br&amp;gt;&amp;lt;u&amp;gt;[[Known issues with Microsoft Office automation.|This page]]&amp;lt;/u&amp;gt; is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32144 Microsoft Office Access (by randallc)] - Automate Microsoft Access.&lt;br /&gt;
* Microsoft Office Excel (by water et al.) - This UDF is included in AutoIt. Link to the [[Excel_UDF|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135312 Microsoft Office Excel Charts (by water, GreenCan)] - Creating charts using Microsoft Excel.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=204034 Microsoft Office Excel Pivot Tables (by SudeepJD)] - Create and Update Excel Pivot Tables and Charts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126305 Microsoft Office Outlook (Items) (by water)] - Automate Microsoft Outlook Items. Link to the [[OutlookEX_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202451 Microsoft Office Outlook (GUI) (by water)] - Automate Microsoft Outlook GUI. Link to the [[OutlookEX_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197346 Microsoft Office Outlook Tools (by water)] - Built on top of the OutlookEX UDF it offers some often needed extended functionality (import/export ics/vcf files etc.). Link to the [[OutlookTools|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50254 Microsoft Office PowerPoint (by Toady)] - Automate Microsoft PowerPoint.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=178783 Microsoft Office PowerPoint (by water)] - Automate Microsoft PowerPoint. Link to the [[Powerpoint|documentation]] pages.&lt;br /&gt;
* Microsoft Office Word (by water et al.) - This UDF is included in AutoIt. Link to the [[Word_UDF|documentation]] pages.&lt;br /&gt;
&lt;br /&gt;
===OpenOffice/LibreOffice===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=210514 LibreOffice Writer (by donnyh13)] - A huge list of functions for LibreOffice Writer.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151530 OOo/LibO Calc (by GMK)] - OpenOfficeCalc UDF (works also for Libre Office).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=185932 OpenOffice/LibreOffice Spell Checker (by GMK)] - Function to validate words, and show spell alternatives.&lt;br /&gt;
&lt;br /&gt;
===Other Applications===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106163 Active Directory (by water)] - Extensive library to control and manipulate the Windows active directory ([https://www.autoitscript.com/forum/files/file/355-ad-active-directory-udf/ Download]). Link to the [[Active_Directory_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87956 Java (by seangriffin)] - Creates an access bridge between your application and a Java application. Allowing you to automate some Java applications.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=86574 SAP (by seangriffin)] - SAP business management automation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149540 SAPWizard (by ozmike)] - SAPWizard UDF.&lt;br /&gt;
&lt;br /&gt;
== Script Coding/Analyzing/Debugging ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209528 ArrayCombinations (by AspirinJunkie)] - Different ways of composing elements of a set.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155442 ArrayMultiColSort (by Melba23)] - Function to sort a 2D array on several columns.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209523 ArrayPlus (by AspirinJunkie)] - Functions for flexible Array handling (creating, extracting, rebuilding, sorting, filtering, finding, printing)&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=180467 ArrayWorkshop (by czardas)] - Multidimensional array functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=59174 Associative array functions (by Nutster)] - Manage a version of associative arrays in single AutoIt variables. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=198929 AutoIt error logger (AUERLO) (by user4157124)] - File- and stdout (etc.) output of messages, regular- and COM Object errors, exit method and -code, etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=110379 AutoItObject (by ProgAndy and others)] - Brings the Object Orientation programming paradigm to AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=112879 AutoIt Syntax Highlight (by MrCreatoR)] - Highlights AutoIt v3 syntax code to html/bbcode format.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191488 cDebug (by c.haslam)] - Dumps the values of all AutoIt subtypes and expressions including nested arrays, DLL structs and maps.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195882 ErrorLog (by mLipok)] - Logs program activities and errors to different output locations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143167 GetOpt (by dany)] - Parse GNU and DOS style command line options similar to getopt().&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=156196 Log4a (by zorphnog)] - Logging library loosely based upon the log4j and NLog libaries.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195862 Loga (by Danyfirex)] - Simple logging library to keep track of code with an integrated console.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119032 Log UDF (by Yashied)] - Create a text log files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202832 OnDebugMsgBox (by argumentum)] - Catch the dreaded &amp;quot;AutoIt Error&amp;quot; MsgBox and prettify or hide it.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209529 Set (by AspirinJunkie)] - Provides a set data type and brings the corresponding mathematical functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=200660 Variants and Safearrays (by LarsJ)] - Create/access/process Variants and SafeArrays.&lt;br /&gt;
&lt;br /&gt;
=== Inter Process Communications ===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202485 AppInteract (by MrCreatoR)] - Reliably pass arrays or other types between processes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=205109 AutoItSharedData (by SEuBo)] - Create a shared data storage, a simple AutoItObject-Object, using AutoItObject_Internal.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=188991 Autoit-Socket-IO (by tarretarretarre)] - Event driven TCP/IP wrapper inspired by Socket.IO with focus on user friendliness and long term sustainability.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126936 Container (by MrCreatoR)] - Scripts interaction method. Allows to transfer whole arrays as data, and even COM objects.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=55994 DDEML (by doudou)] - Use your AutoIt script as DDE client or server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=193277 FMIPC (by argumentum)] - IPC via FileMapping.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127615 Interprocess (by JScript)] - Remotely execute a function in another script (using Mailslot).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=193158 IPC_IO (by JohnWIlling)] - IPC library supporting multiple connection types (such as: Named Pipe, File, TCP, SharedMemory, MailSlot).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202618 IPC Techniques through ROT Objects (by LarsJ)] - Implementing IRunningObjectTable Interface.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106710 Mailslot (by trancexx)] - IPC using Mailslots.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=204734 Overlapped Named Pipe IPC (by Nine)] - Very fast interprocess communication that could be used between VBS or AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169797 Pool - Post Office for Organized Labour (by RTFC)] - Provides multiple AutoIt processes with an infrastructure for exchanging messages, data, and remote-control instructions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202587 WCD IPC (by Nine)] - Framework for Inter Process Communication using Windows Messages WM_COPYDATA.&lt;br /&gt;
&lt;br /&gt;
== Files, Databases and web connections ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=180850 ADO (by mLipok)] - A modifed version of the _SQL UDF to access all kind of databases (MSSQL, MySQL, PostgreSQL, SQLite, MS ACCESS, XLS, TXT, and many other which use ADO and ODBC).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105875 ADODB (by spudw2k)] - ADODB Example.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=176895 AXML (by Aipion)] - This is a Wrapper for Pugixml, made with C++.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145142 DBF (by funkey)] - dBase database read and write with DLL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/114406-csv-file-to-multidimensional-array/?do=findComment&amp;amp;comment=799820 CSV (by ProgAndy)] - Read/write CSV files to/from 2D arrays.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197909 CSV (by seangriffin)] - Manipulate CSV files using SQLite.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155748 CSVSplit (by czardas)] - Convert to and from CSV format.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119238 Excel file generation (by jerome)] - Excel file generation (multi-sheet workbook) without the need to have Excel installed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143866 Excel XML (by FireFox)] - Work with SpreadsheetML (Open XML file formats).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155905 EXml (by jdelaney)] - Create Excel file (SpreadsheetML) through &amp;quot;Microsoft.XMLDOM&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116072 EzMySql (by Yoriz)] - Use MySQL Databases with AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148232 _FileGetProperty (by BrewManNH)] - Retrieve properties of a file.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94920 FireBird (by eltorro)] - FireBird, Interbase DLL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197421 jq (by TheXman)] - Brings the power and flexibility of jq (an open-source command-line based JSON processor) to AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209502 JSON (by AspirinJunkie)] - Interacting with JSON data in AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=104150 JSON (by Gabriel13)] - RFC4627 compliant JSON encode/decode.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148114 JSON (by Ward)] - JSMN - A Non-Strict JSON UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=156794 JSON (by ozmike)] - Bridge to Native Windows JSON plus OO extension for AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173797 JSONgen: JSON generator (by Jefrey)] - Generate JSON.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127101 MS SQL (by TheLuBu)] - MSSQL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51952 MS SQL (by ChrisL)] - _SQL. ADODB Connection.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20814 MySQL (by cdkid)] - MySQL relational database management system.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=85617 MySQL (by ProgAndy)] - MySQL UDFs (without ODBC - working with libmysql.dll).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=122360 MySQL (by James)] - MySQL ODBC Connector.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=187223 romaSQL (rynow)] - Built on the concept of Laravel Query &amp;amp; doctrine. Connection string is based on ADODB / ODBC.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143331 Sharepoint 2007/2010 (by schoppet)] - Access the SOAP-Webservices of Sharepoint 2007/2010.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=17099 SQLite (by ptrex)] - SQLite is a library that implements a self-contained, embeddable, zero-configuration SQL database engine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=142977 SQLite Array Functions (by SmOke_N)] - SQLite Array Functions - a faster method for unique arrays and sorting methods.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140521 SQLite - Database (by PhoenixXL)] - UDF for SQLite so that beginners will also be able to do the stuff.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157853 SQLiteEx (by 57ar7up)] - SQLiteEx UDF v0.5.1 - Simplest work with SQLite.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163633 Xbase I/O (by RTFC)] - Transfer data between Xbase Data file (*.dbf) and AutoIt array written in pure AutoIt (no SQL, no ADO, no dlls, no external dependencies).&lt;br /&gt;
* [https://www.autoitscript.com/forum/imndex.php?showtopic=209526 xlsxNative (by AspirinJunkie)] - Read and write xlsx files without excel.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=19848 XML DOM Wrapper (by eltorro)] - Supports CRUD operations on XML. Including XSL and XPath.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=176895 XML (by mLipok)] - New version of XML DOM Wrapper, with many new features.&lt;br /&gt;
&lt;br /&gt;
== Data compression ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=85094 7z, zip, gzip, bzip2, tar (by rasim)] - Extensive library that uses a external DLL that must be provided with the script.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=92958 gZip (by Zinthose)] - Based on the parsing of gZip.exe output. It can work with memory, it doesn&#039;t work with files. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87441 LZMA (by trancexx)] - LZMA (Native Windows).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138838 Package (by Yashied)] - Package UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=129529 pZip (by asdf8)] - PureZIP_L library UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=76176 UnRAR (by rasim)] - UnRAR.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=17727 XZip (by eltorro)] - Another UDF for &amp;quot;XStandard XZIP Component&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161847 XZip (by mLipok)] - UDF for &amp;quot;XStandard XZIP Component&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=44524 Zip plugin (by eltorro)] - Zip plugin.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=73425 ZIP (by torels)] - ZIP UDF in pure AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116565 zip (by wraithdu)] - Create ZIP files and unpack ZIP files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135565 ZIP (by joakim)] - ZIP STRUCTS UDF (from scratch).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87284 ZLib (by monoceres)] - Based on ZLib.dll. It can compress/uncompress data in memory, it doesn&#039;t work with files.&lt;br /&gt;
&lt;br /&gt;
== Encryption and hash ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81332 _Base64Encode, _Base64Decode (by trancexx)] - Fast _Base64Encode, _Base64Decode.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=153246 Base91 and Base128 (by Beege)] - Base91 and Base128 functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155538 Codecrypter (by RTFC)] - Encrypt scripts without placing the key inside the script.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=201002 Cryptography API: Next Gen (by TheXman)] - Microsoft&#039;s long-term replacement for their CryptoAPI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=203990 GDPR (by mLipok)] - Functions to encrypt/decrypt strings and files with the GDPR in mind.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95558 Hashes for files (by trancexx)] - Fast RC32, MD4, MD5, SHA1 calculation for big files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=107784 TrueCrypt (by FuryCell)] - TrueCrypt UDFs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140737 WinTrust (by kasty)] - verify the integrity of a file with its embedded signature or a given catalog.&lt;br /&gt;
&lt;br /&gt;
== GUI Additions ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97241 3D Pie chart (by WideBoyDixon)] - 3D Pie chart.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173924 Chart_UDF (by Kanashius)] - This UDF can be used to Display bar charts in a window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=96258 ContextHelp (by Yashied)] - Management of context help ([https://www.autoitscript.com/forum/index.php?showtopic=72152-contexthelp/ original]).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=109096 ExtMsgBox (by Melba23)] - A very customisable replacement for MsgBox.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105582 GUICtrlOnChangeRegister (by Mat)] - Call a function when an edits content is changed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145149 GUIExtender (by Melba23)] - Expand and contract sections of your GUI ([https://www.autoitscript.com/forum/index.php?showtopic=117909 original]).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197654 GuiFlatButton (by kurtykurtyboy)] - Change colors of regular buttons.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119505 GUIFrame (by Melba23 &amp;amp; Kip)] - Divide a GUI into adjustable frames.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=144207 GUI Panel (by FireFox)] - Manage child GUIs as panel ctrls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113723 GUI Scrollbars (by Melba23)] - Automatically sized scrollbars with a single command.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161184 MetroGUI (by BBs19)] - Windows 10 style buttons, toggles, radios etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20967 Modern tray menu (by Holger)] - Allows the creation of modern, fancy GUI and tray menus with icons and colors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=194693 MTSkin (by Taskms4)] - Simply create modern looking GUIs (borderless GUI, Interactive menu panel (with mouse-over detection), a bunch of skins).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182136 Notifications (by S3cret91)] - Display permanent desktop notifications.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=136149 Notify (by Melba23)] - Small notifications on the edge of the display.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161750 Pie chart (by Andreik)] - Pie chart.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75429 Real Vista Aero Glass (by James)] - Real Vista Aero Glass UDF - you can apply glass effect to your GUI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=71811 SetOnEvent (by martin)] - Provides an easy way for an event to call functions with parameters.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=103871 _SysTray (by wraithdu)] - Get info about and manipulate Systray icons.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108445 Toast (by Melba23)] - Small message GUIs which pop out of the Systray.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=110003 Tray Icon Bar Graph (by BeeGee)] - Creates a scrolling bar graph as the tray icon.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=132864 Uskin (by JScript)] - Allows you to skin your GUI using the Windows &#039;&#039;.MSstyles&#039;&#039; files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191821 Wi3SMenu (by NHD)] - Create a slide menu with Windows 10 style. Supports color, icon and opacity.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=129196 WinSnap (by Beege)] - Automatic Window Alignment by applying that &amp;quot;snappy edge&amp;quot; effect to your GUI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32494 XSkin (by Valuater)] - Allows skinning of your GUI and to apply custom skins.&lt;br /&gt;
&lt;br /&gt;
=== Controls ===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202529 BrowseForFolder (by MrCreatoR)] - Handle SHBrowseForFolderW with more options, such as multi selection (checkboxes), window position, controls text and more. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=146406 Calendar (by jmon)] - Calendar UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=125293 ChooseFileFolder (byMelba23)] - Single and multiple selections from specified path treeview listing.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=96464 Colorpicker (by Yashied)] - Create a button for the user to select a color.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=123409 Explorer Frame UDF (by Beege)] - Takes any frame created by GUIFrame and turns it into a MS-Windows like Explorer window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173929 GDIPlus Slider UDF (by Kanashius)] - This UDF can be used to create a slider with an imagebackground and an image to move.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=79412 Graph control (by andybiochem)] - Easily create and show bar chart and line charts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=104399 GraphGDIPlus UDF (by andybiochem)] - Easily create and show bar chart and line charts with GDI+ to take advantage of double-buffering.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105682 GUICtrlCreateFinder (by Mat)] - Allows you to create a window finder control like the one seen in AutoIt Window Info.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=107965 GUIHotkey (by Mat)] - UDF for using native hotkey controls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182492 GUIListViewEx (by Melba23)] - Insert, delete, move, drag, sort, edit and colour ListView items.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111438 GUIPager (by Mat)] - Create and control native pager controls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20967 GUI/Tray Menu (by Holger, LarsJ, AZJIO)] - GUI/Tray Menu with icons and colors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166594 GUITreeViewEx (by Melba23)] - Check/clear parent and child checkboxes in a TreeView.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=90598 Hotkey input control (by Yashied)] - Hotkeys Input Control UDF Library (Non-native).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173932 ListView Edit UDF (by Kanashius)] - This UDF can be used to simply edit an Listview.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=109355 ListView - Explorer like ListView UDF (by Beege)] - This UDF simplify creating MS Explorer-like ListViews.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143711 Marquee (by Melba23)] - Make tickertape info bars.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143380 Predict Text UDF (by PhoenixXL)] - Sub classes the edit control and matches the current word through the Database &amp;amp; sets selection in accordance.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163939 Progressbar new style (by Muzaiyan)] - New styles for your progress bar.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=74649 Progressbar with GDIplus (by ProgAndy)] - You even can use full textured images.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151636 RestrictEdit_SRE UDF (by PhoenixXL)] - Restrict the text that can be entered in an editbox through a String Regular Expression.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=128242 Ribbon (by trancexx)] - UDF for Windows Ribbon framework.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114034 StringSize (by Melba23)] - Automatically size controls to fit the text you want to put in them.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126958 Syslink (by Yashied)] - Provides a convenient way to embed hypertext links in a window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105814 Table (by andybiochem)] - Table UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=125251 TVExplorer (by Yashied)] - Allows to create TreeView (TV) Explorer controls that display a tree of files and folders.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=190659 Virtual Listview (by LarsJ)] - Virtual Listview for large amounts of data with a large number of rows.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195053 Windows Message Monitor (by LarsJ)] - Monitor Windows Messages of a window or control.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=118317 Battery UDF (by Yashied)] - Retrieves a various information and current status of the battery(s).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154727 BuildPartitionTable (by RTFC)] - Scans a physical drive&#039;s partition table and returns a partition_table, allocation_table and volumes_table.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155674 CommAPI (by therealhanuta)] - Serial and parallel communication (COM port, RS-232, LPT port) - without installing DLL&#039;s (using Windows API calls).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=77731 Device Management (by weaponx)] - Device Management API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97487 DirectShow (by monoceres)] - DirectShow UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164700 DirectSound (by eukalyptus)] - DirectSound UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164701 Direct2D (by eukalyptus)] - Direct2D UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=99713 Drive Info (by NerdFencer)] - Gathers drive info for Hard Drives, Disk Drives, and Floppy Drives.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138989 FritzBox (by Allow2010)] - _FB_Tools - manage your FritzBox from Autoit.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121084 I/O Port Functions (by Ascend4nt)] - Input/Output UDF for interacting with ports (x64 Parallel Port, Keyboard etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=203207 MediaDevice (by Danyfirex)] - Transfer files to portable devices like phones, storages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154350 Monitor Configuration (by jaberwacky)] - Monitor Configuration UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155469 Mouse (by AlmarM)] - AutoIt powered mouse events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=147325 MouseTrapEvent (by ozmike)] - MouseTrapEvent UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149083 NetInfo (by Nessie)] - UDF for test internet download speed and upload speed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155539 Network configuration (by jguinch)] - Network configuration UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182684 Nitgen (by Jefrey)] - UDF to work with Nitgen fingerprint readers that use NGenBio SDK.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155485 Printers management with WMI (by jguinch)] - Allows to manage printers: add/delete printer, driver, port, or obtain configuration, set default printer ...&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=189190 Serial port UDF / COM port UDF (by MazeM)] - Another UDF for the serial port. It is very similar to CommAPI using kernel32.dll, but all code is packed into a single file without any dependencies.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=128546 Serial Port/COM (by martin)] - Serial Port /COM Port UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27755 SMARTDRIVE (by ptrex)] - SMART drive Analysis.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158640 SPI Hardware Interface (by Blinky)] - Communicate with the MAX335 chip using the SPI protocol via the LPT (printer) port.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=8188 VISA/GPIB (by Angel)] - VISA/GPIB library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=68866 Webcam (by LIMITER)] - Webcam UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70857 Webcam (by ludocus)] - Webcam UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91018 WiFi (by MattyD)] - Low level control over your wireless LAN.&lt;br /&gt;
&lt;br /&gt;
== Information gathering ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=29404 Computer information (by JSThePatriot)] - A general purpose library to get various details about a Windows machine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151920 NetworkStatistics (by Ascend4nt)] - Network Interface Info, Statistics, and Traffic.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=54039 WinPcap (by JRSmile)] - Wrapper for the windows packet capture library WinPcap.&lt;br /&gt;
* [https://opensource.grisambre.net/pcapau3/ WinPcap (by Nicolas Ricquemaque)] - A library to access the main functionalities offered by the WinPcap driver.&lt;br /&gt;
&lt;br /&gt;
== Internet protocol suite ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=207859 cURLX64 (by Beege)] - cURL UDF with x64 support.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=137456 cURL (by seangriffin)] - A UDF for transferring data with URL syntax.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=187718 HTTP lib (by Jefrey)] - HTTP lib (GET, POST and upload) UDF to simplify HTTP requests, mainly when dealing about POST data or file uploads.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202895 HttpApi (by TheXman)] - HTTP Server API enables applications to communicate over HTTP without using MS Internet Information Server (IIS).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=40243 IMAP (by mikeytown2)] - IMAP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108422 IMAP4 (by Tipulatoid)] - IMAP4 UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=43515 IRC (by McGod)] - A lightweight library for communicating with IRC servers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=159285 IRC (by rcmaehl)] - IRC UDF - Updated Version of Chips&#039; IRC UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=22838 POP3 (by Apzo)] - POP3 library for retrieving email messages. Not compatible with Gmail because it uses SSL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167339 POP3 (by mLipok)] - POP3 UDF According to the 1939 RFC, modified version with Quoted Printable decoder.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154530 Prowl (by mrflibblehat)] - Push notifications to iPhone, iPod touch or iPad using Prowl (Growl client for iOS).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138095 SFTP (by Lupo73)] - UDF to support SFTP protocol using PSFTP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154054 Socket UDF (by funkey)] - Socket UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=23860 SMTP (by Jos)] - Smtp Mailer That Supports Html And Attachments.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167292 SMTP Mailer UDF (by mLipok)] - Smtp Mailer That Supports Html And Attachments - Modified Version with support to save EML files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81687 SNMP (by enaiman)] - SNMP_UDF for SNMPv1 and SNMPv2c.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70759 SNMP - MIB protocol (by ptrex)] - Reading toner status from SNMP device with WMI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166579 SSH (by jeanphile)] - Use the SSH protocol very easily in your code.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=185329 STUN (by j0kky)] - STUN is a protocol that permits you to know your external IP but, more interesting, your external port associated to your internal port.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=184817 SyslogSend (by Irios)] - This allows sending (BSD) messages to a syslog server using UDP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169774 TCPServer (by Jefrey)] - Multi client, event-based, able to bind console app to socket.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=57022 UPnP Protocol (by ptrex)] - UPnP - Read and Control your devices in side out.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=84133 WinHTTP (by trancexx)] - Access the HTTP protocol for creating GET and POST requests and submitting them with conforming standards, cookies not supported.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=77503 WinInet (by -Ultima-)] - Access standard Internet protocols (FTP, Gopher and HTTP). Supports GET/POST requests and cookies.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=181645 Winsock (by j0kky)] - Create client/server application using native winsock functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191954 WSA_NBTCP (by ripdad)] - Windows Sockets API - Non-Blocking Transmission Control Protocol.&lt;br /&gt;
&lt;br /&gt;
== Maths ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170658 Advanced Math UDF (by scintilla4evr)] - Advanced mathematical functions (primes, number sequences, interpolate, calculate values of functions like Riemann zeta etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=102686 Advanced rounding (by Mat)] - Support for different measures of accuracy and 8 ways to resolve tie breaks.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83529 Big number (by eukalyptus)] - Make calculations with extremely large numbers that AutoIt normally is not able to support.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106551 Decimal To fraction (by Malkey)] - Converts any decimal number to a fraction. Example: 1.2 to 6/5.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/319-eigen4autoit/ Eigen4AutoIt (by RFTC)] - Allows to perform fast matrix operations on large numerical data sets, and much more ....&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140789 MathsEx UDF (by PhoenixXL)] - Functions for Carrying Out More Advanced Mathematical Calculations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81189 Number base conversion (by james3mg)] - From, to and between positive bases less than 63 (decimals supported).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=117156 NumToWord (by Mat)] - Convert numerals to a human readable string.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108803 Polynomials (by Mat)] - Functions for using polynomials.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83091 Primes (by jennico)] - Many functions dealing with prime number generation and calculations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94770 Roman Numerals (by AZJIO)] - Roman Numerals.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=98160 Root function (by Mat)] - Working out real roots of numbers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209527 Stat (by AspirinJunkie)] - Statistics for Autoit.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163899 StringAPL (by minx)] - inline APL interpreter.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=82722 Trigonometric and math functions (by trancexx)] - _ATan2(), _Cosh(), _Frexp(), _Hypot(), _Ldexp(), _Logb(), _Sinh(), _Tanh().&lt;br /&gt;
&lt;br /&gt;
== Media ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95357 FreeImage library (by ProgAndy)] - Various operations on images, such as rotate, resize, flip.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127263 HtmlHelp (by Geodetic)] - HtmlHelp functions for context-sensitive help from CHM (compiled HTML) files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116009 HyperCam (by seangriffin)] - HyperCam (Screen Recording) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182535 HyCam2 (by willichan)] - Automation for HyCam2 screen recording utility.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50608 OCR (by ptrex)] - Real OCR in AU3 - MODI with MS Office 2003.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=89542 OCR (by seangriffin)] - Tesseract (Screen OCR) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=206133 OCRSpace (by MrKm)] - Convert Images to text with the OCRSpace API. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51054 Printer controller (by martin)] - Print text in any font, size and colour at any position on the page, draw lines, curves, elipses, pies in any colour, and print images.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=73993 Printing (by GRS)] - Printing from AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202621 QRCreator (by BugFix)] - Simple QR-code creation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161831 RTF_Printer (by mLipok)] - Printing RichEdit in the background.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94834 Simple DirectMedia Layer (by AdmiralClaws)] - Adds support for joysticks, CDs, 2D graphics, timers. See [https://www.libsdl.org/ SDL website] for more information.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=207324 UWPOCR (by Danyfirex)] - Universal Windows Platform Optical Character Recognition API.&lt;br /&gt;
&lt;br /&gt;
===Graphics and image===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202987 AutoYolo3 (by smartee)] - Real-Time Object Detection using YOLOv3 wrapper.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113881 au3Irrlicht2 (by JRowe)] - Combining Irrlicht and AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=86748 AVI writing udf (by monoceres)] - Create uncompressed avi&#039;s from bitmap files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27362 Bitmap Library (by evilertoaster)] - Bitmap Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202663 GIF animation (by Nine)] - Fast cached GIF animation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150231 GTK+  (by prazetto)] - GTK+ Framework | Widgets.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=13096 ImageGetInfo (by Lazycat)] - Read info from JPEG, TIFF, BMP, PNG and GIF - size, color depth, resolution.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/471-image-search-udf Image Search (by VIP)] - Search for an image on the desktop. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70506 IrrLicht (by A. Percy)] - A 3D graphics engine suitable for creating games.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160732 OpenCV (by myliseJ)] - UDF for the OpenCV library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=206432 OpenCV v4+ (by smbape)] - OpenCV UDF with support for OpenCV v4+.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151011 OpenGL (by LarsJ)] - OpenGL without external libraries etc. For JPEG files it also retrieves various Exif information.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148129 OpenGL (2.0) (by minx)] - New set of UDFs for OpenGL + AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=152950 S3D (by Starg)] - Draw simple 3D graphics with GDI+.&lt;br /&gt;
&lt;br /&gt;
===Players===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114143 VLC (by seangriffin)] - VLC (Media Player) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91316 VLC Media Player (by ptrex)] - VLC Media Player.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27352 WMP (by ConsultingJoe)] - Windows Media Player UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=44008 WMP - Media Controls (by CFire)] - Another Windows Media Player UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=203154 WMP - GUI Control (by SudeepJD)] - IE based WMP Control.&lt;br /&gt;
&lt;br /&gt;
===Sound===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83481 BASS Function Library (by BrettF)] - Sound and Music via wrappers for Bass, BassEnc, Bass FX, BassSFX, BassAsio and BassCd DLLs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173808 libZPlay (by Danyfirex)] - Multimedia library for playing mp3, mp2, mp1, ogg, flac, ac3, aac, oga, wav and pcm files and streams.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=37072 MIDI (by eynstyne)] - MIDI UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=208116 MIDI (by MattyD)] - Wrap of the Windows MIDI functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114742 SAPIListBox (by seangriffin)] - SAPIListBox (Speech Recognition) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=100439 TTS (by Beege)] - Text-to-Speech UDF.&lt;br /&gt;
&lt;br /&gt;
== PDF ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162195 Acrobat Reader - ActiveX Viewer (by mLipok)] - Make your own PDF Viewer GUI with Acrobat Reader ActiveX COM Object &amp;quot;AcroPDF.PDF.1&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164469 Debenu PDF Viewer SDK (by mLipok)] - A collection of functions to display PDF files in your applications using Debenu PDF Viewer SDK.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160875 Debenu Quick PDF Library (by mLipok)] - A collection of functions for Debenu Quick PDF Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75832 FoxIt Reader (by ptrex)] - PDF Reader in AU3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=118827 MPDF (by taietel)] - Create PDF from your application.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=42776 PDFCreator (by ptrex)] - Automation of PDFCreator allows you to create and manipulate PDF files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170550 PDFCreator (by mLipok)] - UDF for PDFCreator v1.x.x with working EVENTs Handler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32261 _StringToPDF (by Tam0r)] - Write a string to a PDF file and specify font size, type etc.&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145158 Firewall (by JLogan3o13)] - Control and manipulate the Windows Firewall (enable/disable, Exclusions list, enable/disable ports etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=194015 Firewall policy2 (by Bilgus)]- Provides access to the firewall policy for Windows Vista+.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150819 VirusTotal (by Danyfirex)] - VirusTotal API 2.0 UDF.&lt;br /&gt;
&lt;br /&gt;
== Social Media and other Website API ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=159254 Cex.io (by AquilesCrespo)] - UDF script for using with the web api from https://cex.io/ server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169333 CrowdinAPI (by mLipok)] - Uses the [https://crowdin.com/page/api crowdin.net website API] for some functions (create projects, add and update files, download translations or integrate localization).&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/290-dropbox-authenticator/ Dropbox authenticator (by Gimerly)] - Dropbox authenticator.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158106 Easypost (by dcat127)] - Print USPS Postage Labels.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114801 eBay (by seangriffin)] - eBay UDF (functions GetItemStatus and GetSingleItem from the &amp;quot;Shopping API&amp;quot;).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=141340 Gmail (by PhoenixXL)] - Remote Gmail (UDF).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=192422 Gmail API (by Ascer)] - Automate communication with Gmail using oAuth 2.0 security. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=98504 Google Functions (by Beege)] - Google Functions (Suggestions, Definitions, Translate, Convert).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=115437 Google Maps (by seangriffin)] - Google Maps UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70675 iTunes (by torels)] - iTunes UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=101802 iTunes (by Beege)] - Another iTunes UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150985 No-IP (by Nessie)] - Simply update your no-ip hostname(s) and retrieve the ip address of an no-ip address.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=192391 oAuth (by Ascer)] - Open standard for access delegation, commonly used to grant websites or applications access to other websites.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150838 PasteBin (by mrflibblehat)] - Pastebin UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121767 Skype (by FireFox)] - Skype4COM provides an ActiveX interface to the Skype API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113234 Teamspeak 3 (by chipDE)] - Teamspeak 3 UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186944 TeamViewer API (by mLipok)] - A collection of function for use with TeamViewer API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186381 Telegram Bot (by LinkOut)] - UDF for [https://core.telegram.org/api Telegram messenger API].&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166547 TVmaze.com API (by BBs19)] - TVmaze.com API UDF (TV-Series).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116600 Twitter (by seangriffin)] - Manage Twitter.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149247 Yahoo Weather (by Nessie)] - Yahoo Weather API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=112775 Youtube Uploader (by BrettF)] - AYTU - AutoIt Youtube Uploader.&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50880 ACL (by ptrex)] - Set ACL on windows Objects.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=134508 ACL (by FredAl)] - Do most everything with the DACL and ownership on all types of objects: Files or folders, Registry keys, services, Kernel and WMI objects, etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=206400 BITS (by DonChunior)] - Background Intelligent Transfer Service to download files from or upload files to HTTP web servers and SMB file shares.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=184937 CertUtil (by mLipok)] - Wrapper for windows certutil.exe (command-line program that is installed in Windows as part of Certificate Services).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113560 FileSystemMonitor (by seangriffin)] - Monitors the file system by recording all file system events occurring within a given path.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111018 ITaskBarList (by Beege)] - ITaskBarList UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=74118 Local account (by engine)] - Manage local accounts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161193 Magnifier Functions (by Ascend4nt)] - Exposes most of the useful Magnifier API functions available since Windows Vista.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75250 Registry (by engine)] - Windows Registry UDFs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50551 Registry (by seanhart)] - RegWriteAllUsers / RegDeleteAllUsers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=80201 Service (by arcker)] - Build your own service with AutoIt code.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124508 Startup (by guinness)] - Create Startup entries in the Startup Folder or Registry.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164756 SCCM (by JLogan3o13)] - Systems Center Configuration Manager Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=134628 System restore (by FredAI)] - System restore UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186111 SubstWrapper (by mLipok)] - Wrapper for windows subst.exe command - (Associates a path with a drive letter).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135994 Taskplanner/Taskscheduler COM (by Allow2010)] - an UDF for using the Windows Taskplaner / Task Scheduler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83355 Task Scheduler (by dbzfanatic)] - Task Scheduler UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=200068 TaskScheduler (by water)] - Brushed up Task Scheduler UDF. Link to the [[TaskScheduler|documentation pages]].&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173934 TTS (by Kanashius)] - Used with SAPI Automation Object - text-to-speech (TTS) engine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158377 UAC (by AdamUL)] - User Account Control (UAC) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=175719 Utter (by Surya)] - Utilizing more of SAPI (Speech Recognition UDF).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127075 WIMGAPI (by Homes32)] - Manipulate Windows Image Files (.wim) without ImageX.exe.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=28436 Windows Events (by Emperor)] - Create your own Windows events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=6487 Windows Service Control functions (by SumTingWong)] - Some limited functions to control services (create, start, stop, delete, check ...).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81880 Windows Services (by engine)] - Windows Services UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163178 WRMF (by Luigi)] - WRMF - Windows Registry Monitor Call Function.&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&amp;lt;!-- Removed 2020-05-30 as adequate documentation is missing * [https://www.autoitscript.com/forum/topic/178871-dllcall-with-c-example/#comment-1285754 SMSApi (by mLipok)] - UDF for SMSAPi which provides SMS services. --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Removed 2020-05-30 as adequate documentation is missing * [https://www.autoitscript.com/forum/index.php?showtopic=178589 BulkSMS (by Skysnake)] - UDF for BulkSMS which provides SMS services. --&amp;gt;&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145099 _AdlibEnhance (by JScript)] - Enhance Adlib to call functions with parameters, pause and resume.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160936 Android (by Moriba)] - Control any Android device.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97826 Animated tray icons (by Yashied)] - Make animated tray icons easily.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163577 Atom Table (by Ascend4nt)] - Store (add, find, delete, and query) strings locally (at program level) or globally (at OS level) with unique numerical identifiers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170087 Barcode generators (by willichan)] - Creates a Code128A/B/C or Creates a Code39 or Code39Extended optimized barcode from supplied data.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87735 BlockInputEx (by MrCreatoR)] - Supports a few features that built-in BlockInput() function does not.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=199762 BlockInputEx (by Nine)] - Block all input coming from mouse and/or keyboard, without having an UAC warning displayed. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=29763 Clipboard (by eltorro)] - When apps need to watch the clipboard.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170630 ClipboardEx (by ozmike)] - Allows to have more than 1 item in the Clipboard. Handles all data types, not just text.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81267 Clipboard History (by wraithdu)] - Save and restore the entire clipboard contents. Inspired by AHK&#039;s ClipboardAll.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169610 CmdLine (by Jefrey)] - Collection of functions to parse command line arguments.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126569 Console (by Shaggi)] - Functions and features to work wiht Console input/output.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121833 Copy (by Yashied)] - Copy or move files and directories without suspending your script. Retrieve the current state (copied bytes, error code etc.) while copying.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154684 Date / Time convert (by Melba23)] - Transform date/time formats.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=99106 _DLLStructDisplay (by Ascend4nt)] - Show Struct in ListView.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157689 _FileGetMimeType (by Wiliat87)] - Retrieve MIME types based on the extension of the filename/filepath/URL provided.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=117033 File locking with cooperative semaphores (by willichan)] - Simple file locking without a server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157241 FindMimeFromData (by twbradio)] - FindMimeFromData using urlmon.dll.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=181997 Font Icon (by J2TeaM)] - Use Font Awesome in your AutoIt project.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=68422 HotString (by jvanegmond)] - Similar to the HotKey function but trigger on a string, instead of a key or key combination.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173946 LASM - Light Assembler (by minxomat)] - Inline UDF for an Assembler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161628 LFN (by orbs)] - Overcome MAX_PATH limit of 256 chars.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111492 Link Grammar for AutoIt (by JRowe)] -  Input is a regular sentence in English, German or Italian, output is a pattern parsed from the structure of the sentence.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/147-mruau3 MRU (by Yashied)] - Most Recently Used (MRU) List Automation functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186853 _Multiprocess (by jguinch)] - Run several external programs at the same time and retrieve the exit code of each process.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=188158 .NET Common Language Runtime (CLR) Framework (by Danyfirex, Junkew, Larsj, ptrex, Trancexx)] - Allows AutoIt to access .NET Class Libraries.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=101733 NoFocusLines (by Melba23)] - Remove the dotted focus lines from buttons, sliders, radios and checkboxes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149176 NotifyIcon (by FireFox)] - Create, delete and manage self notify icons (formerly TrayIconEx). &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=63318 PixelGetColor (by Manadar)] - Get or Read Pixel from memory.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167024 RDC (by Yashied)] - ReadDirectoryChanges Wrapper.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51103 Resources (by Zedna)] - Embed any binary data into your AutoIt compiled EXE files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162499 ResourcesEx (by guinness)] - Up to date version of Zedna&#039;s Resources UDF. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111215 Restart (by Yashied)] - Allows to restart a script from any location with full restoration of the original command line parameters.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51547 SciLexer (by Kip)] - Editing control, supports multiple editors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=152093 ScriptEditor (by pandel)] - ScriptEditor with I18N support and customizable lexer completely written in AutoIt (based on SciLexer).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162033 Spell Checker (by iCode)] - Spell Checker functions to call Hunspell, Hyphenate and MyThes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164444 Synology filestation (by nend)] - Functions to interact with a Synology NAS server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163328 TimeConvert (by orbs)] - Convert UTC to/from local time, and/or reformat the string representation.&lt;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=User_Defined_Functions&amp;diff=14855</id>
		<title>User Defined Functions</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=User_Defined_Functions&amp;diff=14855"/>
		<updated>2023-07-29T08:34:54Z</updated>

		<summary type="html">&lt;p&gt;MLipok: added ===Contact and support=== to easily maintan this page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
===Preface===&lt;br /&gt;
This page is a listing of libraries of &#039;&#039;&#039;user defined functions&#039;&#039;&#039; (UDF). These libraries have been written to allow easy integration into your own scripts and are a very valuable resource for any programmer.&amp;lt;br /&amp;gt;&lt;br /&gt;
This list is probably not complete (378 UDFs on 2023-07-27), but constantly supplemented.&lt;br /&gt;
If you do not find a solution here, ask a new question on the [https://www.autoitscript.com/forum/forum/2-general-help-and-support/ forum].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
The listed UDFs might have been written for older versions of AutoIt. So there is no guarantee that every UDF works smoothly with newer versions.&amp;lt;br /&amp;gt;&lt;br /&gt;
None of the UDFs has been tested by the maintainers of this list so you as a user need to make sure that they deliver the expected results.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
===Contact and support===&lt;br /&gt;
&#039;&#039;&#039;When will an UDF be added to this list?&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
It should meet all/most of the general requirements for UDFs as described [[UDF-spec|here]].&amp;lt;br&amp;gt;&lt;br /&gt;
In addition the following requirements should be met:&lt;br /&gt;
* &#039;&#039;&#039;Documentation&#039;&#039;&#039;: So users can tell what the UDF is intended to do (&#039;&#039;mandatory&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;Examples&#039;&#039;&#039;: So users can get an idea how to use the UDF. The more the better (&#039;&#039;mandatory&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;Operating&#039;&#039;&#039; systems: Should support the latest Microsoft OS (&#039;&#039;mandatory&#039;&#039;) plus as many predecessors as possible (&#039;&#039;optional&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;AutoIt&#039;&#039;&#039;: Should support the latest version of AutoIt (&#039;&#039;mandatory&#039;&#039;) plus as many predecessors as possible (&#039;&#039;optional&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;Author&#039;&#039;&#039;: The author should still be active on the forum so he can reply to questions (&#039;&#039;optional&#039;&#039;)&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;What to do when one of your UDFs is missing?&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Please send a [https://www.autoitscript.com/forum/messenger/compose/?to=7903 PM] to user water. Add a short description of the UDF and a link to your post in the [https://www.autoitscript.com/forum/forum/9-autoit-example-scripts/ Example Scripts forum].&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Added in the past two years===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Date !! Section !! Creator !! Description&lt;br /&gt;
|-&lt;br /&gt;
|2023-07-27 || [[User_Defined_Functions#Files.2C_Databases_and_web_connections|Files, Databases and web connections]] || AspirinJunkie || [https://www.autoitscript.com/forum/imndex.php?showtopic=209526 xlsxNative (by AspirinJunkie)] - Read and write xlsx files without excel.&lt;br /&gt;
|-&lt;br /&gt;
|2023-07-27 || [[User_Defined_Functions#OpenOffice.2FLibreOffice|OpenOffice/LibreOffice]] || donnyh13 || [https://www.autoitscript.com/forum/index.php?showtopic=210514 LibreOffice Writer] - A huge list of functions for LibreOffice Writer.&lt;br /&gt;
|-&lt;br /&gt;
|2023-02-03 || [[User_Defined_Functions#Graphics_and_image|Graphics and image]] || Starg || [https://www.autoitscript.com/forum/index.php?showtopic=152950 S3D] - Draw simple 3D graphics with GDI+.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Files.2C_Databases_and_web_connections|Files, Databases and web connections]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209502 JSON] - Interacting with JSON data in AutoIt.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging|Script Coding/Analyzing/Debugging]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209529 Set] - Provides a set data type and brings the corresponding mathematical functions.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Maths|Maths]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209527 Stat] - Statistics for Autoit.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging|Script Coding/Analyzing/Debugging]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209523 ArrayPlus] - Functions for flexible Array handling (creating, extracting, rebuilding, sorting, filtering, finding, printing).&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging|Script Coding/Analyzing/Debugging]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209528 ArrayCombinations] - Different ways of composing elements of a set.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-04 || [[User_Defined_Functions#Sound|Sound]] || MattyD || [https://www.autoitscript.com/forum/index.php?showtopic=208116 MIDI UDF] - Wrap of the Windows MIDI functions.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-06-19 || [[User_Defined_Functions#Internet protocol suite|Internet protocol suite]] || Beege || [https://www.autoitscript.com/forum/index.php?showtopic=207859 cURLX64] - cURL UDF with x64 support.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-05-24 || [[User_Defined_Functions#Controls|Controls]] || kurtykurtyboy || [https://www.autoitscript.com/forum/index.php?showtopic=197654 GuiFlatButton] - Change colors of regular buttons.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-04-25 || [[User_Defined_Functions#Social_Media_and_other_Website_API|Social Media and other Website API]] || Ascer || [https://www.autoitscript.com/forum/index.php?showtopic=192391 oAuth] - Open standard for access delegation, commonly used to grant websites or applications access to other websites.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-02-22 || [[User_Defined_Functions#Files.2C_Databases_and_web_connections|Files, Databases and web connections]] || czardas || [https://www.autoitscript.com/forum/index.php?showtopic=155748 CSVSplit] - Convert to and from CSV format.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-02-11 || [[User_Defined_Functions#Inter_Process_Communications|Inter Process Communications]] || Nine || [https://www.autoitscript.com/forum/index.php?showtopic=204734 Overlapped Named Pipe IPC] - Very fast interprocess communication that could be used between VBS or AutoIt.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-01-11 || [[User_Defined_Functions#Media|Media]] || MrKm || [https://www.autoitscript.com/forum/index.php?showtopic=206133 OCRSpace] - Convert Images to text with the OCRSpace API. &lt;br /&gt;
|-&lt;br /&gt;
| 2022-01-11 || [[User_Defined_Functions#Media|Media]] || Danyfirex || [https://www.autoitscript.com/forum/index.php?showtopic=207324 UWPOCR] - Universal Windows Platform Optical Character Recognition API.&lt;br /&gt;
|-&lt;br /&gt;
| 2021-08-18 || [[User_Defined_Functions#Graphics_and_image|Graphics and image]] || smbape || [https://www.autoitscript.com/forum/index.php?showtopic=206432 OpenCV v4+] -  OpenCV UDF with support for OpenCV v4+.&lt;br /&gt;
|-&lt;br /&gt;
| 2021-08-04 || [[User_Defined_Functions#Windows|Windows]] || DonChunior || [https://www.autoitscript.com/forum/index.php?showtopic=206400 BITS] - Background Intelligent Transfer Service to download/upload files from/to HTTP web servers and SMB file shares.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Automation ==&lt;br /&gt;
&lt;br /&gt;
===Browsers===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154439 Chrome (by seangriffin)] - Automate the most common tasks in Chrome with this UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95595 Firefox (by Stilgar)] - A little less support for automation than IE, but still very good.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167661 Firefox (by Danp2)] - Modified newer version of Stilgar Firefox UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/224-firefox-profile-backup/ FireFox Profile Backup 1.0 (by careca)] - Backup or restore your firefox profile. The application searches for the profile in home drive that will be the one to backup.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124330 _FF_AutoLogin (by Stilgar)] - This is a auto-login function and login-function-generator for FireFox and the FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=92035 _FF_DM (by Stilgar)] - UDF to control the FireFox Download-Manager (not the download-window).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91650 _FF_FoxBox (by Stilgar)] - UDF to control Fox!Box (A Mozilla Firefox extension for the AVM FRITZ!Box) with FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91665 _FF_Screengrab (by Stilgar)] - UDF to control Screengrab! (FireFox-AddOn) with FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124330 _HTML (by Stilgar)] - Get informations from any HTML (XML) source, without any browser.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166542 HTMLDocumentEvents (by SmOke_N)] - Track IE document events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167035 IEEx (by SmOke_N)] - IE extended library with some Javascript options.&lt;br /&gt;
* Internet Explorer (by DaleHohm et al.) - IE library that is now supplied with a standard AutoIt install.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=153520 IUIAutomation MS framework (by junkew)] - IUIAutomation MS framework to automate chrome, FF, IE etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149203 NavInfo (by Nessie)] - With this UDF you can check if a specified browser/software is installed and which version is being used.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=61090 Opera (by MrCreatoR,)] - Automate the most common tasks in Opera with this UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191990 WebDriver (by Danp2)] - W3C compliant Webriver UDF.&lt;br /&gt;
&lt;br /&gt;
===Microsoft Office===&lt;br /&gt;
Some features of Microsoft&#039;s Office products are proprietary and cannot readily be manipulated.  Sometimes workarounds are required.&amp;lt;br&amp;gt;&amp;lt;u&amp;gt;[[Known issues with Microsoft Office automation.|This page]]&amp;lt;/u&amp;gt; is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32144 Microsoft Office Access (by randallc)] - Automate Microsoft Access.&lt;br /&gt;
* Microsoft Office Excel (by water et al.) - This UDF is included in AutoIt. Link to the [[Excel_UDF|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135312 Microsoft Office Excel Charts (by water, GreenCan)] - Creating charts using Microsoft Excel.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=204034 Microsoft Office Excel Pivot Tables (by SudeepJD)] - Create and Update Excel Pivot Tables and Charts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126305 Microsoft Office Outlook (Items) (by water)] - Automate Microsoft Outlook Items. Link to the [[OutlookEX_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202451 Microsoft Office Outlook (GUI) (by water)] - Automate Microsoft Outlook GUI. Link to the [[OutlookEX_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197346 Microsoft Office Outlook Tools (by water)] - Built on top of the OutlookEX UDF it offers some often needed extended functionality (import/export ics/vcf files etc.). Link to the [[OutlookTools|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50254 Microsoft Office PowerPoint (by Toady)] - Automate Microsoft PowerPoint.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=178783 Microsoft Office PowerPoint (by water)] - Automate Microsoft PowerPoint. Link to the [[Powerpoint|documentation]] pages.&lt;br /&gt;
* Microsoft Office Word (by water et al.) - This UDF is included in AutoIt. Link to the [[Word_UDF|documentation]] pages.&lt;br /&gt;
&lt;br /&gt;
===OpenOffice/LibreOffice===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=210514 LibreOffice Writer (by donnyh13)] - A huge list of functions for LibreOffice Writer.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151530 OOo/LibO Calc (by GMK)] - OpenOfficeCalc UDF (works also for Libre Office).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=185932 OpenOffice/LibreOffice Spell Checker (by GMK)] - Function to validate words, and show spell alternatives.&lt;br /&gt;
&lt;br /&gt;
===Other Applications===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106163 Active Directory (by water)] - Extensive library to control and manipulate the Windows active directory ([https://www.autoitscript.com/forum/files/file/355-ad-active-directory-udf/ Download]). Link to the [[Active_Directory_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87956 Java (by seangriffin)] - Creates an access bridge between your application and a Java application. Allowing you to automate some Java applications.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=86574 SAP (by seangriffin)] - SAP business management automation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149540 SAPWizard (by ozmike)] - SAPWizard UDF.&lt;br /&gt;
&lt;br /&gt;
== Script Coding/Analyzing/Debugging ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209528 ArrayCombinations (by AspirinJunkie)] - Different ways of composing elements of a set.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155442 ArrayMultiColSort (by Melba23)] - Function to sort a 2D array on several columns.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209523 ArrayPlus (by AspirinJunkie)] - Functions for flexible Array handling (creating, extracting, rebuilding, sorting, filtering, finding, printing)&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=180467 ArrayWorkshop (by czardas)] - Multidimensional array functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=59174 Associative array functions (by Nutster)] - Manage a version of associative arrays in single AutoIt variables. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=198929 AutoIt error logger (AUERLO) (by user4157124)] - File- and stdout (etc.) output of messages, regular- and COM Object errors, exit method and -code, etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=110379 AutoItObject (by ProgAndy and others)] - Brings the Object Orientation programming paradigm to AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=112879 AutoIt Syntax Highlight (by MrCreatoR)] - Highlights AutoIt v3 syntax code to html/bbcode format.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191488 cDebug (by c.haslam)] - Dumps the values of all AutoIt subtypes and expressions including nested arrays, DLL structs and maps.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195882 ErrorLog (by mLipok)] - Logs program activities and errors to different output locations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143167 GetOpt (by dany)] - Parse GNU and DOS style command line options similar to getopt().&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=156196 Log4a (by zorphnog)] - Logging library loosely based upon the log4j and NLog libaries.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195862 Loga (by Danyfirex)] - Simple logging library to keep track of code with an integrated console.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119032 Log UDF (by Yashied)] - Create a text log files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202832 OnDebugMsgBox (by argumentum)] - Catch the dreaded &amp;quot;AutoIt Error&amp;quot; MsgBox and prettify or hide it.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209529 Set (by AspirinJunkie)] - Provides a set data type and brings the corresponding mathematical functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=200660 Variants and Safearrays (by LarsJ)] - Create/access/process Variants and SafeArrays.&lt;br /&gt;
&lt;br /&gt;
=== Inter Process Communications ===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202485 AppInteract (by MrCreatoR)] - Reliably pass arrays or other types between processes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=205109 AutoItSharedData (by SEuBo)] - Create a shared data storage, a simple AutoItObject-Object, using AutoItObject_Internal.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=188991 Autoit-Socket-IO (by tarretarretarre)] - Event driven TCP/IP wrapper inspired by Socket.IO with focus on user friendliness and long term sustainability.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126936 Container (by MrCreatoR)] - Scripts interaction method. Allows to transfer whole arrays as data, and even COM objects.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=55994 DDEML (by doudou)] - Use your AutoIt script as DDE client or server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=193277 FMIPC (by argumentum)] - IPC via FileMapping.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127615 Interprocess (by JScript)] - Remotely execute a function in another script (using Mailslot).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=193158 IPC_IO (by JohnWIlling)] - IPC library supporting multiple connection types (such as: Named Pipe, File, TCP, SharedMemory, MailSlot).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202618 IPC Techniques through ROT Objects (by LarsJ)] - Implementing IRunningObjectTable Interface.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106710 Mailslot (by trancexx)] - IPC using Mailslots.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=204734 Overlapped Named Pipe IPC (by Nine)] - Very fast interprocess communication that could be used between VBS or AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169797 Pool - Post Office for Organized Labour (by RTFC)] - Provides multiple AutoIt processes with an infrastructure for exchanging messages, data, and remote-control instructions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202587 WCD IPC (by Nine)] - Framework for Inter Process Communication using Windows Messages WM_COPYDATA.&lt;br /&gt;
&lt;br /&gt;
== Files, Databases and web connections ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=180850 ADO (by mLipok)] - A modifed version of the _SQL UDF to access all kind of databases (MSSQL, MySQL, PostgreSQL, SQLite, MS ACCESS, XLS, TXT, and many other which use ADO and ODBC).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105875 ADODB (by spudw2k)] - ADODB Example.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=176895 AXML (by Aipion)] - This is a Wrapper for Pugixml, made with C++.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145142 DBF (by funkey)] - dBase database read and write with DLL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/114406-csv-file-to-multidimensional-array/?do=findComment&amp;amp;comment=799820 CSV (by ProgAndy)] - Read/write CSV files to/from 2D arrays.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197909 CSV (by seangriffin)] - Manipulate CSV files using SQLite.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155748 CSVSplit (by czardas)] - Convert to and from CSV format.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119238 Excel file generation (by jerome)] - Excel file generation (multi-sheet workbook) without the need to have Excel installed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143866 Excel XML (by FireFox)] - Work with SpreadsheetML (Open XML file formats).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155905 EXml (by jdelaney)] - Create Excel file (SpreadsheetML) through &amp;quot;Microsoft.XMLDOM&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116072 EzMySql (by Yoriz)] - Use MySQL Databases with AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148232 _FileGetProperty (by BrewManNH)] - Retrieve properties of a file.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94920 FireBird (by eltorro)] - FireBird, Interbase DLL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197421 jq (by TheXman)] - Brings the power and flexibility of jq (an open-source command-line based JSON processor) to AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209502 JSON (by AspirinJunkie)] - Interacting with JSON data in AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=104150 JSON (by Gabriel13)] - RFC4627 compliant JSON encode/decode.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148114 JSON (by Ward)] - JSMN - A Non-Strict JSON UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=156794 JSON (by ozmike)] - Bridge to Native Windows JSON plus OO extension for AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173797 JSONgen: JSON generator (by Jefrey)] - Generate JSON.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127101 MS SQL (by TheLuBu)] - MSSQL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51952 MS SQL (by ChrisL)] - _SQL. ADODB Connection.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20814 MySQL (by cdkid)] - MySQL relational database management system.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=85617 MySQL (by ProgAndy)] - MySQL UDFs (without ODBC - working with libmysql.dll).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=122360 MySQL (by James)] - MySQL ODBC Connector.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=187223 romaSQL (rynow)] - Built on the concept of Laravel Query &amp;amp; doctrine. Connection string is based on ADODB / ODBC.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143331 Sharepoint 2007/2010 (by schoppet)] - Access the SOAP-Webservices of Sharepoint 2007/2010.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=17099 SQLite (by ptrex)] - SQLite is a library that implements a self-contained, embeddable, zero-configuration SQL database engine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=142977 SQLite Array Functions (by SmOke_N)] - SQLite Array Functions - a faster method for unique arrays and sorting methods.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140521 SQLite - Database (by PhoenixXL)] - UDF for SQLite so that beginners will also be able to do the stuff.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157853 SQLiteEx (by 57ar7up)] - SQLiteEx UDF v0.5.1 - Simplest work with SQLite.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163633 Xbase I/O (by RTFC)] - Transfer data between Xbase Data file (*.dbf) and AutoIt array written in pure AutoIt (no SQL, no ADO, no dlls, no external dependencies).&lt;br /&gt;
* [https://www.autoitscript.com/forum/imndex.php?showtopic=209526 xlsxNative (by AspirinJunkie)] - Read and write xlsx files without excel.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=19848 XML DOM Wrapper (by eltorro)] - Supports CRUD operations on XML. Including XSL and XPath.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=176895 XML (by mLipok)] - New version of XML DOM Wrapper, with many new features.&lt;br /&gt;
&lt;br /&gt;
== Data compression ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=85094 7z, zip, gzip, bzip2, tar (by rasim)] - Extensive library that uses a external DLL that must be provided with the script.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=92958 gZip (by Zinthose)] - Based on the parsing of gZip.exe output. It can work with memory, it doesn&#039;t work with files. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87441 LZMA (by trancexx)] - LZMA (Native Windows).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138838 Package (by Yashied)] - Package UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=129529 pZip (by asdf8)] - PureZIP_L library UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=76176 UnRAR (by rasim)] - UnRAR.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=17727 XZip (by eltorro)] - Another UDF for &amp;quot;XStandard XZIP Component&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161847 XZip (by mLipok)] - UDF for &amp;quot;XStandard XZIP Component&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=44524 Zip plugin (by eltorro)] - Zip plugin.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=73425 ZIP (by torels)] - ZIP UDF in pure AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116565 zip (by wraithdu)] - Create ZIP files and unpack ZIP files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135565 ZIP (by joakim)] - ZIP STRUCTS UDF (from scratch).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87284 ZLib (by monoceres)] - Based on ZLib.dll. It can compress/uncompress data in memory, it doesn&#039;t work with files.&lt;br /&gt;
&lt;br /&gt;
== Encryption and hash ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81332 _Base64Encode, _Base64Decode (by trancexx)] - Fast _Base64Encode, _Base64Decode.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=153246 Base91 and Base128 (by Beege)] - Base91 and Base128 functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155538 Codecrypter (by RTFC)] - Encrypt scripts without placing the key inside the script.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=201002 Cryptography API: Next Gen (by TheXman)] - Microsoft&#039;s long-term replacement for their CryptoAPI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=203990 GDPR (by mLipok)] - Functions to encrypt/decrypt strings and files with the GDPR in mind.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95558 Hashes for files (by trancexx)] - Fast RC32, MD4, MD5, SHA1 calculation for big files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=107784 TrueCrypt (by FuryCell)] - TrueCrypt UDFs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140737 WinTrust (by kasty)] - verify the integrity of a file with its embedded signature or a given catalog.&lt;br /&gt;
&lt;br /&gt;
== GUI Additions ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97241 3D Pie chart (by WideBoyDixon)] - 3D Pie chart.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173924 Chart_UDF (by Kanashius)] - This UDF can be used to Display bar charts in a window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=96258 ContextHelp (by Yashied)] - Management of context help ([https://www.autoitscript.com/forum/index.php?showtopic=72152-contexthelp/ original]).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=109096 ExtMsgBox (by Melba23)] - A very customisable replacement for MsgBox.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105582 GUICtrlOnChangeRegister (by Mat)] - Call a function when an edits content is changed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145149 GUIExtender (by Melba23)] - Expand and contract sections of your GUI ([https://www.autoitscript.com/forum/index.php?showtopic=117909 original]).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197654 GuiFlatButton (by kurtykurtyboy)] - Change colors of regular buttons.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119505 GUIFrame (by Melba23 &amp;amp; Kip)] - Divide a GUI into adjustable frames.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=144207 GUI Panel (by FireFox)] - Manage child GUIs as panel ctrls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113723 GUI Scrollbars (by Melba23)] - Automatically sized scrollbars with a single command.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161184 MetroGUI (by BBs19)] - Windows 10 style buttons, toggles, radios etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20967 Modern tray menu (by Holger)] - Allows the creation of modern, fancy GUI and tray menus with icons and colors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=194693 MTSkin (by Taskms4)] - Simply create modern looking GUIs (borderless GUI, Interactive menu panel (with mouse-over detection), a bunch of skins).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182136 Notifications (by S3cret91)] - Display permanent desktop notifications.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=136149 Notify (by Melba23)] - Small notifications on the edge of the display.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161750 Pie chart (by Andreik)] - Pie chart.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75429 Real Vista Aero Glass (by James)] - Real Vista Aero Glass UDF - you can apply glass effect to your GUI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=71811 SetOnEvent (by martin)] - Provides an easy way for an event to call functions with parameters.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=103871 _SysTray (by wraithdu)] - Get info about and manipulate Systray icons.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108445 Toast (by Melba23)] - Small message GUIs which pop out of the Systray.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=110003 Tray Icon Bar Graph (by BeeGee)] - Creates a scrolling bar graph as the tray icon.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=132864 Uskin (by JScript)] - Allows you to skin your GUI using the Windows &#039;&#039;.MSstyles&#039;&#039; files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191821 Wi3SMenu (by NHD)] - Create a slide menu with Windows 10 style. Supports color, icon and opacity.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=129196 WinSnap (by Beege)] - Automatic Window Alignment by applying that &amp;quot;snappy edge&amp;quot; effect to your GUI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32494 XSkin (by Valuater)] - Allows skinning of your GUI and to apply custom skins.&lt;br /&gt;
&lt;br /&gt;
=== Controls ===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202529 BrowseForFolder (by MrCreatoR)] - Handle SHBrowseForFolderW with more options, such as multi selection (checkboxes), window position, controls text and more. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=146406 Calendar (by jmon)] - Calendar UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=125293 ChooseFileFolder (byMelba23)] - Single and multiple selections from specified path treeview listing.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=96464 Colorpicker (by Yashied)] - Create a button for the user to select a color.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=123409 Explorer Frame UDF (by Beege)] - Takes any frame created by GUIFrame and turns it into a MS-Windows like Explorer window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173929 GDIPlus Slider UDF (by Kanashius)] - This UDF can be used to create a slider with an imagebackground and an image to move.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=79412 Graph control (by andybiochem)] - Easily create and show bar chart and line charts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=104399 GraphGDIPlus UDF (by andybiochem)] - Easily create and show bar chart and line charts with GDI+ to take advantage of double-buffering.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105682 GUICtrlCreateFinder (by Mat)] - Allows you to create a window finder control like the one seen in AutoIt Window Info.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=107965 GUIHotkey (by Mat)] - UDF for using native hotkey controls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182492 GUIListViewEx (by Melba23)] - Insert, delete, move, drag, sort, edit and colour ListView items.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111438 GUIPager (by Mat)] - Create and control native pager controls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20967 GUI/Tray Menu (by Holger, LarsJ, AZJIO)] - GUI/Tray Menu with icons and colors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166594 GUITreeViewEx (by Melba23)] - Check/clear parent and child checkboxes in a TreeView.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=90598 Hotkey input control (by Yashied)] - Hotkeys Input Control UDF Library (Non-native).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173932 ListView Edit UDF (by Kanashius)] - This UDF can be used to simply edit an Listview.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=109355 ListView - Explorer like ListView UDF (by Beege)] - This UDF simplify creating MS Explorer-like ListViews.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143711 Marquee (by Melba23)] - Make tickertape info bars.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143380 Predict Text UDF (by PhoenixXL)] - Sub classes the edit control and matches the current word through the Database &amp;amp; sets selection in accordance.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163939 Progressbar new style (by Muzaiyan)] - New styles for your progress bar.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=74649 Progressbar with GDIplus (by ProgAndy)] - You even can use full textured images.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151636 RestrictEdit_SRE UDF (by PhoenixXL)] - Restrict the text that can be entered in an editbox through a String Regular Expression.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=128242 Ribbon (by trancexx)] - UDF for Windows Ribbon framework.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114034 StringSize (by Melba23)] - Automatically size controls to fit the text you want to put in them.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126958 Syslink (by Yashied)] - Provides a convenient way to embed hypertext links in a window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105814 Table (by andybiochem)] - Table UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=125251 TVExplorer (by Yashied)] - Allows to create TreeView (TV) Explorer controls that display a tree of files and folders.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=190659 Virtual Listview (by LarsJ)] - Virtual Listview for large amounts of data with a large number of rows.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195053 Windows Message Monitor (by LarsJ)] - Monitor Windows Messages of a window or control.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=118317 Battery UDF (by Yashied)] - Retrieves a various information and current status of the battery(s).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154727 BuildPartitionTable (by RTFC)] - Scans a physical drive&#039;s partition table and returns a partition_table, allocation_table and volumes_table.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155674 CommAPI (by therealhanuta)] - Serial and parallel communication (COM port, RS-232, LPT port) - without installing DLL&#039;s (using Windows API calls).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=77731 Device Management (by weaponx)] - Device Management API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97487 DirectShow (by monoceres)] - DirectShow UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164700 DirectSound (by eukalyptus)] - DirectSound UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164701 Direct2D (by eukalyptus)] - Direct2D UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=99713 Drive Info (by NerdFencer)] - Gathers drive info for Hard Drives, Disk Drives, and Floppy Drives.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138989 FritzBox (by Allow2010)] - _FB_Tools - manage your FritzBox from Autoit.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121084 I/O Port Functions (by Ascend4nt)] - Input/Output UDF for interacting with ports (x64 Parallel Port, Keyboard etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=203207 MediaDevice (by Danyfirex)] - Transfer files to portable devices like phones, storages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154350 Monitor Configuration (by jaberwacky)] - Monitor Configuration UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155469 Mouse (by AlmarM)] - AutoIt powered mouse events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=147325 MouseTrapEvent (by ozmike)] - MouseTrapEvent UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149083 NetInfo (by Nessie)] - UDF for test internet download speed and upload speed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155539 Network configuration (by jguinch)] - Network configuration UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182684 Nitgen (by Jefrey)] - UDF to work with Nitgen fingerprint readers that use NGenBio SDK.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155485 Printers management with WMI (by jguinch)] - Allows to manage printers: add/delete printer, driver, port, or obtain configuration, set default printer ...&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=189190 Serial port UDF / COM port UDF (by MazeM)] - Another UDF for the serial port. It is very similar to CommAPI using kernel32.dll, but all code is packed into a single file without any dependencies.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=128546 Serial Port/COM (by martin)] - Serial Port /COM Port UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27755 SMARTDRIVE (by ptrex)] - SMART drive Analysis.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158640 SPI Hardware Interface (by Blinky)] - Communicate with the MAX335 chip using the SPI protocol via the LPT (printer) port.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=8188 VISA/GPIB (by Angel)] - VISA/GPIB library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=68866 Webcam (by LIMITER)] - Webcam UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70857 Webcam (by ludocus)] - Webcam UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91018 WiFi (by MattyD)] - Low level control over your wireless LAN.&lt;br /&gt;
&lt;br /&gt;
== Information gathering ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=29404 Computer information (by JSThePatriot)] - A general purpose library to get various details about a Windows machine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151920 NetworkStatistics (by Ascend4nt)] - Network Interface Info, Statistics, and Traffic.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=54039 WinPcap (by JRSmile)] - Wrapper for the windows packet capture library WinPcap.&lt;br /&gt;
* [https://opensource.grisambre.net/pcapau3/ WinPcap (by Nicolas Ricquemaque)] - A library to access the main functionalities offered by the WinPcap driver.&lt;br /&gt;
&lt;br /&gt;
== Internet protocol suite ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=207859 cURLX64 (by Beege)] - cURL UDF with x64 support.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=137456 cURL (by seangriffin)] - A UDF for transferring data with URL syntax.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=187718 HTTP lib (by Jefrey)] - HTTP lib (GET, POST and upload) UDF to simplify HTTP requests, mainly when dealing about POST data or file uploads.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202895 HttpApi (by TheXman)] - HTTP Server API enables applications to communicate over HTTP without using MS Internet Information Server (IIS).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=40243 IMAP (by mikeytown2)] - IMAP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108422 IMAP4 (by Tipulatoid)] - IMAP4 UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=43515 IRC (by McGod)] - A lightweight library for communicating with IRC servers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=159285 IRC (by rcmaehl)] - IRC UDF - Updated Version of Chips&#039; IRC UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=22838 POP3 (by Apzo)] - POP3 library for retrieving email messages. Not compatible with Gmail because it uses SSL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167339 POP3 (by mLipok)] - POP3 UDF According to the 1939 RFC, modified version with Quoted Printable decoder.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154530 Prowl (by mrflibblehat)] - Push notifications to iPhone, iPod touch or iPad using Prowl (Growl client for iOS).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138095 SFTP (by Lupo73)] - UDF to support SFTP protocol using PSFTP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154054 Socket UDF (by funkey)] - Socket UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=23860 SMTP (by Jos)] - Smtp Mailer That Supports Html And Attachments.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167292 SMTP Mailer UDF (by mLipok)] - Smtp Mailer That Supports Html And Attachments - Modified Version with support to save EML files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81687 SNMP (by enaiman)] - SNMP_UDF for SNMPv1 and SNMPv2c.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70759 SNMP - MIB protocol (by ptrex)] - Reading toner status from SNMP device with WMI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166579 SSH (by jeanphile)] - Use the SSH protocol very easily in your code.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=185329 STUN (by j0kky)] - STUN is a protocol that permits you to know your external IP but, more interesting, your external port associated to your internal port.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=184817 SyslogSend (by Irios)] - This allows sending (BSD) messages to a syslog server using UDP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169774 TCPServer (by Jefrey)] - Multi client, event-based, able to bind console app to socket.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=57022 UPnP Protocol (by ptrex)] - UPnP - Read and Control your devices in side out.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=84133 WinHTTP (by trancexx)] - Access the HTTP protocol for creating GET and POST requests and submitting them with conforming standards, cookies not supported.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=77503 WinInet (by -Ultima-)] - Access standard Internet protocols (FTP, Gopher and HTTP). Supports GET/POST requests and cookies.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=181645 Winsock (by j0kky)] - Create client/server application using native winsock functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191954 WSA_NBTCP (by ripdad)] - Windows Sockets API - Non-Blocking Transmission Control Protocol.&lt;br /&gt;
&lt;br /&gt;
== Maths ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170658 Advanced Math UDF (by scintilla4evr)] - Advanced mathematical functions (primes, number sequences, interpolate, calculate values of functions like Riemann zeta etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=102686 Advanced rounding (by Mat)] - Support for different measures of accuracy and 8 ways to resolve tie breaks.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83529 Big number (by eukalyptus)] - Make calculations with extremely large numbers that AutoIt normally is not able to support.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106551 Decimal To fraction (by Malkey)] - Converts any decimal number to a fraction. Example: 1.2 to 6/5.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/319-eigen4autoit/ Eigen4AutoIt (by RFTC)] - Allows to perform fast matrix operations on large numerical data sets, and much more ....&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140789 MathsEx UDF (by PhoenixXL)] - Functions for Carrying Out More Advanced Mathematical Calculations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81189 Number base conversion (by james3mg)] - From, to and between positive bases less than 63 (decimals supported).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=117156 NumToWord (by Mat)] - Convert numerals to a human readable string.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108803 Polynomials (by Mat)] - Functions for using polynomials.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83091 Primes (by jennico)] - Many functions dealing with prime number generation and calculations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94770 Roman Numerals (by AZJIO)] - Roman Numerals.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=98160 Root function (by Mat)] - Working out real roots of numbers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209527 Stat (by AspirinJunkie)] - Statistics for Autoit.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163899 StringAPL (by minx)] - inline APL interpreter.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=82722 Trigonometric and math functions (by trancexx)] - _ATan2(), _Cosh(), _Frexp(), _Hypot(), _Ldexp(), _Logb(), _Sinh(), _Tanh().&lt;br /&gt;
&lt;br /&gt;
== Media ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95357 FreeImage library (by ProgAndy)] - Various operations on images, such as rotate, resize, flip.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127263 HtmlHelp (by Geodetic)] - HtmlHelp functions for context-sensitive help from CHM (compiled HTML) files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116009 HyperCam (by seangriffin)] - HyperCam (Screen Recording) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182535 HyCam2 (by willichan)] - Automation for HyCam2 screen recording utility.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50608 OCR (by ptrex)] - Real OCR in AU3 - MODI with MS Office 2003.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=89542 OCR (by seangriffin)] - Tesseract (Screen OCR) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=206133 OCRSpace (by MrKm)] - Convert Images to text with the OCRSpace API. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51054 Printer controller (by martin)] - Print text in any font, size and colour at any position on the page, draw lines, curves, elipses, pies in any colour, and print images.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=73993 Printing (by GRS)] - Printing from AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202621 QRCreator (by BugFix)] - Simple QR-code creation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161831 RTF_Printer (by mLipok)] - Printing RichEdit in the background.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94834 Simple DirectMedia Layer (by AdmiralClaws)] - Adds support for joysticks, CDs, 2D graphics, timers. See [https://www.libsdl.org/ SDL website] for more information.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=207324 UWPOCR (by Danyfirex)] - Universal Windows Platform Optical Character Recognition API.&lt;br /&gt;
&lt;br /&gt;
===Graphics and image===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202987 AutoYolo3 (by smartee)] - Real-Time Object Detection using YOLOv3 wrapper.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113881 au3Irrlicht2 (by JRowe)] - Combining Irrlicht and AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=86748 AVI writing udf (by monoceres)] - Create uncompressed avi&#039;s from bitmap files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27362 Bitmap Library (by evilertoaster)] - Bitmap Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202663 GIF animation (by Nine)] - Fast cached GIF animation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150231 GTK+  (by prazetto)] - GTK+ Framework | Widgets.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=13096 ImageGetInfo (by Lazycat)] - Read info from JPEG, TIFF, BMP, PNG and GIF - size, color depth, resolution.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/471-image-search-udf Image Search (by VIP)] - Search for an image on the desktop. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70506 IrrLicht (by A. Percy)] - A 3D graphics engine suitable for creating games.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160732 OpenCV (by myliseJ)] - UDF for the OpenCV library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=206432 OpenCV v4+ (by smbape)] - OpenCV UDF with support for OpenCV v4+.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151011 OpenGL (by LarsJ)] - OpenGL without external libraries etc. For JPEG files it also retrieves various Exif information.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148129 OpenGL (2.0) (by minx)] - New set of UDFs for OpenGL + AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=152950 S3D (by Starg)] - Draw simple 3D graphics with GDI+.&lt;br /&gt;
&lt;br /&gt;
===Players===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114143 VLC (by seangriffin)] - VLC (Media Player) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91316 VLC Media Player (by ptrex)] - VLC Media Player.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27352 WMP (by ConsultingJoe)] - Windows Media Player UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=44008 WMP - Media Controls (by CFire)] - Another Windows Media Player UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=203154 WMP - GUI Control (by SudeepJD)] - IE based WMP Control.&lt;br /&gt;
&lt;br /&gt;
===Sound===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83481 BASS Function Library (by BrettF)] - Sound and Music via wrappers for Bass, BassEnc, Bass FX, BassSFX, BassAsio and BassCd DLLs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173808 libZPlay (by Danyfirex)] - Multimedia library for playing mp3, mp2, mp1, ogg, flac, ac3, aac, oga, wav and pcm files and streams.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=37072 MIDI (by eynstyne)] - MIDI UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=208116 MIDI (by MattyD)] - Wrap of the Windows MIDI functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114742 SAPIListBox (by seangriffin)] - SAPIListBox (Speech Recognition) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=100439 TTS (by Beege)] - Text-to-Speech UDF.&lt;br /&gt;
&lt;br /&gt;
== PDF ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162195 Acrobat Reader - ActiveX Viewer (by mLipok)] - Make your own PDF Viewer GUI with Acrobat Reader ActiveX COM Object &amp;quot;AcroPDF.PDF.1&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164469 Debenu PDF Viewer SDK (by mLipok)] - A collection of functions to display PDF files in your applications using Debenu PDF Viewer SDK.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160875 Debenu Quick PDF Library (by mLipok)] - A collection of functions for Debenu Quick PDF Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75832 FoxIt Reader (by ptrex)] - PDF Reader in AU3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=118827 MPDF (by taietel)] - Create PDF from your application.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=42776 PDFCreator (by ptrex)] - Automation of PDFCreator allows you to create and manipulate PDF files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170550 PDFCreator (by mLipok)] - UDF for PDFCreator v1.x.x with working EVENTs Handler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32261 _StringToPDF (by Tam0r)] - Write a string to a PDF file and specify font size, type etc.&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145158 Firewall (by JLogan3o13)] - Control and manipulate the Windows Firewall (enable/disable, Exclusions list, enable/disable ports etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=194015 Firewall policy2 (by Bilgus)]- Provides access to the firewall policy for Windows Vista+.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150819 VirusTotal (by Danyfirex)] - VirusTotal API 2.0 UDF.&lt;br /&gt;
&lt;br /&gt;
== Social Media and other Website API ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=159254 Cex.io (by AquilesCrespo)] - UDF script for using with the web api from https://cex.io/ server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169333 CrowdinAPI (by mLipok)] - Uses the [https://crowdin.com/page/api crowdin.net website API] for some functions (create projects, add and update files, download translations or integrate localization).&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/290-dropbox-authenticator/ Dropbox authenticator (by Gimerly)] - Dropbox authenticator.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158106 Easypost (by dcat127)] - Print USPS Postage Labels.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114801 eBay (by seangriffin)] - eBay UDF (functions GetItemStatus and GetSingleItem from the &amp;quot;Shopping API&amp;quot;).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=141340 Gmail (by PhoenixXL)] - Remote Gmail (UDF).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=192422 Gmail API (by Ascer)] - Automate communication with Gmail using oAuth 2.0 security. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=98504 Google Functions (by Beege)] - Google Functions (Suggestions, Definitions, Translate, Convert).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=115437 Google Maps (by seangriffin)] - Google Maps UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70675 iTunes (by torels)] - iTunes UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=101802 iTunes (by Beege)] - Another iTunes UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150985 No-IP (by Nessie)] - Simply update your no-ip hostname(s) and retrieve the ip address of an no-ip address.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=192391 oAuth (by Ascer)] - Open standard for access delegation, commonly used to grant websites or applications access to other websites.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150838 PasteBin (by mrflibblehat)] - Pastebin UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121767 Skype (by FireFox)] - Skype4COM provides an ActiveX interface to the Skype API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113234 Teamspeak 3 (by chipDE)] - Teamspeak 3 UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186944 TeamViewer API (by mLipok)] - A collection of function for use with TeamViewer API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186381 Telegram Bot (by LinkOut)] - UDF for [https://core.telegram.org/api Telegram messenger API].&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166547 TVmaze.com API (by BBs19)] - TVmaze.com API UDF (TV-Series).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116600 Twitter (by seangriffin)] - Manage Twitter.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149247 Yahoo Weather (by Nessie)] - Yahoo Weather API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=112775 Youtube Uploader (by BrettF)] - AYTU - AutoIt Youtube Uploader.&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50880 ACL (by ptrex)] - Set ACL on windows Objects.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=134508 ACL (by FredAl)] - Do most everything with the DACL and ownership on all types of objects: Files or folders, Registry keys, services, Kernel and WMI objects, etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=206400 BITS (by DonChunior)] - Background Intelligent Transfer Service to download files from or upload files to HTTP web servers and SMB file shares.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=184937 CertUtil (by mLipok)] - Wrapper for windows certutil.exe (command-line program that is installed in Windows as part of Certificate Services).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113560 FileSystemMonitor (by seangriffin)] - Monitors the file system by recording all file system events occurring within a given path.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111018 ITaskBarList (by Beege)] - ITaskBarList UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=74118 Local account (by engine)] - Manage local accounts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161193 Magnifier Functions (by Ascend4nt)] - Exposes most of the useful Magnifier API functions available since Windows Vista.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75250 Registry (by engine)] - Windows Registry UDFs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50551 Registry (by seanhart)] - RegWriteAllUsers / RegDeleteAllUsers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=80201 Service (by arcker)] - Build your own service with AutoIt code.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124508 Startup (by guinness)] - Create Startup entries in the Startup Folder or Registry.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164756 SCCM (by JLogan3o13)] - Systems Center Configuration Manager Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=134628 System restore (by FredAI)] - System restore UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186111 SubstWrapper (by mLipok)] - Wrapper for windows subst.exe command - (Associates a path with a drive letter).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135994 Taskplanner/Taskscheduler COM (by Allow2010)] - an UDF for using the Windows Taskplaner / Task Scheduler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83355 Task Scheduler (by dbzfanatic)] - Task Scheduler UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=200068 TaskScheduler (by water)] - Brushed up Task Scheduler UDF. Link to the [[TaskScheduler|documentation pages]].&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173934 TTS (by Kanashius)] - Used with SAPI Automation Object - text-to-speech (TTS) engine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158377 UAC (by AdamUL)] - User Account Control (UAC) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=175719 Utter (by Surya)] - Utilizing more of SAPI (Speech Recognition UDF).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127075 WIMGAPI (by Homes32)] - Manipulate Windows Image Files (.wim) without ImageX.exe.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=28436 Windows Events (by Emperor)] - Create your own Windows events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=6487 Windows Service Control functions (by SumTingWong)] - Some limited functions to control services (create, start, stop, delete, check ...).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81880 Windows Services (by engine)] - Windows Services UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163178 WRMF (by Luigi)] - WRMF - Windows Registry Monitor Call Function.&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&amp;lt;!-- Removed 2020-05-30 as adequate documentation is missing * [https://www.autoitscript.com/forum/topic/178871-dllcall-with-c-example/#comment-1285754 SMSApi (by mLipok)] - UDF for SMSAPi which provides SMS services. --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Removed 2020-05-30 as adequate documentation is missing * [https://www.autoitscript.com/forum/index.php?showtopic=178589 BulkSMS (by Skysnake)] - UDF for BulkSMS which provides SMS services. --&amp;gt;&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145099 _AdlibEnhance (by JScript)] - Enhance Adlib to call functions with parameters, pause and resume.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160936 Android (by Moriba)] - Control any Android device.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97826 Animated tray icons (by Yashied)] - Make animated tray icons easily.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163577 Atom Table (by Ascend4nt)] - Store (add, find, delete, and query) strings locally (at program level) or globally (at OS level) with unique numerical identifiers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170087 Barcode generators (by willichan)] - Creates a Code128A/B/C or Creates a Code39 or Code39Extended optimized barcode from supplied data.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87735 BlockInputEx (by MrCreatoR)] - Supports a few features that built-in BlockInput() function does not.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=199762 BlockInputEx (by Nine)] - Block all input coming from mouse and/or keyboard, without having an UAC warning displayed. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=29763 Clipboard (by eltorro)] - When apps need to watch the clipboard.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170630 ClipboardEx (by ozmike)] - Allows to have more than 1 item in the Clipboard. Handles all data types, not just text.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81267 Clipboard History (by wraithdu)] - Save and restore the entire clipboard contents. Inspired by AHK&#039;s ClipboardAll.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169610 CmdLine (by Jefrey)] - Collection of functions to parse command line arguments.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126569 Console (by Shaggi)] - Functions and features to work wiht Console input/output.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121833 Copy (by Yashied)] - Copy or move files and directories without suspending your script. Retrieve the current state (copied bytes, error code etc.) while copying.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154684 Date / Time convert (by Melba23)] - Transform date/time formats.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=99106 _DLLStructDisplay (by Ascend4nt)] - Show Struct in ListView.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157689 _FileGetMimeType (by Wiliat87)] - Retrieve MIME types based on the extension of the filename/filepath/URL provided.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=117033 File locking with cooperative semaphores (by willichan)] - Simple file locking without a server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157241 FindMimeFromData (by twbradio)] - FindMimeFromData using urlmon.dll.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=181997 Font Icon (by J2TeaM)] - Use Font Awesome in your AutoIt project.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=68422 HotString (by jvanegmond)] - Similar to the HotKey function but trigger on a string, instead of a key or key combination.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173946 LASM - Light Assembler (by minxomat)] - Inline UDF for an Assembler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161628 LFN (by orbs)] - Overcome MAX_PATH limit of 256 chars.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111492 Link Grammar for AutoIt (by JRowe)] -  Input is a regular sentence in English, German or Italian, output is a pattern parsed from the structure of the sentence.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/147-mruau3 MRU (by Yashied)] - Most Recently Used (MRU) List Automation functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186853 _Multiprocess (by jguinch)] - Run several external programs at the same time and retrieve the exit code of each process.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=188158 .NET Common Language Runtime (CLR) Framework (by Danyfirex, Junkew, Larsj, ptrex, Trancexx)] - Allows AutoIt to access .NET Class Libraries.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=101733 NoFocusLines (by Melba23)] - Remove the dotted focus lines from buttons, sliders, radios and checkboxes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149176 NotifyIcon (by FireFox)] - Create, delete and manage self notify icons (formerly TrayIconEx). &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=63318 PixelGetColor (by Manadar)] - Get or Read Pixel from memory.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167024 RDC (by Yashied)] - ReadDirectoryChanges Wrapper.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51103 Resources (by Zedna)] - Embed any binary data into your AutoIt compiled EXE files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162499 ResourcesEx (by guinness)] - Up to date version of Zedna&#039;s Resources UDF. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111215 Restart (by Yashied)] - Allows to restart a script from any location with full restoration of the original command line parameters.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51547 SciLexer (by Kip)] - Editing control, supports multiple editors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=152093 ScriptEditor (by pandel)] - ScriptEditor with I18N support and customizable lexer completely written in AutoIt (based on SciLexer).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162033 Spell Checker (by iCode)] - Spell Checker functions to call Hunspell, Hyphenate and MyThes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164444 Synology filestation (by nend)] - Functions to interact with a Synology NAS server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163328 TimeConvert (by orbs)] - Convert UTC to/from local time, and/or reformat the string representation.&lt;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=User_Defined_Functions&amp;diff=14854</id>
		<title>User Defined Functions</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=User_Defined_Functions&amp;diff=14854"/>
		<updated>2023-07-29T08:32:55Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Introduction */  added ===Preface=== to easily maintain page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
===Preface===&lt;br /&gt;
This page is a listing of libraries of &#039;&#039;&#039;user defined functions&#039;&#039;&#039; (UDF). These libraries have been written to allow easy integration into your own scripts and are a very valuable resource for any programmer.&amp;lt;br /&amp;gt;&lt;br /&gt;
This list is probably not complete (378 UDFs on 2023-07-27), but constantly supplemented.&lt;br /&gt;
If you do not find a solution here, ask a new question on the [https://www.autoitscript.com/forum/forum/2-general-help-and-support/ forum].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
The listed UDFs might have been written for older versions of AutoIt. So there is no guarantee that every UDF works smoothly with newer versions.&amp;lt;br /&amp;gt;&lt;br /&gt;
None of the UDFs has been tested by the maintainers of this list so you as a user need to make sure that they deliver the expected results.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;When will an UDF be added to this list?&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
It should meet all/most of the general requirements for UDFs as described [[UDF-spec|here]].&amp;lt;br&amp;gt;&lt;br /&gt;
In addition the following requirements should be met:&lt;br /&gt;
* &#039;&#039;&#039;Documentation&#039;&#039;&#039;: So users can tell what the UDF is intended to do (&#039;&#039;mandatory&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;Examples&#039;&#039;&#039;: So users can get an idea how to use the UDF. The more the better (&#039;&#039;mandatory&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;Operating&#039;&#039;&#039; systems: Should support the latest Microsoft OS (&#039;&#039;mandatory&#039;&#039;) plus as many predecessors as possible (&#039;&#039;optional&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;AutoIt&#039;&#039;&#039;: Should support the latest version of AutoIt (&#039;&#039;mandatory&#039;&#039;) plus as many predecessors as possible (&#039;&#039;optional&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;Author&#039;&#039;&#039;: The author should still be active on the forum so he can reply to questions (&#039;&#039;optional&#039;&#039;)&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;What to do when one of your UDFs is missing?&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Please send a [https://www.autoitscript.com/forum/messenger/compose/?to=7903 PM] to user water. Add a short description of the UDF and a link to your post in the [https://www.autoitscript.com/forum/forum/9-autoit-example-scripts/ Example Scripts forum].&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
===Added in the past two years===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Date !! Section !! Creator !! Description&lt;br /&gt;
|-&lt;br /&gt;
|2023-07-27 || [[User_Defined_Functions#Files.2C_Databases_and_web_connections|Files, Databases and web connections]] || AspirinJunkie || [https://www.autoitscript.com/forum/imndex.php?showtopic=209526 xlsxNative (by AspirinJunkie)] - Read and write xlsx files without excel.&lt;br /&gt;
|-&lt;br /&gt;
|2023-07-27 || [[User_Defined_Functions#OpenOffice.2FLibreOffice|OpenOffice/LibreOffice]] || donnyh13 || [https://www.autoitscript.com/forum/index.php?showtopic=210514 LibreOffice Writer] - A huge list of functions for LibreOffice Writer.&lt;br /&gt;
|-&lt;br /&gt;
|2023-02-03 || [[User_Defined_Functions#Graphics_and_image|Graphics and image]] || Starg || [https://www.autoitscript.com/forum/index.php?showtopic=152950 S3D] - Draw simple 3D graphics with GDI+.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Files.2C_Databases_and_web_connections|Files, Databases and web connections]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209502 JSON] - Interacting with JSON data in AutoIt.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging|Script Coding/Analyzing/Debugging]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209529 Set] - Provides a set data type and brings the corresponding mathematical functions.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Maths|Maths]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209527 Stat] - Statistics for Autoit.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging|Script Coding/Analyzing/Debugging]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209523 ArrayPlus] - Functions for flexible Array handling (creating, extracting, rebuilding, sorting, filtering, finding, printing).&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging|Script Coding/Analyzing/Debugging]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209528 ArrayCombinations] - Different ways of composing elements of a set.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-04 || [[User_Defined_Functions#Sound|Sound]] || MattyD || [https://www.autoitscript.com/forum/index.php?showtopic=208116 MIDI UDF] - Wrap of the Windows MIDI functions.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-06-19 || [[User_Defined_Functions#Internet protocol suite|Internet protocol suite]] || Beege || [https://www.autoitscript.com/forum/index.php?showtopic=207859 cURLX64] - cURL UDF with x64 support.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-05-24 || [[User_Defined_Functions#Controls|Controls]] || kurtykurtyboy || [https://www.autoitscript.com/forum/index.php?showtopic=197654 GuiFlatButton] - Change colors of regular buttons.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-04-25 || [[User_Defined_Functions#Social_Media_and_other_Website_API|Social Media and other Website API]] || Ascer || [https://www.autoitscript.com/forum/index.php?showtopic=192391 oAuth] - Open standard for access delegation, commonly used to grant websites or applications access to other websites.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-02-22 || [[User_Defined_Functions#Files.2C_Databases_and_web_connections|Files, Databases and web connections]] || czardas || [https://www.autoitscript.com/forum/index.php?showtopic=155748 CSVSplit] - Convert to and from CSV format.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-02-11 || [[User_Defined_Functions#Inter_Process_Communications|Inter Process Communications]] || Nine || [https://www.autoitscript.com/forum/index.php?showtopic=204734 Overlapped Named Pipe IPC] - Very fast interprocess communication that could be used between VBS or AutoIt.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-01-11 || [[User_Defined_Functions#Media|Media]] || MrKm || [https://www.autoitscript.com/forum/index.php?showtopic=206133 OCRSpace] - Convert Images to text with the OCRSpace API. &lt;br /&gt;
|-&lt;br /&gt;
| 2022-01-11 || [[User_Defined_Functions#Media|Media]] || Danyfirex || [https://www.autoitscript.com/forum/index.php?showtopic=207324 UWPOCR] - Universal Windows Platform Optical Character Recognition API.&lt;br /&gt;
|-&lt;br /&gt;
| 2021-08-18 || [[User_Defined_Functions#Graphics_and_image|Graphics and image]] || smbape || [https://www.autoitscript.com/forum/index.php?showtopic=206432 OpenCV v4+] -  OpenCV UDF with support for OpenCV v4+.&lt;br /&gt;
|-&lt;br /&gt;
| 2021-08-04 || [[User_Defined_Functions#Windows|Windows]] || DonChunior || [https://www.autoitscript.com/forum/index.php?showtopic=206400 BITS] - Background Intelligent Transfer Service to download/upload files from/to HTTP web servers and SMB file shares.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Automation ==&lt;br /&gt;
&lt;br /&gt;
===Browsers===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154439 Chrome (by seangriffin)] - Automate the most common tasks in Chrome with this UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95595 Firefox (by Stilgar)] - A little less support for automation than IE, but still very good.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167661 Firefox (by Danp2)] - Modified newer version of Stilgar Firefox UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/224-firefox-profile-backup/ FireFox Profile Backup 1.0 (by careca)] - Backup or restore your firefox profile. The application searches for the profile in home drive that will be the one to backup.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124330 _FF_AutoLogin (by Stilgar)] - This is a auto-login function and login-function-generator for FireFox and the FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=92035 _FF_DM (by Stilgar)] - UDF to control the FireFox Download-Manager (not the download-window).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91650 _FF_FoxBox (by Stilgar)] - UDF to control Fox!Box (A Mozilla Firefox extension for the AVM FRITZ!Box) with FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91665 _FF_Screengrab (by Stilgar)] - UDF to control Screengrab! (FireFox-AddOn) with FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124330 _HTML (by Stilgar)] - Get informations from any HTML (XML) source, without any browser.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166542 HTMLDocumentEvents (by SmOke_N)] - Track IE document events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167035 IEEx (by SmOke_N)] - IE extended library with some Javascript options.&lt;br /&gt;
* Internet Explorer (by DaleHohm et al.) - IE library that is now supplied with a standard AutoIt install.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=153520 IUIAutomation MS framework (by junkew)] - IUIAutomation MS framework to automate chrome, FF, IE etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149203 NavInfo (by Nessie)] - With this UDF you can check if a specified browser/software is installed and which version is being used.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=61090 Opera (by MrCreatoR,)] - Automate the most common tasks in Opera with this UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191990 WebDriver (by Danp2)] - W3C compliant Webriver UDF.&lt;br /&gt;
&lt;br /&gt;
===Microsoft Office===&lt;br /&gt;
Some features of Microsoft&#039;s Office products are proprietary and cannot readily be manipulated.  Sometimes workarounds are required.&amp;lt;br&amp;gt;&amp;lt;u&amp;gt;[[Known issues with Microsoft Office automation.|This page]]&amp;lt;/u&amp;gt; is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32144 Microsoft Office Access (by randallc)] - Automate Microsoft Access.&lt;br /&gt;
* Microsoft Office Excel (by water et al.) - This UDF is included in AutoIt. Link to the [[Excel_UDF|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135312 Microsoft Office Excel Charts (by water, GreenCan)] - Creating charts using Microsoft Excel.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=204034 Microsoft Office Excel Pivot Tables (by SudeepJD)] - Create and Update Excel Pivot Tables and Charts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126305 Microsoft Office Outlook (Items) (by water)] - Automate Microsoft Outlook Items. Link to the [[OutlookEX_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202451 Microsoft Office Outlook (GUI) (by water)] - Automate Microsoft Outlook GUI. Link to the [[OutlookEX_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197346 Microsoft Office Outlook Tools (by water)] - Built on top of the OutlookEX UDF it offers some often needed extended functionality (import/export ics/vcf files etc.). Link to the [[OutlookTools|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50254 Microsoft Office PowerPoint (by Toady)] - Automate Microsoft PowerPoint.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=178783 Microsoft Office PowerPoint (by water)] - Automate Microsoft PowerPoint. Link to the [[Powerpoint|documentation]] pages.&lt;br /&gt;
* Microsoft Office Word (by water et al.) - This UDF is included in AutoIt. Link to the [[Word_UDF|documentation]] pages.&lt;br /&gt;
&lt;br /&gt;
===OpenOffice/LibreOffice===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=210514 LibreOffice Writer (by donnyh13)] - A huge list of functions for LibreOffice Writer.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151530 OOo/LibO Calc (by GMK)] - OpenOfficeCalc UDF (works also for Libre Office).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=185932 OpenOffice/LibreOffice Spell Checker (by GMK)] - Function to validate words, and show spell alternatives.&lt;br /&gt;
&lt;br /&gt;
===Other Applications===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106163 Active Directory (by water)] - Extensive library to control and manipulate the Windows active directory ([https://www.autoitscript.com/forum/files/file/355-ad-active-directory-udf/ Download]). Link to the [[Active_Directory_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87956 Java (by seangriffin)] - Creates an access bridge between your application and a Java application. Allowing you to automate some Java applications.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=86574 SAP (by seangriffin)] - SAP business management automation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149540 SAPWizard (by ozmike)] - SAPWizard UDF.&lt;br /&gt;
&lt;br /&gt;
== Script Coding/Analyzing/Debugging ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209528 ArrayCombinations (by AspirinJunkie)] - Different ways of composing elements of a set.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155442 ArrayMultiColSort (by Melba23)] - Function to sort a 2D array on several columns.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209523 ArrayPlus (by AspirinJunkie)] - Functions for flexible Array handling (creating, extracting, rebuilding, sorting, filtering, finding, printing)&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=180467 ArrayWorkshop (by czardas)] - Multidimensional array functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=59174 Associative array functions (by Nutster)] - Manage a version of associative arrays in single AutoIt variables. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=198929 AutoIt error logger (AUERLO) (by user4157124)] - File- and stdout (etc.) output of messages, regular- and COM Object errors, exit method and -code, etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=110379 AutoItObject (by ProgAndy and others)] - Brings the Object Orientation programming paradigm to AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=112879 AutoIt Syntax Highlight (by MrCreatoR)] - Highlights AutoIt v3 syntax code to html/bbcode format.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191488 cDebug (by c.haslam)] - Dumps the values of all AutoIt subtypes and expressions including nested arrays, DLL structs and maps.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195882 ErrorLog (by mLipok)] - Logs program activities and errors to different output locations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143167 GetOpt (by dany)] - Parse GNU and DOS style command line options similar to getopt().&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=156196 Log4a (by zorphnog)] - Logging library loosely based upon the log4j and NLog libaries.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195862 Loga (by Danyfirex)] - Simple logging library to keep track of code with an integrated console.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119032 Log UDF (by Yashied)] - Create a text log files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202832 OnDebugMsgBox (by argumentum)] - Catch the dreaded &amp;quot;AutoIt Error&amp;quot; MsgBox and prettify or hide it.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209529 Set (by AspirinJunkie)] - Provides a set data type and brings the corresponding mathematical functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=200660 Variants and Safearrays (by LarsJ)] - Create/access/process Variants and SafeArrays.&lt;br /&gt;
&lt;br /&gt;
=== Inter Process Communications ===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202485 AppInteract (by MrCreatoR)] - Reliably pass arrays or other types between processes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=205109 AutoItSharedData (by SEuBo)] - Create a shared data storage, a simple AutoItObject-Object, using AutoItObject_Internal.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=188991 Autoit-Socket-IO (by tarretarretarre)] - Event driven TCP/IP wrapper inspired by Socket.IO with focus on user friendliness and long term sustainability.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126936 Container (by MrCreatoR)] - Scripts interaction method. Allows to transfer whole arrays as data, and even COM objects.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=55994 DDEML (by doudou)] - Use your AutoIt script as DDE client or server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=193277 FMIPC (by argumentum)] - IPC via FileMapping.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127615 Interprocess (by JScript)] - Remotely execute a function in another script (using Mailslot).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=193158 IPC_IO (by JohnWIlling)] - IPC library supporting multiple connection types (such as: Named Pipe, File, TCP, SharedMemory, MailSlot).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202618 IPC Techniques through ROT Objects (by LarsJ)] - Implementing IRunningObjectTable Interface.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106710 Mailslot (by trancexx)] - IPC using Mailslots.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=204734 Overlapped Named Pipe IPC (by Nine)] - Very fast interprocess communication that could be used between VBS or AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169797 Pool - Post Office for Organized Labour (by RTFC)] - Provides multiple AutoIt processes with an infrastructure for exchanging messages, data, and remote-control instructions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202587 WCD IPC (by Nine)] - Framework for Inter Process Communication using Windows Messages WM_COPYDATA.&lt;br /&gt;
&lt;br /&gt;
== Files, Databases and web connections ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=180850 ADO (by mLipok)] - A modifed version of the _SQL UDF to access all kind of databases (MSSQL, MySQL, PostgreSQL, SQLite, MS ACCESS, XLS, TXT, and many other which use ADO and ODBC).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105875 ADODB (by spudw2k)] - ADODB Example.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=176895 AXML (by Aipion)] - This is a Wrapper for Pugixml, made with C++.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145142 DBF (by funkey)] - dBase database read and write with DLL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/114406-csv-file-to-multidimensional-array/?do=findComment&amp;amp;comment=799820 CSV (by ProgAndy)] - Read/write CSV files to/from 2D arrays.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197909 CSV (by seangriffin)] - Manipulate CSV files using SQLite.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155748 CSVSplit (by czardas)] - Convert to and from CSV format.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119238 Excel file generation (by jerome)] - Excel file generation (multi-sheet workbook) without the need to have Excel installed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143866 Excel XML (by FireFox)] - Work with SpreadsheetML (Open XML file formats).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155905 EXml (by jdelaney)] - Create Excel file (SpreadsheetML) through &amp;quot;Microsoft.XMLDOM&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116072 EzMySql (by Yoriz)] - Use MySQL Databases with AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148232 _FileGetProperty (by BrewManNH)] - Retrieve properties of a file.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94920 FireBird (by eltorro)] - FireBird, Interbase DLL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197421 jq (by TheXman)] - Brings the power and flexibility of jq (an open-source command-line based JSON processor) to AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209502 JSON (by AspirinJunkie)] - Interacting with JSON data in AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=104150 JSON (by Gabriel13)] - RFC4627 compliant JSON encode/decode.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148114 JSON (by Ward)] - JSMN - A Non-Strict JSON UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=156794 JSON (by ozmike)] - Bridge to Native Windows JSON plus OO extension for AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173797 JSONgen: JSON generator (by Jefrey)] - Generate JSON.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127101 MS SQL (by TheLuBu)] - MSSQL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51952 MS SQL (by ChrisL)] - _SQL. ADODB Connection.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20814 MySQL (by cdkid)] - MySQL relational database management system.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=85617 MySQL (by ProgAndy)] - MySQL UDFs (without ODBC - working with libmysql.dll).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=122360 MySQL (by James)] - MySQL ODBC Connector.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=187223 romaSQL (rynow)] - Built on the concept of Laravel Query &amp;amp; doctrine. Connection string is based on ADODB / ODBC.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143331 Sharepoint 2007/2010 (by schoppet)] - Access the SOAP-Webservices of Sharepoint 2007/2010.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=17099 SQLite (by ptrex)] - SQLite is a library that implements a self-contained, embeddable, zero-configuration SQL database engine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=142977 SQLite Array Functions (by SmOke_N)] - SQLite Array Functions - a faster method for unique arrays and sorting methods.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140521 SQLite - Database (by PhoenixXL)] - UDF for SQLite so that beginners will also be able to do the stuff.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157853 SQLiteEx (by 57ar7up)] - SQLiteEx UDF v0.5.1 - Simplest work with SQLite.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163633 Xbase I/O (by RTFC)] - Transfer data between Xbase Data file (*.dbf) and AutoIt array written in pure AutoIt (no SQL, no ADO, no dlls, no external dependencies).&lt;br /&gt;
* [https://www.autoitscript.com/forum/imndex.php?showtopic=209526 xlsxNative (by AspirinJunkie)] - Read and write xlsx files without excel.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=19848 XML DOM Wrapper (by eltorro)] - Supports CRUD operations on XML. Including XSL and XPath.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=176895 XML (by mLipok)] - New version of XML DOM Wrapper, with many new features.&lt;br /&gt;
&lt;br /&gt;
== Data compression ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=85094 7z, zip, gzip, bzip2, tar (by rasim)] - Extensive library that uses a external DLL that must be provided with the script.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=92958 gZip (by Zinthose)] - Based on the parsing of gZip.exe output. It can work with memory, it doesn&#039;t work with files. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87441 LZMA (by trancexx)] - LZMA (Native Windows).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138838 Package (by Yashied)] - Package UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=129529 pZip (by asdf8)] - PureZIP_L library UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=76176 UnRAR (by rasim)] - UnRAR.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=17727 XZip (by eltorro)] - Another UDF for &amp;quot;XStandard XZIP Component&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161847 XZip (by mLipok)] - UDF for &amp;quot;XStandard XZIP Component&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=44524 Zip plugin (by eltorro)] - Zip plugin.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=73425 ZIP (by torels)] - ZIP UDF in pure AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116565 zip (by wraithdu)] - Create ZIP files and unpack ZIP files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135565 ZIP (by joakim)] - ZIP STRUCTS UDF (from scratch).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87284 ZLib (by monoceres)] - Based on ZLib.dll. It can compress/uncompress data in memory, it doesn&#039;t work with files.&lt;br /&gt;
&lt;br /&gt;
== Encryption and hash ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81332 _Base64Encode, _Base64Decode (by trancexx)] - Fast _Base64Encode, _Base64Decode.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=153246 Base91 and Base128 (by Beege)] - Base91 and Base128 functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155538 Codecrypter (by RTFC)] - Encrypt scripts without placing the key inside the script.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=201002 Cryptography API: Next Gen (by TheXman)] - Microsoft&#039;s long-term replacement for their CryptoAPI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=203990 GDPR (by mLipok)] - Functions to encrypt/decrypt strings and files with the GDPR in mind.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95558 Hashes for files (by trancexx)] - Fast RC32, MD4, MD5, SHA1 calculation for big files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=107784 TrueCrypt (by FuryCell)] - TrueCrypt UDFs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140737 WinTrust (by kasty)] - verify the integrity of a file with its embedded signature or a given catalog.&lt;br /&gt;
&lt;br /&gt;
== GUI Additions ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97241 3D Pie chart (by WideBoyDixon)] - 3D Pie chart.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173924 Chart_UDF (by Kanashius)] - This UDF can be used to Display bar charts in a window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=96258 ContextHelp (by Yashied)] - Management of context help ([https://www.autoitscript.com/forum/index.php?showtopic=72152-contexthelp/ original]).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=109096 ExtMsgBox (by Melba23)] - A very customisable replacement for MsgBox.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105582 GUICtrlOnChangeRegister (by Mat)] - Call a function when an edits content is changed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145149 GUIExtender (by Melba23)] - Expand and contract sections of your GUI ([https://www.autoitscript.com/forum/index.php?showtopic=117909 original]).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197654 GuiFlatButton (by kurtykurtyboy)] - Change colors of regular buttons.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119505 GUIFrame (by Melba23 &amp;amp; Kip)] - Divide a GUI into adjustable frames.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=144207 GUI Panel (by FireFox)] - Manage child GUIs as panel ctrls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113723 GUI Scrollbars (by Melba23)] - Automatically sized scrollbars with a single command.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161184 MetroGUI (by BBs19)] - Windows 10 style buttons, toggles, radios etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20967 Modern tray menu (by Holger)] - Allows the creation of modern, fancy GUI and tray menus with icons and colors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=194693 MTSkin (by Taskms4)] - Simply create modern looking GUIs (borderless GUI, Interactive menu panel (with mouse-over detection), a bunch of skins).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182136 Notifications (by S3cret91)] - Display permanent desktop notifications.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=136149 Notify (by Melba23)] - Small notifications on the edge of the display.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161750 Pie chart (by Andreik)] - Pie chart.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75429 Real Vista Aero Glass (by James)] - Real Vista Aero Glass UDF - you can apply glass effect to your GUI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=71811 SetOnEvent (by martin)] - Provides an easy way for an event to call functions with parameters.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=103871 _SysTray (by wraithdu)] - Get info about and manipulate Systray icons.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108445 Toast (by Melba23)] - Small message GUIs which pop out of the Systray.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=110003 Tray Icon Bar Graph (by BeeGee)] - Creates a scrolling bar graph as the tray icon.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=132864 Uskin (by JScript)] - Allows you to skin your GUI using the Windows &#039;&#039;.MSstyles&#039;&#039; files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191821 Wi3SMenu (by NHD)] - Create a slide menu with Windows 10 style. Supports color, icon and opacity.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=129196 WinSnap (by Beege)] - Automatic Window Alignment by applying that &amp;quot;snappy edge&amp;quot; effect to your GUI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32494 XSkin (by Valuater)] - Allows skinning of your GUI and to apply custom skins.&lt;br /&gt;
&lt;br /&gt;
=== Controls ===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202529 BrowseForFolder (by MrCreatoR)] - Handle SHBrowseForFolderW with more options, such as multi selection (checkboxes), window position, controls text and more. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=146406 Calendar (by jmon)] - Calendar UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=125293 ChooseFileFolder (byMelba23)] - Single and multiple selections from specified path treeview listing.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=96464 Colorpicker (by Yashied)] - Create a button for the user to select a color.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=123409 Explorer Frame UDF (by Beege)] - Takes any frame created by GUIFrame and turns it into a MS-Windows like Explorer window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173929 GDIPlus Slider UDF (by Kanashius)] - This UDF can be used to create a slider with an imagebackground and an image to move.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=79412 Graph control (by andybiochem)] - Easily create and show bar chart and line charts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=104399 GraphGDIPlus UDF (by andybiochem)] - Easily create and show bar chart and line charts with GDI+ to take advantage of double-buffering.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105682 GUICtrlCreateFinder (by Mat)] - Allows you to create a window finder control like the one seen in AutoIt Window Info.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=107965 GUIHotkey (by Mat)] - UDF for using native hotkey controls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182492 GUIListViewEx (by Melba23)] - Insert, delete, move, drag, sort, edit and colour ListView items.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111438 GUIPager (by Mat)] - Create and control native pager controls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20967 GUI/Tray Menu (by Holger, LarsJ, AZJIO)] - GUI/Tray Menu with icons and colors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166594 GUITreeViewEx (by Melba23)] - Check/clear parent and child checkboxes in a TreeView.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=90598 Hotkey input control (by Yashied)] - Hotkeys Input Control UDF Library (Non-native).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173932 ListView Edit UDF (by Kanashius)] - This UDF can be used to simply edit an Listview.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=109355 ListView - Explorer like ListView UDF (by Beege)] - This UDF simplify creating MS Explorer-like ListViews.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143711 Marquee (by Melba23)] - Make tickertape info bars.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143380 Predict Text UDF (by PhoenixXL)] - Sub classes the edit control and matches the current word through the Database &amp;amp; sets selection in accordance.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163939 Progressbar new style (by Muzaiyan)] - New styles for your progress bar.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=74649 Progressbar with GDIplus (by ProgAndy)] - You even can use full textured images.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151636 RestrictEdit_SRE UDF (by PhoenixXL)] - Restrict the text that can be entered in an editbox through a String Regular Expression.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=128242 Ribbon (by trancexx)] - UDF for Windows Ribbon framework.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114034 StringSize (by Melba23)] - Automatically size controls to fit the text you want to put in them.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126958 Syslink (by Yashied)] - Provides a convenient way to embed hypertext links in a window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105814 Table (by andybiochem)] - Table UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=125251 TVExplorer (by Yashied)] - Allows to create TreeView (TV) Explorer controls that display a tree of files and folders.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=190659 Virtual Listview (by LarsJ)] - Virtual Listview for large amounts of data with a large number of rows.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195053 Windows Message Monitor (by LarsJ)] - Monitor Windows Messages of a window or control.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=118317 Battery UDF (by Yashied)] - Retrieves a various information and current status of the battery(s).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154727 BuildPartitionTable (by RTFC)] - Scans a physical drive&#039;s partition table and returns a partition_table, allocation_table and volumes_table.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155674 CommAPI (by therealhanuta)] - Serial and parallel communication (COM port, RS-232, LPT port) - without installing DLL&#039;s (using Windows API calls).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=77731 Device Management (by weaponx)] - Device Management API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97487 DirectShow (by monoceres)] - DirectShow UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164700 DirectSound (by eukalyptus)] - DirectSound UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164701 Direct2D (by eukalyptus)] - Direct2D UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=99713 Drive Info (by NerdFencer)] - Gathers drive info for Hard Drives, Disk Drives, and Floppy Drives.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138989 FritzBox (by Allow2010)] - _FB_Tools - manage your FritzBox from Autoit.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121084 I/O Port Functions (by Ascend4nt)] - Input/Output UDF for interacting with ports (x64 Parallel Port, Keyboard etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=203207 MediaDevice (by Danyfirex)] - Transfer files to portable devices like phones, storages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154350 Monitor Configuration (by jaberwacky)] - Monitor Configuration UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155469 Mouse (by AlmarM)] - AutoIt powered mouse events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=147325 MouseTrapEvent (by ozmike)] - MouseTrapEvent UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149083 NetInfo (by Nessie)] - UDF for test internet download speed and upload speed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155539 Network configuration (by jguinch)] - Network configuration UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182684 Nitgen (by Jefrey)] - UDF to work with Nitgen fingerprint readers that use NGenBio SDK.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155485 Printers management with WMI (by jguinch)] - Allows to manage printers: add/delete printer, driver, port, or obtain configuration, set default printer ...&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=189190 Serial port UDF / COM port UDF (by MazeM)] - Another UDF for the serial port. It is very similar to CommAPI using kernel32.dll, but all code is packed into a single file without any dependencies.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=128546 Serial Port/COM (by martin)] - Serial Port /COM Port UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27755 SMARTDRIVE (by ptrex)] - SMART drive Analysis.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158640 SPI Hardware Interface (by Blinky)] - Communicate with the MAX335 chip using the SPI protocol via the LPT (printer) port.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=8188 VISA/GPIB (by Angel)] - VISA/GPIB library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=68866 Webcam (by LIMITER)] - Webcam UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70857 Webcam (by ludocus)] - Webcam UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91018 WiFi (by MattyD)] - Low level control over your wireless LAN.&lt;br /&gt;
&lt;br /&gt;
== Information gathering ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=29404 Computer information (by JSThePatriot)] - A general purpose library to get various details about a Windows machine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151920 NetworkStatistics (by Ascend4nt)] - Network Interface Info, Statistics, and Traffic.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=54039 WinPcap (by JRSmile)] - Wrapper for the windows packet capture library WinPcap.&lt;br /&gt;
* [https://opensource.grisambre.net/pcapau3/ WinPcap (by Nicolas Ricquemaque)] - A library to access the main functionalities offered by the WinPcap driver.&lt;br /&gt;
&lt;br /&gt;
== Internet protocol suite ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=207859 cURLX64 (by Beege)] - cURL UDF with x64 support.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=137456 cURL (by seangriffin)] - A UDF for transferring data with URL syntax.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=187718 HTTP lib (by Jefrey)] - HTTP lib (GET, POST and upload) UDF to simplify HTTP requests, mainly when dealing about POST data or file uploads.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202895 HttpApi (by TheXman)] - HTTP Server API enables applications to communicate over HTTP without using MS Internet Information Server (IIS).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=40243 IMAP (by mikeytown2)] - IMAP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108422 IMAP4 (by Tipulatoid)] - IMAP4 UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=43515 IRC (by McGod)] - A lightweight library for communicating with IRC servers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=159285 IRC (by rcmaehl)] - IRC UDF - Updated Version of Chips&#039; IRC UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=22838 POP3 (by Apzo)] - POP3 library for retrieving email messages. Not compatible with Gmail because it uses SSL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167339 POP3 (by mLipok)] - POP3 UDF According to the 1939 RFC, modified version with Quoted Printable decoder.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154530 Prowl (by mrflibblehat)] - Push notifications to iPhone, iPod touch or iPad using Prowl (Growl client for iOS).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138095 SFTP (by Lupo73)] - UDF to support SFTP protocol using PSFTP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154054 Socket UDF (by funkey)] - Socket UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=23860 SMTP (by Jos)] - Smtp Mailer That Supports Html And Attachments.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167292 SMTP Mailer UDF (by mLipok)] - Smtp Mailer That Supports Html And Attachments - Modified Version with support to save EML files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81687 SNMP (by enaiman)] - SNMP_UDF for SNMPv1 and SNMPv2c.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70759 SNMP - MIB protocol (by ptrex)] - Reading toner status from SNMP device with WMI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166579 SSH (by jeanphile)] - Use the SSH protocol very easily in your code.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=185329 STUN (by j0kky)] - STUN is a protocol that permits you to know your external IP but, more interesting, your external port associated to your internal port.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=184817 SyslogSend (by Irios)] - This allows sending (BSD) messages to a syslog server using UDP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169774 TCPServer (by Jefrey)] - Multi client, event-based, able to bind console app to socket.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=57022 UPnP Protocol (by ptrex)] - UPnP - Read and Control your devices in side out.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=84133 WinHTTP (by trancexx)] - Access the HTTP protocol for creating GET and POST requests and submitting them with conforming standards, cookies not supported.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=77503 WinInet (by -Ultima-)] - Access standard Internet protocols (FTP, Gopher and HTTP). Supports GET/POST requests and cookies.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=181645 Winsock (by j0kky)] - Create client/server application using native winsock functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191954 WSA_NBTCP (by ripdad)] - Windows Sockets API - Non-Blocking Transmission Control Protocol.&lt;br /&gt;
&lt;br /&gt;
== Maths ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170658 Advanced Math UDF (by scintilla4evr)] - Advanced mathematical functions (primes, number sequences, interpolate, calculate values of functions like Riemann zeta etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=102686 Advanced rounding (by Mat)] - Support for different measures of accuracy and 8 ways to resolve tie breaks.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83529 Big number (by eukalyptus)] - Make calculations with extremely large numbers that AutoIt normally is not able to support.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106551 Decimal To fraction (by Malkey)] - Converts any decimal number to a fraction. Example: 1.2 to 6/5.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/319-eigen4autoit/ Eigen4AutoIt (by RFTC)] - Allows to perform fast matrix operations on large numerical data sets, and much more ....&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140789 MathsEx UDF (by PhoenixXL)] - Functions for Carrying Out More Advanced Mathematical Calculations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81189 Number base conversion (by james3mg)] - From, to and between positive bases less than 63 (decimals supported).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=117156 NumToWord (by Mat)] - Convert numerals to a human readable string.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108803 Polynomials (by Mat)] - Functions for using polynomials.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83091 Primes (by jennico)] - Many functions dealing with prime number generation and calculations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94770 Roman Numerals (by AZJIO)] - Roman Numerals.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=98160 Root function (by Mat)] - Working out real roots of numbers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209527 Stat (by AspirinJunkie)] - Statistics for Autoit.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163899 StringAPL (by minx)] - inline APL interpreter.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=82722 Trigonometric and math functions (by trancexx)] - _ATan2(), _Cosh(), _Frexp(), _Hypot(), _Ldexp(), _Logb(), _Sinh(), _Tanh().&lt;br /&gt;
&lt;br /&gt;
== Media ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95357 FreeImage library (by ProgAndy)] - Various operations on images, such as rotate, resize, flip.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127263 HtmlHelp (by Geodetic)] - HtmlHelp functions for context-sensitive help from CHM (compiled HTML) files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116009 HyperCam (by seangriffin)] - HyperCam (Screen Recording) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182535 HyCam2 (by willichan)] - Automation for HyCam2 screen recording utility.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50608 OCR (by ptrex)] - Real OCR in AU3 - MODI with MS Office 2003.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=89542 OCR (by seangriffin)] - Tesseract (Screen OCR) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=206133 OCRSpace (by MrKm)] - Convert Images to text with the OCRSpace API. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51054 Printer controller (by martin)] - Print text in any font, size and colour at any position on the page, draw lines, curves, elipses, pies in any colour, and print images.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=73993 Printing (by GRS)] - Printing from AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202621 QRCreator (by BugFix)] - Simple QR-code creation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161831 RTF_Printer (by mLipok)] - Printing RichEdit in the background.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94834 Simple DirectMedia Layer (by AdmiralClaws)] - Adds support for joysticks, CDs, 2D graphics, timers. See [https://www.libsdl.org/ SDL website] for more information.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=207324 UWPOCR (by Danyfirex)] - Universal Windows Platform Optical Character Recognition API.&lt;br /&gt;
&lt;br /&gt;
===Graphics and image===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202987 AutoYolo3 (by smartee)] - Real-Time Object Detection using YOLOv3 wrapper.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113881 au3Irrlicht2 (by JRowe)] - Combining Irrlicht and AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=86748 AVI writing udf (by monoceres)] - Create uncompressed avi&#039;s from bitmap files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27362 Bitmap Library (by evilertoaster)] - Bitmap Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202663 GIF animation (by Nine)] - Fast cached GIF animation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150231 GTK+  (by prazetto)] - GTK+ Framework | Widgets.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=13096 ImageGetInfo (by Lazycat)] - Read info from JPEG, TIFF, BMP, PNG and GIF - size, color depth, resolution.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/471-image-search-udf Image Search (by VIP)] - Search for an image on the desktop. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70506 IrrLicht (by A. Percy)] - A 3D graphics engine suitable for creating games.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160732 OpenCV (by myliseJ)] - UDF for the OpenCV library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=206432 OpenCV v4+ (by smbape)] - OpenCV UDF with support for OpenCV v4+.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151011 OpenGL (by LarsJ)] - OpenGL without external libraries etc. For JPEG files it also retrieves various Exif information.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148129 OpenGL (2.0) (by minx)] - New set of UDFs for OpenGL + AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=152950 S3D (by Starg)] - Draw simple 3D graphics with GDI+.&lt;br /&gt;
&lt;br /&gt;
===Players===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114143 VLC (by seangriffin)] - VLC (Media Player) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91316 VLC Media Player (by ptrex)] - VLC Media Player.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27352 WMP (by ConsultingJoe)] - Windows Media Player UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=44008 WMP - Media Controls (by CFire)] - Another Windows Media Player UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=203154 WMP - GUI Control (by SudeepJD)] - IE based WMP Control.&lt;br /&gt;
&lt;br /&gt;
===Sound===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83481 BASS Function Library (by BrettF)] - Sound and Music via wrappers for Bass, BassEnc, Bass FX, BassSFX, BassAsio and BassCd DLLs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173808 libZPlay (by Danyfirex)] - Multimedia library for playing mp3, mp2, mp1, ogg, flac, ac3, aac, oga, wav and pcm files and streams.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=37072 MIDI (by eynstyne)] - MIDI UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=208116 MIDI (by MattyD)] - Wrap of the Windows MIDI functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114742 SAPIListBox (by seangriffin)] - SAPIListBox (Speech Recognition) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=100439 TTS (by Beege)] - Text-to-Speech UDF.&lt;br /&gt;
&lt;br /&gt;
== PDF ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162195 Acrobat Reader - ActiveX Viewer (by mLipok)] - Make your own PDF Viewer GUI with Acrobat Reader ActiveX COM Object &amp;quot;AcroPDF.PDF.1&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164469 Debenu PDF Viewer SDK (by mLipok)] - A collection of functions to display PDF files in your applications using Debenu PDF Viewer SDK.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160875 Debenu Quick PDF Library (by mLipok)] - A collection of functions for Debenu Quick PDF Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75832 FoxIt Reader (by ptrex)] - PDF Reader in AU3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=118827 MPDF (by taietel)] - Create PDF from your application.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=42776 PDFCreator (by ptrex)] - Automation of PDFCreator allows you to create and manipulate PDF files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170550 PDFCreator (by mLipok)] - UDF for PDFCreator v1.x.x with working EVENTs Handler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32261 _StringToPDF (by Tam0r)] - Write a string to a PDF file and specify font size, type etc.&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145158 Firewall (by JLogan3o13)] - Control and manipulate the Windows Firewall (enable/disable, Exclusions list, enable/disable ports etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=194015 Firewall policy2 (by Bilgus)]- Provides access to the firewall policy for Windows Vista+.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150819 VirusTotal (by Danyfirex)] - VirusTotal API 2.0 UDF.&lt;br /&gt;
&lt;br /&gt;
== Social Media and other Website API ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=159254 Cex.io (by AquilesCrespo)] - UDF script for using with the web api from https://cex.io/ server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169333 CrowdinAPI (by mLipok)] - Uses the [https://crowdin.com/page/api crowdin.net website API] for some functions (create projects, add and update files, download translations or integrate localization).&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/290-dropbox-authenticator/ Dropbox authenticator (by Gimerly)] - Dropbox authenticator.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158106 Easypost (by dcat127)] - Print USPS Postage Labels.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114801 eBay (by seangriffin)] - eBay UDF (functions GetItemStatus and GetSingleItem from the &amp;quot;Shopping API&amp;quot;).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=141340 Gmail (by PhoenixXL)] - Remote Gmail (UDF).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=192422 Gmail API (by Ascer)] - Automate communication with Gmail using oAuth 2.0 security. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=98504 Google Functions (by Beege)] - Google Functions (Suggestions, Definitions, Translate, Convert).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=115437 Google Maps (by seangriffin)] - Google Maps UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70675 iTunes (by torels)] - iTunes UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=101802 iTunes (by Beege)] - Another iTunes UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150985 No-IP (by Nessie)] - Simply update your no-ip hostname(s) and retrieve the ip address of an no-ip address.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=192391 oAuth (by Ascer)] - Open standard for access delegation, commonly used to grant websites or applications access to other websites.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150838 PasteBin (by mrflibblehat)] - Pastebin UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121767 Skype (by FireFox)] - Skype4COM provides an ActiveX interface to the Skype API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113234 Teamspeak 3 (by chipDE)] - Teamspeak 3 UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186944 TeamViewer API (by mLipok)] - A collection of function for use with TeamViewer API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186381 Telegram Bot (by LinkOut)] - UDF for [https://core.telegram.org/api Telegram messenger API].&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166547 TVmaze.com API (by BBs19)] - TVmaze.com API UDF (TV-Series).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116600 Twitter (by seangriffin)] - Manage Twitter.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149247 Yahoo Weather (by Nessie)] - Yahoo Weather API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=112775 Youtube Uploader (by BrettF)] - AYTU - AutoIt Youtube Uploader.&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50880 ACL (by ptrex)] - Set ACL on windows Objects.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=134508 ACL (by FredAl)] - Do most everything with the DACL and ownership on all types of objects: Files or folders, Registry keys, services, Kernel and WMI objects, etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=206400 BITS (by DonChunior)] - Background Intelligent Transfer Service to download files from or upload files to HTTP web servers and SMB file shares.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=184937 CertUtil (by mLipok)] - Wrapper for windows certutil.exe (command-line program that is installed in Windows as part of Certificate Services).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113560 FileSystemMonitor (by seangriffin)] - Monitors the file system by recording all file system events occurring within a given path.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111018 ITaskBarList (by Beege)] - ITaskBarList UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=74118 Local account (by engine)] - Manage local accounts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161193 Magnifier Functions (by Ascend4nt)] - Exposes most of the useful Magnifier API functions available since Windows Vista.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75250 Registry (by engine)] - Windows Registry UDFs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50551 Registry (by seanhart)] - RegWriteAllUsers / RegDeleteAllUsers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=80201 Service (by arcker)] - Build your own service with AutoIt code.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124508 Startup (by guinness)] - Create Startup entries in the Startup Folder or Registry.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164756 SCCM (by JLogan3o13)] - Systems Center Configuration Manager Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=134628 System restore (by FredAI)] - System restore UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186111 SubstWrapper (by mLipok)] - Wrapper for windows subst.exe command - (Associates a path with a drive letter).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135994 Taskplanner/Taskscheduler COM (by Allow2010)] - an UDF for using the Windows Taskplaner / Task Scheduler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83355 Task Scheduler (by dbzfanatic)] - Task Scheduler UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=200068 TaskScheduler (by water)] - Brushed up Task Scheduler UDF. Link to the [[TaskScheduler|documentation pages]].&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173934 TTS (by Kanashius)] - Used with SAPI Automation Object - text-to-speech (TTS) engine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158377 UAC (by AdamUL)] - User Account Control (UAC) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=175719 Utter (by Surya)] - Utilizing more of SAPI (Speech Recognition UDF).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127075 WIMGAPI (by Homes32)] - Manipulate Windows Image Files (.wim) without ImageX.exe.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=28436 Windows Events (by Emperor)] - Create your own Windows events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=6487 Windows Service Control functions (by SumTingWong)] - Some limited functions to control services (create, start, stop, delete, check ...).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81880 Windows Services (by engine)] - Windows Services UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163178 WRMF (by Luigi)] - WRMF - Windows Registry Monitor Call Function.&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&amp;lt;!-- Removed 2020-05-30 as adequate documentation is missing * [https://www.autoitscript.com/forum/topic/178871-dllcall-with-c-example/#comment-1285754 SMSApi (by mLipok)] - UDF for SMSAPi which provides SMS services. --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Removed 2020-05-30 as adequate documentation is missing * [https://www.autoitscript.com/forum/index.php?showtopic=178589 BulkSMS (by Skysnake)] - UDF for BulkSMS which provides SMS services. --&amp;gt;&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145099 _AdlibEnhance (by JScript)] - Enhance Adlib to call functions with parameters, pause and resume.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160936 Android (by Moriba)] - Control any Android device.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97826 Animated tray icons (by Yashied)] - Make animated tray icons easily.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163577 Atom Table (by Ascend4nt)] - Store (add, find, delete, and query) strings locally (at program level) or globally (at OS level) with unique numerical identifiers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170087 Barcode generators (by willichan)] - Creates a Code128A/B/C or Creates a Code39 or Code39Extended optimized barcode from supplied data.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87735 BlockInputEx (by MrCreatoR)] - Supports a few features that built-in BlockInput() function does not.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=199762 BlockInputEx (by Nine)] - Block all input coming from mouse and/or keyboard, without having an UAC warning displayed. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=29763 Clipboard (by eltorro)] - When apps need to watch the clipboard.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170630 ClipboardEx (by ozmike)] - Allows to have more than 1 item in the Clipboard. Handles all data types, not just text.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81267 Clipboard History (by wraithdu)] - Save and restore the entire clipboard contents. Inspired by AHK&#039;s ClipboardAll.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169610 CmdLine (by Jefrey)] - Collection of functions to parse command line arguments.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126569 Console (by Shaggi)] - Functions and features to work wiht Console input/output.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121833 Copy (by Yashied)] - Copy or move files and directories without suspending your script. Retrieve the current state (copied bytes, error code etc.) while copying.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154684 Date / Time convert (by Melba23)] - Transform date/time formats.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=99106 _DLLStructDisplay (by Ascend4nt)] - Show Struct in ListView.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157689 _FileGetMimeType (by Wiliat87)] - Retrieve MIME types based on the extension of the filename/filepath/URL provided.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=117033 File locking with cooperative semaphores (by willichan)] - Simple file locking without a server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157241 FindMimeFromData (by twbradio)] - FindMimeFromData using urlmon.dll.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=181997 Font Icon (by J2TeaM)] - Use Font Awesome in your AutoIt project.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=68422 HotString (by jvanegmond)] - Similar to the HotKey function but trigger on a string, instead of a key or key combination.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173946 LASM - Light Assembler (by minxomat)] - Inline UDF for an Assembler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161628 LFN (by orbs)] - Overcome MAX_PATH limit of 256 chars.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111492 Link Grammar for AutoIt (by JRowe)] -  Input is a regular sentence in English, German or Italian, output is a pattern parsed from the structure of the sentence.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/147-mruau3 MRU (by Yashied)] - Most Recently Used (MRU) List Automation functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186853 _Multiprocess (by jguinch)] - Run several external programs at the same time and retrieve the exit code of each process.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=188158 .NET Common Language Runtime (CLR) Framework (by Danyfirex, Junkew, Larsj, ptrex, Trancexx)] - Allows AutoIt to access .NET Class Libraries.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=101733 NoFocusLines (by Melba23)] - Remove the dotted focus lines from buttons, sliders, radios and checkboxes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149176 NotifyIcon (by FireFox)] - Create, delete and manage self notify icons (formerly TrayIconEx). &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=63318 PixelGetColor (by Manadar)] - Get or Read Pixel from memory.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167024 RDC (by Yashied)] - ReadDirectoryChanges Wrapper.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51103 Resources (by Zedna)] - Embed any binary data into your AutoIt compiled EXE files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162499 ResourcesEx (by guinness)] - Up to date version of Zedna&#039;s Resources UDF. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111215 Restart (by Yashied)] - Allows to restart a script from any location with full restoration of the original command line parameters.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51547 SciLexer (by Kip)] - Editing control, supports multiple editors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=152093 ScriptEditor (by pandel)] - ScriptEditor with I18N support and customizable lexer completely written in AutoIt (based on SciLexer).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162033 Spell Checker (by iCode)] - Spell Checker functions to call Hunspell, Hyphenate and MyThes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164444 Synology filestation (by nend)] - Functions to interact with a Synology NAS server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163328 TimeConvert (by orbs)] - Convert UTC to/from local time, and/or reformat the string representation.&lt;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=User_Defined_Functions&amp;diff=14853</id>
		<title>User Defined Functions</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=User_Defined_Functions&amp;diff=14853"/>
		<updated>2023-07-29T08:31:29Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Introduction */  added ===Added in the past two years=== to easily maintain page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a listing of libraries of &#039;&#039;&#039;user defined functions&#039;&#039;&#039; (UDF). These libraries have been written to allow easy integration into your own scripts and are a very valuable resource for any programmer.&amp;lt;br /&amp;gt;&lt;br /&gt;
This list is probably not complete (378 UDFs on 2023-07-27), but constantly supplemented.&lt;br /&gt;
If you do not find a solution here, ask a new question on the [https://www.autoitscript.com/forum/forum/2-general-help-and-support/ forum].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
The listed UDFs might have been written for older versions of AutoIt. So there is no guarantee that every UDF works smoothly with newer versions.&amp;lt;br /&amp;gt;&lt;br /&gt;
None of the UDFs has been tested by the maintainers of this list so you as a user need to make sure that they deliver the expected results.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;When will an UDF be added to this list?&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
It should meet all/most of the general requirements for UDFs as described [[UDF-spec|here]].&amp;lt;br&amp;gt;&lt;br /&gt;
In addition the following requirements should be met:&lt;br /&gt;
* &#039;&#039;&#039;Documentation&#039;&#039;&#039;: So users can tell what the UDF is intended to do (&#039;&#039;mandatory&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;Examples&#039;&#039;&#039;: So users can get an idea how to use the UDF. The more the better (&#039;&#039;mandatory&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;Operating&#039;&#039;&#039; systems: Should support the latest Microsoft OS (&#039;&#039;mandatory&#039;&#039;) plus as many predecessors as possible (&#039;&#039;optional&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;AutoIt&#039;&#039;&#039;: Should support the latest version of AutoIt (&#039;&#039;mandatory&#039;&#039;) plus as many predecessors as possible (&#039;&#039;optional&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;Author&#039;&#039;&#039;: The author should still be active on the forum so he can reply to questions (&#039;&#039;optional&#039;&#039;)&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;What to do when one of your UDFs is missing?&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Please send a [https://www.autoitscript.com/forum/messenger/compose/?to=7903 PM] to user water. Add a short description of the UDF and a link to your post in the [https://www.autoitscript.com/forum/forum/9-autoit-example-scripts/ Example Scripts forum].&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
===Added in the past two years===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Date !! Section !! Creator !! Description&lt;br /&gt;
|-&lt;br /&gt;
|2023-07-27 || [[User_Defined_Functions#Files.2C_Databases_and_web_connections|Files, Databases and web connections]] || AspirinJunkie || [https://www.autoitscript.com/forum/imndex.php?showtopic=209526 xlsxNative (by AspirinJunkie)] - Read and write xlsx files without excel.&lt;br /&gt;
|-&lt;br /&gt;
|2023-07-27 || [[User_Defined_Functions#OpenOffice.2FLibreOffice|OpenOffice/LibreOffice]] || donnyh13 || [https://www.autoitscript.com/forum/index.php?showtopic=210514 LibreOffice Writer] - A huge list of functions for LibreOffice Writer.&lt;br /&gt;
|-&lt;br /&gt;
|2023-02-03 || [[User_Defined_Functions#Graphics_and_image|Graphics and image]] || Starg || [https://www.autoitscript.com/forum/index.php?showtopic=152950 S3D] - Draw simple 3D graphics with GDI+.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Files.2C_Databases_and_web_connections|Files, Databases and web connections]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209502 JSON] - Interacting with JSON data in AutoIt.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging|Script Coding/Analyzing/Debugging]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209529 Set] - Provides a set data type and brings the corresponding mathematical functions.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Maths|Maths]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209527 Stat] - Statistics for Autoit.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging|Script Coding/Analyzing/Debugging]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209523 ArrayPlus] - Functions for flexible Array handling (creating, extracting, rebuilding, sorting, filtering, finding, printing).&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging|Script Coding/Analyzing/Debugging]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209528 ArrayCombinations] - Different ways of composing elements of a set.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-04 || [[User_Defined_Functions#Sound|Sound]] || MattyD || [https://www.autoitscript.com/forum/index.php?showtopic=208116 MIDI UDF] - Wrap of the Windows MIDI functions.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-06-19 || [[User_Defined_Functions#Internet protocol suite|Internet protocol suite]] || Beege || [https://www.autoitscript.com/forum/index.php?showtopic=207859 cURLX64] - cURL UDF with x64 support.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-05-24 || [[User_Defined_Functions#Controls|Controls]] || kurtykurtyboy || [https://www.autoitscript.com/forum/index.php?showtopic=197654 GuiFlatButton] - Change colors of regular buttons.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-04-25 || [[User_Defined_Functions#Social_Media_and_other_Website_API|Social Media and other Website API]] || Ascer || [https://www.autoitscript.com/forum/index.php?showtopic=192391 oAuth] - Open standard for access delegation, commonly used to grant websites or applications access to other websites.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-02-22 || [[User_Defined_Functions#Files.2C_Databases_and_web_connections|Files, Databases and web connections]] || czardas || [https://www.autoitscript.com/forum/index.php?showtopic=155748 CSVSplit] - Convert to and from CSV format.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-02-11 || [[User_Defined_Functions#Inter_Process_Communications|Inter Process Communications]] || Nine || [https://www.autoitscript.com/forum/index.php?showtopic=204734 Overlapped Named Pipe IPC] - Very fast interprocess communication that could be used between VBS or AutoIt.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-01-11 || [[User_Defined_Functions#Media|Media]] || MrKm || [https://www.autoitscript.com/forum/index.php?showtopic=206133 OCRSpace] - Convert Images to text with the OCRSpace API. &lt;br /&gt;
|-&lt;br /&gt;
| 2022-01-11 || [[User_Defined_Functions#Media|Media]] || Danyfirex || [https://www.autoitscript.com/forum/index.php?showtopic=207324 UWPOCR] - Universal Windows Platform Optical Character Recognition API.&lt;br /&gt;
|-&lt;br /&gt;
| 2021-08-18 || [[User_Defined_Functions#Graphics_and_image|Graphics and image]] || smbape || [https://www.autoitscript.com/forum/index.php?showtopic=206432 OpenCV v4+] -  OpenCV UDF with support for OpenCV v4+.&lt;br /&gt;
|-&lt;br /&gt;
| 2021-08-04 || [[User_Defined_Functions#Windows|Windows]] || DonChunior || [https://www.autoitscript.com/forum/index.php?showtopic=206400 BITS] - Background Intelligent Transfer Service to download/upload files from/to HTTP web servers and SMB file shares.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Automation ==&lt;br /&gt;
&lt;br /&gt;
===Browsers===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154439 Chrome (by seangriffin)] - Automate the most common tasks in Chrome with this UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95595 Firefox (by Stilgar)] - A little less support for automation than IE, but still very good.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167661 Firefox (by Danp2)] - Modified newer version of Stilgar Firefox UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/224-firefox-profile-backup/ FireFox Profile Backup 1.0 (by careca)] - Backup or restore your firefox profile. The application searches for the profile in home drive that will be the one to backup.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124330 _FF_AutoLogin (by Stilgar)] - This is a auto-login function and login-function-generator for FireFox and the FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=92035 _FF_DM (by Stilgar)] - UDF to control the FireFox Download-Manager (not the download-window).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91650 _FF_FoxBox (by Stilgar)] - UDF to control Fox!Box (A Mozilla Firefox extension for the AVM FRITZ!Box) with FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91665 _FF_Screengrab (by Stilgar)] - UDF to control Screengrab! (FireFox-AddOn) with FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124330 _HTML (by Stilgar)] - Get informations from any HTML (XML) source, without any browser.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166542 HTMLDocumentEvents (by SmOke_N)] - Track IE document events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167035 IEEx (by SmOke_N)] - IE extended library with some Javascript options.&lt;br /&gt;
* Internet Explorer (by DaleHohm et al.) - IE library that is now supplied with a standard AutoIt install.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=153520 IUIAutomation MS framework (by junkew)] - IUIAutomation MS framework to automate chrome, FF, IE etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149203 NavInfo (by Nessie)] - With this UDF you can check if a specified browser/software is installed and which version is being used.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=61090 Opera (by MrCreatoR,)] - Automate the most common tasks in Opera with this UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191990 WebDriver (by Danp2)] - W3C compliant Webriver UDF.&lt;br /&gt;
&lt;br /&gt;
===Microsoft Office===&lt;br /&gt;
Some features of Microsoft&#039;s Office products are proprietary and cannot readily be manipulated.  Sometimes workarounds are required.&amp;lt;br&amp;gt;&amp;lt;u&amp;gt;[[Known issues with Microsoft Office automation.|This page]]&amp;lt;/u&amp;gt; is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32144 Microsoft Office Access (by randallc)] - Automate Microsoft Access.&lt;br /&gt;
* Microsoft Office Excel (by water et al.) - This UDF is included in AutoIt. Link to the [[Excel_UDF|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135312 Microsoft Office Excel Charts (by water, GreenCan)] - Creating charts using Microsoft Excel.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=204034 Microsoft Office Excel Pivot Tables (by SudeepJD)] - Create and Update Excel Pivot Tables and Charts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126305 Microsoft Office Outlook (Items) (by water)] - Automate Microsoft Outlook Items. Link to the [[OutlookEX_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202451 Microsoft Office Outlook (GUI) (by water)] - Automate Microsoft Outlook GUI. Link to the [[OutlookEX_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197346 Microsoft Office Outlook Tools (by water)] - Built on top of the OutlookEX UDF it offers some often needed extended functionality (import/export ics/vcf files etc.). Link to the [[OutlookTools|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50254 Microsoft Office PowerPoint (by Toady)] - Automate Microsoft PowerPoint.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=178783 Microsoft Office PowerPoint (by water)] - Automate Microsoft PowerPoint. Link to the [[Powerpoint|documentation]] pages.&lt;br /&gt;
* Microsoft Office Word (by water et al.) - This UDF is included in AutoIt. Link to the [[Word_UDF|documentation]] pages.&lt;br /&gt;
&lt;br /&gt;
===OpenOffice/LibreOffice===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=210514 LibreOffice Writer (by donnyh13)] - A huge list of functions for LibreOffice Writer.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151530 OOo/LibO Calc (by GMK)] - OpenOfficeCalc UDF (works also for Libre Office).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=185932 OpenOffice/LibreOffice Spell Checker (by GMK)] - Function to validate words, and show spell alternatives.&lt;br /&gt;
&lt;br /&gt;
===Other Applications===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106163 Active Directory (by water)] - Extensive library to control and manipulate the Windows active directory ([https://www.autoitscript.com/forum/files/file/355-ad-active-directory-udf/ Download]). Link to the [[Active_Directory_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87956 Java (by seangriffin)] - Creates an access bridge between your application and a Java application. Allowing you to automate some Java applications.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=86574 SAP (by seangriffin)] - SAP business management automation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149540 SAPWizard (by ozmike)] - SAPWizard UDF.&lt;br /&gt;
&lt;br /&gt;
== Script Coding/Analyzing/Debugging ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209528 ArrayCombinations (by AspirinJunkie)] - Different ways of composing elements of a set.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155442 ArrayMultiColSort (by Melba23)] - Function to sort a 2D array on several columns.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209523 ArrayPlus (by AspirinJunkie)] - Functions for flexible Array handling (creating, extracting, rebuilding, sorting, filtering, finding, printing)&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=180467 ArrayWorkshop (by czardas)] - Multidimensional array functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=59174 Associative array functions (by Nutster)] - Manage a version of associative arrays in single AutoIt variables. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=198929 AutoIt error logger (AUERLO) (by user4157124)] - File- and stdout (etc.) output of messages, regular- and COM Object errors, exit method and -code, etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=110379 AutoItObject (by ProgAndy and others)] - Brings the Object Orientation programming paradigm to AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=112879 AutoIt Syntax Highlight (by MrCreatoR)] - Highlights AutoIt v3 syntax code to html/bbcode format.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191488 cDebug (by c.haslam)] - Dumps the values of all AutoIt subtypes and expressions including nested arrays, DLL structs and maps.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195882 ErrorLog (by mLipok)] - Logs program activities and errors to different output locations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143167 GetOpt (by dany)] - Parse GNU and DOS style command line options similar to getopt().&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=156196 Log4a (by zorphnog)] - Logging library loosely based upon the log4j and NLog libaries.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195862 Loga (by Danyfirex)] - Simple logging library to keep track of code with an integrated console.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119032 Log UDF (by Yashied)] - Create a text log files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202832 OnDebugMsgBox (by argumentum)] - Catch the dreaded &amp;quot;AutoIt Error&amp;quot; MsgBox and prettify or hide it.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209529 Set (by AspirinJunkie)] - Provides a set data type and brings the corresponding mathematical functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=200660 Variants and Safearrays (by LarsJ)] - Create/access/process Variants and SafeArrays.&lt;br /&gt;
&lt;br /&gt;
=== Inter Process Communications ===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202485 AppInteract (by MrCreatoR)] - Reliably pass arrays or other types between processes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=205109 AutoItSharedData (by SEuBo)] - Create a shared data storage, a simple AutoItObject-Object, using AutoItObject_Internal.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=188991 Autoit-Socket-IO (by tarretarretarre)] - Event driven TCP/IP wrapper inspired by Socket.IO with focus on user friendliness and long term sustainability.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126936 Container (by MrCreatoR)] - Scripts interaction method. Allows to transfer whole arrays as data, and even COM objects.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=55994 DDEML (by doudou)] - Use your AutoIt script as DDE client or server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=193277 FMIPC (by argumentum)] - IPC via FileMapping.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127615 Interprocess (by JScript)] - Remotely execute a function in another script (using Mailslot).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=193158 IPC_IO (by JohnWIlling)] - IPC library supporting multiple connection types (such as: Named Pipe, File, TCP, SharedMemory, MailSlot).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202618 IPC Techniques through ROT Objects (by LarsJ)] - Implementing IRunningObjectTable Interface.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106710 Mailslot (by trancexx)] - IPC using Mailslots.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=204734 Overlapped Named Pipe IPC (by Nine)] - Very fast interprocess communication that could be used between VBS or AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169797 Pool - Post Office for Organized Labour (by RTFC)] - Provides multiple AutoIt processes with an infrastructure for exchanging messages, data, and remote-control instructions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202587 WCD IPC (by Nine)] - Framework for Inter Process Communication using Windows Messages WM_COPYDATA.&lt;br /&gt;
&lt;br /&gt;
== Files, Databases and web connections ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=180850 ADO (by mLipok)] - A modifed version of the _SQL UDF to access all kind of databases (MSSQL, MySQL, PostgreSQL, SQLite, MS ACCESS, XLS, TXT, and many other which use ADO and ODBC).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105875 ADODB (by spudw2k)] - ADODB Example.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=176895 AXML (by Aipion)] - This is a Wrapper for Pugixml, made with C++.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145142 DBF (by funkey)] - dBase database read and write with DLL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/114406-csv-file-to-multidimensional-array/?do=findComment&amp;amp;comment=799820 CSV (by ProgAndy)] - Read/write CSV files to/from 2D arrays.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197909 CSV (by seangriffin)] - Manipulate CSV files using SQLite.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155748 CSVSplit (by czardas)] - Convert to and from CSV format.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119238 Excel file generation (by jerome)] - Excel file generation (multi-sheet workbook) without the need to have Excel installed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143866 Excel XML (by FireFox)] - Work with SpreadsheetML (Open XML file formats).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155905 EXml (by jdelaney)] - Create Excel file (SpreadsheetML) through &amp;quot;Microsoft.XMLDOM&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116072 EzMySql (by Yoriz)] - Use MySQL Databases with AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148232 _FileGetProperty (by BrewManNH)] - Retrieve properties of a file.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94920 FireBird (by eltorro)] - FireBird, Interbase DLL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197421 jq (by TheXman)] - Brings the power and flexibility of jq (an open-source command-line based JSON processor) to AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209502 JSON (by AspirinJunkie)] - Interacting with JSON data in AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=104150 JSON (by Gabriel13)] - RFC4627 compliant JSON encode/decode.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148114 JSON (by Ward)] - JSMN - A Non-Strict JSON UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=156794 JSON (by ozmike)] - Bridge to Native Windows JSON plus OO extension for AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173797 JSONgen: JSON generator (by Jefrey)] - Generate JSON.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127101 MS SQL (by TheLuBu)] - MSSQL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51952 MS SQL (by ChrisL)] - _SQL. ADODB Connection.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20814 MySQL (by cdkid)] - MySQL relational database management system.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=85617 MySQL (by ProgAndy)] - MySQL UDFs (without ODBC - working with libmysql.dll).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=122360 MySQL (by James)] - MySQL ODBC Connector.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=187223 romaSQL (rynow)] - Built on the concept of Laravel Query &amp;amp; doctrine. Connection string is based on ADODB / ODBC.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143331 Sharepoint 2007/2010 (by schoppet)] - Access the SOAP-Webservices of Sharepoint 2007/2010.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=17099 SQLite (by ptrex)] - SQLite is a library that implements a self-contained, embeddable, zero-configuration SQL database engine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=142977 SQLite Array Functions (by SmOke_N)] - SQLite Array Functions - a faster method for unique arrays and sorting methods.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140521 SQLite - Database (by PhoenixXL)] - UDF for SQLite so that beginners will also be able to do the stuff.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157853 SQLiteEx (by 57ar7up)] - SQLiteEx UDF v0.5.1 - Simplest work with SQLite.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163633 Xbase I/O (by RTFC)] - Transfer data between Xbase Data file (*.dbf) and AutoIt array written in pure AutoIt (no SQL, no ADO, no dlls, no external dependencies).&lt;br /&gt;
* [https://www.autoitscript.com/forum/imndex.php?showtopic=209526 xlsxNative (by AspirinJunkie)] - Read and write xlsx files without excel.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=19848 XML DOM Wrapper (by eltorro)] - Supports CRUD operations on XML. Including XSL and XPath.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=176895 XML (by mLipok)] - New version of XML DOM Wrapper, with many new features.&lt;br /&gt;
&lt;br /&gt;
== Data compression ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=85094 7z, zip, gzip, bzip2, tar (by rasim)] - Extensive library that uses a external DLL that must be provided with the script.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=92958 gZip (by Zinthose)] - Based on the parsing of gZip.exe output. It can work with memory, it doesn&#039;t work with files. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87441 LZMA (by trancexx)] - LZMA (Native Windows).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138838 Package (by Yashied)] - Package UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=129529 pZip (by asdf8)] - PureZIP_L library UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=76176 UnRAR (by rasim)] - UnRAR.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=17727 XZip (by eltorro)] - Another UDF for &amp;quot;XStandard XZIP Component&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161847 XZip (by mLipok)] - UDF for &amp;quot;XStandard XZIP Component&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=44524 Zip plugin (by eltorro)] - Zip plugin.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=73425 ZIP (by torels)] - ZIP UDF in pure AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116565 zip (by wraithdu)] - Create ZIP files and unpack ZIP files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135565 ZIP (by joakim)] - ZIP STRUCTS UDF (from scratch).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87284 ZLib (by monoceres)] - Based on ZLib.dll. It can compress/uncompress data in memory, it doesn&#039;t work with files.&lt;br /&gt;
&lt;br /&gt;
== Encryption and hash ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81332 _Base64Encode, _Base64Decode (by trancexx)] - Fast _Base64Encode, _Base64Decode.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=153246 Base91 and Base128 (by Beege)] - Base91 and Base128 functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155538 Codecrypter (by RTFC)] - Encrypt scripts without placing the key inside the script.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=201002 Cryptography API: Next Gen (by TheXman)] - Microsoft&#039;s long-term replacement for their CryptoAPI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=203990 GDPR (by mLipok)] - Functions to encrypt/decrypt strings and files with the GDPR in mind.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95558 Hashes for files (by trancexx)] - Fast RC32, MD4, MD5, SHA1 calculation for big files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=107784 TrueCrypt (by FuryCell)] - TrueCrypt UDFs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140737 WinTrust (by kasty)] - verify the integrity of a file with its embedded signature or a given catalog.&lt;br /&gt;
&lt;br /&gt;
== GUI Additions ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97241 3D Pie chart (by WideBoyDixon)] - 3D Pie chart.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173924 Chart_UDF (by Kanashius)] - This UDF can be used to Display bar charts in a window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=96258 ContextHelp (by Yashied)] - Management of context help ([https://www.autoitscript.com/forum/index.php?showtopic=72152-contexthelp/ original]).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=109096 ExtMsgBox (by Melba23)] - A very customisable replacement for MsgBox.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105582 GUICtrlOnChangeRegister (by Mat)] - Call a function when an edits content is changed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145149 GUIExtender (by Melba23)] - Expand and contract sections of your GUI ([https://www.autoitscript.com/forum/index.php?showtopic=117909 original]).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197654 GuiFlatButton (by kurtykurtyboy)] - Change colors of regular buttons.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119505 GUIFrame (by Melba23 &amp;amp; Kip)] - Divide a GUI into adjustable frames.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=144207 GUI Panel (by FireFox)] - Manage child GUIs as panel ctrls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113723 GUI Scrollbars (by Melba23)] - Automatically sized scrollbars with a single command.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161184 MetroGUI (by BBs19)] - Windows 10 style buttons, toggles, radios etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20967 Modern tray menu (by Holger)] - Allows the creation of modern, fancy GUI and tray menus with icons and colors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=194693 MTSkin (by Taskms4)] - Simply create modern looking GUIs (borderless GUI, Interactive menu panel (with mouse-over detection), a bunch of skins).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182136 Notifications (by S3cret91)] - Display permanent desktop notifications.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=136149 Notify (by Melba23)] - Small notifications on the edge of the display.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161750 Pie chart (by Andreik)] - Pie chart.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75429 Real Vista Aero Glass (by James)] - Real Vista Aero Glass UDF - you can apply glass effect to your GUI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=71811 SetOnEvent (by martin)] - Provides an easy way for an event to call functions with parameters.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=103871 _SysTray (by wraithdu)] - Get info about and manipulate Systray icons.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108445 Toast (by Melba23)] - Small message GUIs which pop out of the Systray.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=110003 Tray Icon Bar Graph (by BeeGee)] - Creates a scrolling bar graph as the tray icon.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=132864 Uskin (by JScript)] - Allows you to skin your GUI using the Windows &#039;&#039;.MSstyles&#039;&#039; files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191821 Wi3SMenu (by NHD)] - Create a slide menu with Windows 10 style. Supports color, icon and opacity.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=129196 WinSnap (by Beege)] - Automatic Window Alignment by applying that &amp;quot;snappy edge&amp;quot; effect to your GUI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32494 XSkin (by Valuater)] - Allows skinning of your GUI and to apply custom skins.&lt;br /&gt;
&lt;br /&gt;
=== Controls ===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202529 BrowseForFolder (by MrCreatoR)] - Handle SHBrowseForFolderW with more options, such as multi selection (checkboxes), window position, controls text and more. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=146406 Calendar (by jmon)] - Calendar UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=125293 ChooseFileFolder (byMelba23)] - Single and multiple selections from specified path treeview listing.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=96464 Colorpicker (by Yashied)] - Create a button for the user to select a color.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=123409 Explorer Frame UDF (by Beege)] - Takes any frame created by GUIFrame and turns it into a MS-Windows like Explorer window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173929 GDIPlus Slider UDF (by Kanashius)] - This UDF can be used to create a slider with an imagebackground and an image to move.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=79412 Graph control (by andybiochem)] - Easily create and show bar chart and line charts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=104399 GraphGDIPlus UDF (by andybiochem)] - Easily create and show bar chart and line charts with GDI+ to take advantage of double-buffering.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105682 GUICtrlCreateFinder (by Mat)] - Allows you to create a window finder control like the one seen in AutoIt Window Info.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=107965 GUIHotkey (by Mat)] - UDF for using native hotkey controls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182492 GUIListViewEx (by Melba23)] - Insert, delete, move, drag, sort, edit and colour ListView items.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111438 GUIPager (by Mat)] - Create and control native pager controls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20967 GUI/Tray Menu (by Holger, LarsJ, AZJIO)] - GUI/Tray Menu with icons and colors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166594 GUITreeViewEx (by Melba23)] - Check/clear parent and child checkboxes in a TreeView.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=90598 Hotkey input control (by Yashied)] - Hotkeys Input Control UDF Library (Non-native).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173932 ListView Edit UDF (by Kanashius)] - This UDF can be used to simply edit an Listview.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=109355 ListView - Explorer like ListView UDF (by Beege)] - This UDF simplify creating MS Explorer-like ListViews.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143711 Marquee (by Melba23)] - Make tickertape info bars.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143380 Predict Text UDF (by PhoenixXL)] - Sub classes the edit control and matches the current word through the Database &amp;amp; sets selection in accordance.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163939 Progressbar new style (by Muzaiyan)] - New styles for your progress bar.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=74649 Progressbar with GDIplus (by ProgAndy)] - You even can use full textured images.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151636 RestrictEdit_SRE UDF (by PhoenixXL)] - Restrict the text that can be entered in an editbox through a String Regular Expression.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=128242 Ribbon (by trancexx)] - UDF for Windows Ribbon framework.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114034 StringSize (by Melba23)] - Automatically size controls to fit the text you want to put in them.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126958 Syslink (by Yashied)] - Provides a convenient way to embed hypertext links in a window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105814 Table (by andybiochem)] - Table UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=125251 TVExplorer (by Yashied)] - Allows to create TreeView (TV) Explorer controls that display a tree of files and folders.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=190659 Virtual Listview (by LarsJ)] - Virtual Listview for large amounts of data with a large number of rows.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195053 Windows Message Monitor (by LarsJ)] - Monitor Windows Messages of a window or control.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=118317 Battery UDF (by Yashied)] - Retrieves a various information and current status of the battery(s).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154727 BuildPartitionTable (by RTFC)] - Scans a physical drive&#039;s partition table and returns a partition_table, allocation_table and volumes_table.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155674 CommAPI (by therealhanuta)] - Serial and parallel communication (COM port, RS-232, LPT port) - without installing DLL&#039;s (using Windows API calls).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=77731 Device Management (by weaponx)] - Device Management API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97487 DirectShow (by monoceres)] - DirectShow UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164700 DirectSound (by eukalyptus)] - DirectSound UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164701 Direct2D (by eukalyptus)] - Direct2D UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=99713 Drive Info (by NerdFencer)] - Gathers drive info for Hard Drives, Disk Drives, and Floppy Drives.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138989 FritzBox (by Allow2010)] - _FB_Tools - manage your FritzBox from Autoit.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121084 I/O Port Functions (by Ascend4nt)] - Input/Output UDF for interacting with ports (x64 Parallel Port, Keyboard etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=203207 MediaDevice (by Danyfirex)] - Transfer files to portable devices like phones, storages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154350 Monitor Configuration (by jaberwacky)] - Monitor Configuration UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155469 Mouse (by AlmarM)] - AutoIt powered mouse events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=147325 MouseTrapEvent (by ozmike)] - MouseTrapEvent UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149083 NetInfo (by Nessie)] - UDF for test internet download speed and upload speed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155539 Network configuration (by jguinch)] - Network configuration UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182684 Nitgen (by Jefrey)] - UDF to work with Nitgen fingerprint readers that use NGenBio SDK.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155485 Printers management with WMI (by jguinch)] - Allows to manage printers: add/delete printer, driver, port, or obtain configuration, set default printer ...&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=189190 Serial port UDF / COM port UDF (by MazeM)] - Another UDF for the serial port. It is very similar to CommAPI using kernel32.dll, but all code is packed into a single file without any dependencies.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=128546 Serial Port/COM (by martin)] - Serial Port /COM Port UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27755 SMARTDRIVE (by ptrex)] - SMART drive Analysis.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158640 SPI Hardware Interface (by Blinky)] - Communicate with the MAX335 chip using the SPI protocol via the LPT (printer) port.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=8188 VISA/GPIB (by Angel)] - VISA/GPIB library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=68866 Webcam (by LIMITER)] - Webcam UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70857 Webcam (by ludocus)] - Webcam UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91018 WiFi (by MattyD)] - Low level control over your wireless LAN.&lt;br /&gt;
&lt;br /&gt;
== Information gathering ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=29404 Computer information (by JSThePatriot)] - A general purpose library to get various details about a Windows machine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151920 NetworkStatistics (by Ascend4nt)] - Network Interface Info, Statistics, and Traffic.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=54039 WinPcap (by JRSmile)] - Wrapper for the windows packet capture library WinPcap.&lt;br /&gt;
* [https://opensource.grisambre.net/pcapau3/ WinPcap (by Nicolas Ricquemaque)] - A library to access the main functionalities offered by the WinPcap driver.&lt;br /&gt;
&lt;br /&gt;
== Internet protocol suite ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=207859 cURLX64 (by Beege)] - cURL UDF with x64 support.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=137456 cURL (by seangriffin)] - A UDF for transferring data with URL syntax.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=187718 HTTP lib (by Jefrey)] - HTTP lib (GET, POST and upload) UDF to simplify HTTP requests, mainly when dealing about POST data or file uploads.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202895 HttpApi (by TheXman)] - HTTP Server API enables applications to communicate over HTTP without using MS Internet Information Server (IIS).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=40243 IMAP (by mikeytown2)] - IMAP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108422 IMAP4 (by Tipulatoid)] - IMAP4 UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=43515 IRC (by McGod)] - A lightweight library for communicating with IRC servers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=159285 IRC (by rcmaehl)] - IRC UDF - Updated Version of Chips&#039; IRC UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=22838 POP3 (by Apzo)] - POP3 library for retrieving email messages. Not compatible with Gmail because it uses SSL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167339 POP3 (by mLipok)] - POP3 UDF According to the 1939 RFC, modified version with Quoted Printable decoder.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154530 Prowl (by mrflibblehat)] - Push notifications to iPhone, iPod touch or iPad using Prowl (Growl client for iOS).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138095 SFTP (by Lupo73)] - UDF to support SFTP protocol using PSFTP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154054 Socket UDF (by funkey)] - Socket UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=23860 SMTP (by Jos)] - Smtp Mailer That Supports Html And Attachments.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167292 SMTP Mailer UDF (by mLipok)] - Smtp Mailer That Supports Html And Attachments - Modified Version with support to save EML files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81687 SNMP (by enaiman)] - SNMP_UDF for SNMPv1 and SNMPv2c.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70759 SNMP - MIB protocol (by ptrex)] - Reading toner status from SNMP device with WMI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166579 SSH (by jeanphile)] - Use the SSH protocol very easily in your code.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=185329 STUN (by j0kky)] - STUN is a protocol that permits you to know your external IP but, more interesting, your external port associated to your internal port.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=184817 SyslogSend (by Irios)] - This allows sending (BSD) messages to a syslog server using UDP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169774 TCPServer (by Jefrey)] - Multi client, event-based, able to bind console app to socket.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=57022 UPnP Protocol (by ptrex)] - UPnP - Read and Control your devices in side out.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=84133 WinHTTP (by trancexx)] - Access the HTTP protocol for creating GET and POST requests and submitting them with conforming standards, cookies not supported.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=77503 WinInet (by -Ultima-)] - Access standard Internet protocols (FTP, Gopher and HTTP). Supports GET/POST requests and cookies.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=181645 Winsock (by j0kky)] - Create client/server application using native winsock functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191954 WSA_NBTCP (by ripdad)] - Windows Sockets API - Non-Blocking Transmission Control Protocol.&lt;br /&gt;
&lt;br /&gt;
== Maths ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170658 Advanced Math UDF (by scintilla4evr)] - Advanced mathematical functions (primes, number sequences, interpolate, calculate values of functions like Riemann zeta etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=102686 Advanced rounding (by Mat)] - Support for different measures of accuracy and 8 ways to resolve tie breaks.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83529 Big number (by eukalyptus)] - Make calculations with extremely large numbers that AutoIt normally is not able to support.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106551 Decimal To fraction (by Malkey)] - Converts any decimal number to a fraction. Example: 1.2 to 6/5.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/319-eigen4autoit/ Eigen4AutoIt (by RFTC)] - Allows to perform fast matrix operations on large numerical data sets, and much more ....&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140789 MathsEx UDF (by PhoenixXL)] - Functions for Carrying Out More Advanced Mathematical Calculations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81189 Number base conversion (by james3mg)] - From, to and between positive bases less than 63 (decimals supported).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=117156 NumToWord (by Mat)] - Convert numerals to a human readable string.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108803 Polynomials (by Mat)] - Functions for using polynomials.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83091 Primes (by jennico)] - Many functions dealing with prime number generation and calculations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94770 Roman Numerals (by AZJIO)] - Roman Numerals.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=98160 Root function (by Mat)] - Working out real roots of numbers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209527 Stat (by AspirinJunkie)] - Statistics for Autoit.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163899 StringAPL (by minx)] - inline APL interpreter.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=82722 Trigonometric and math functions (by trancexx)] - _ATan2(), _Cosh(), _Frexp(), _Hypot(), _Ldexp(), _Logb(), _Sinh(), _Tanh().&lt;br /&gt;
&lt;br /&gt;
== Media ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95357 FreeImage library (by ProgAndy)] - Various operations on images, such as rotate, resize, flip.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127263 HtmlHelp (by Geodetic)] - HtmlHelp functions for context-sensitive help from CHM (compiled HTML) files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116009 HyperCam (by seangriffin)] - HyperCam (Screen Recording) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182535 HyCam2 (by willichan)] - Automation for HyCam2 screen recording utility.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50608 OCR (by ptrex)] - Real OCR in AU3 - MODI with MS Office 2003.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=89542 OCR (by seangriffin)] - Tesseract (Screen OCR) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=206133 OCRSpace (by MrKm)] - Convert Images to text with the OCRSpace API. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51054 Printer controller (by martin)] - Print text in any font, size and colour at any position on the page, draw lines, curves, elipses, pies in any colour, and print images.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=73993 Printing (by GRS)] - Printing from AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202621 QRCreator (by BugFix)] - Simple QR-code creation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161831 RTF_Printer (by mLipok)] - Printing RichEdit in the background.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94834 Simple DirectMedia Layer (by AdmiralClaws)] - Adds support for joysticks, CDs, 2D graphics, timers. See [https://www.libsdl.org/ SDL website] for more information.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=207324 UWPOCR (by Danyfirex)] - Universal Windows Platform Optical Character Recognition API.&lt;br /&gt;
&lt;br /&gt;
===Graphics and image===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202987 AutoYolo3 (by smartee)] - Real-Time Object Detection using YOLOv3 wrapper.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113881 au3Irrlicht2 (by JRowe)] - Combining Irrlicht and AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=86748 AVI writing udf (by monoceres)] - Create uncompressed avi&#039;s from bitmap files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27362 Bitmap Library (by evilertoaster)] - Bitmap Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202663 GIF animation (by Nine)] - Fast cached GIF animation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150231 GTK+  (by prazetto)] - GTK+ Framework | Widgets.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=13096 ImageGetInfo (by Lazycat)] - Read info from JPEG, TIFF, BMP, PNG and GIF - size, color depth, resolution.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/471-image-search-udf Image Search (by VIP)] - Search for an image on the desktop. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70506 IrrLicht (by A. Percy)] - A 3D graphics engine suitable for creating games.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160732 OpenCV (by myliseJ)] - UDF for the OpenCV library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=206432 OpenCV v4+ (by smbape)] - OpenCV UDF with support for OpenCV v4+.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151011 OpenGL (by LarsJ)] - OpenGL without external libraries etc. For JPEG files it also retrieves various Exif information.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148129 OpenGL (2.0) (by minx)] - New set of UDFs for OpenGL + AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=152950 S3D (by Starg)] - Draw simple 3D graphics with GDI+.&lt;br /&gt;
&lt;br /&gt;
===Players===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114143 VLC (by seangriffin)] - VLC (Media Player) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91316 VLC Media Player (by ptrex)] - VLC Media Player.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27352 WMP (by ConsultingJoe)] - Windows Media Player UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=44008 WMP - Media Controls (by CFire)] - Another Windows Media Player UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=203154 WMP - GUI Control (by SudeepJD)] - IE based WMP Control.&lt;br /&gt;
&lt;br /&gt;
===Sound===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83481 BASS Function Library (by BrettF)] - Sound and Music via wrappers for Bass, BassEnc, Bass FX, BassSFX, BassAsio and BassCd DLLs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173808 libZPlay (by Danyfirex)] - Multimedia library for playing mp3, mp2, mp1, ogg, flac, ac3, aac, oga, wav and pcm files and streams.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=37072 MIDI (by eynstyne)] - MIDI UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=208116 MIDI (by MattyD)] - Wrap of the Windows MIDI functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114742 SAPIListBox (by seangriffin)] - SAPIListBox (Speech Recognition) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=100439 TTS (by Beege)] - Text-to-Speech UDF.&lt;br /&gt;
&lt;br /&gt;
== PDF ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162195 Acrobat Reader - ActiveX Viewer (by mLipok)] - Make your own PDF Viewer GUI with Acrobat Reader ActiveX COM Object &amp;quot;AcroPDF.PDF.1&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164469 Debenu PDF Viewer SDK (by mLipok)] - A collection of functions to display PDF files in your applications using Debenu PDF Viewer SDK.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160875 Debenu Quick PDF Library (by mLipok)] - A collection of functions for Debenu Quick PDF Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75832 FoxIt Reader (by ptrex)] - PDF Reader in AU3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=118827 MPDF (by taietel)] - Create PDF from your application.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=42776 PDFCreator (by ptrex)] - Automation of PDFCreator allows you to create and manipulate PDF files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170550 PDFCreator (by mLipok)] - UDF for PDFCreator v1.x.x with working EVENTs Handler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32261 _StringToPDF (by Tam0r)] - Write a string to a PDF file and specify font size, type etc.&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145158 Firewall (by JLogan3o13)] - Control and manipulate the Windows Firewall (enable/disable, Exclusions list, enable/disable ports etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=194015 Firewall policy2 (by Bilgus)]- Provides access to the firewall policy for Windows Vista+.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150819 VirusTotal (by Danyfirex)] - VirusTotal API 2.0 UDF.&lt;br /&gt;
&lt;br /&gt;
== Social Media and other Website API ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=159254 Cex.io (by AquilesCrespo)] - UDF script for using with the web api from https://cex.io/ server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169333 CrowdinAPI (by mLipok)] - Uses the [https://crowdin.com/page/api crowdin.net website API] for some functions (create projects, add and update files, download translations or integrate localization).&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/290-dropbox-authenticator/ Dropbox authenticator (by Gimerly)] - Dropbox authenticator.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158106 Easypost (by dcat127)] - Print USPS Postage Labels.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114801 eBay (by seangriffin)] - eBay UDF (functions GetItemStatus and GetSingleItem from the &amp;quot;Shopping API&amp;quot;).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=141340 Gmail (by PhoenixXL)] - Remote Gmail (UDF).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=192422 Gmail API (by Ascer)] - Automate communication with Gmail using oAuth 2.0 security. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=98504 Google Functions (by Beege)] - Google Functions (Suggestions, Definitions, Translate, Convert).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=115437 Google Maps (by seangriffin)] - Google Maps UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70675 iTunes (by torels)] - iTunes UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=101802 iTunes (by Beege)] - Another iTunes UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150985 No-IP (by Nessie)] - Simply update your no-ip hostname(s) and retrieve the ip address of an no-ip address.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=192391 oAuth (by Ascer)] - Open standard for access delegation, commonly used to grant websites or applications access to other websites.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150838 PasteBin (by mrflibblehat)] - Pastebin UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121767 Skype (by FireFox)] - Skype4COM provides an ActiveX interface to the Skype API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113234 Teamspeak 3 (by chipDE)] - Teamspeak 3 UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186944 TeamViewer API (by mLipok)] - A collection of function for use with TeamViewer API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186381 Telegram Bot (by LinkOut)] - UDF for [https://core.telegram.org/api Telegram messenger API].&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166547 TVmaze.com API (by BBs19)] - TVmaze.com API UDF (TV-Series).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116600 Twitter (by seangriffin)] - Manage Twitter.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149247 Yahoo Weather (by Nessie)] - Yahoo Weather API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=112775 Youtube Uploader (by BrettF)] - AYTU - AutoIt Youtube Uploader.&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50880 ACL (by ptrex)] - Set ACL on windows Objects.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=134508 ACL (by FredAl)] - Do most everything with the DACL and ownership on all types of objects: Files or folders, Registry keys, services, Kernel and WMI objects, etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=206400 BITS (by DonChunior)] - Background Intelligent Transfer Service to download files from or upload files to HTTP web servers and SMB file shares.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=184937 CertUtil (by mLipok)] - Wrapper for windows certutil.exe (command-line program that is installed in Windows as part of Certificate Services).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113560 FileSystemMonitor (by seangriffin)] - Monitors the file system by recording all file system events occurring within a given path.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111018 ITaskBarList (by Beege)] - ITaskBarList UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=74118 Local account (by engine)] - Manage local accounts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161193 Magnifier Functions (by Ascend4nt)] - Exposes most of the useful Magnifier API functions available since Windows Vista.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75250 Registry (by engine)] - Windows Registry UDFs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50551 Registry (by seanhart)] - RegWriteAllUsers / RegDeleteAllUsers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=80201 Service (by arcker)] - Build your own service with AutoIt code.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124508 Startup (by guinness)] - Create Startup entries in the Startup Folder or Registry.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164756 SCCM (by JLogan3o13)] - Systems Center Configuration Manager Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=134628 System restore (by FredAI)] - System restore UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186111 SubstWrapper (by mLipok)] - Wrapper for windows subst.exe command - (Associates a path with a drive letter).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135994 Taskplanner/Taskscheduler COM (by Allow2010)] - an UDF for using the Windows Taskplaner / Task Scheduler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83355 Task Scheduler (by dbzfanatic)] - Task Scheduler UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=200068 TaskScheduler (by water)] - Brushed up Task Scheduler UDF. Link to the [[TaskScheduler|documentation pages]].&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173934 TTS (by Kanashius)] - Used with SAPI Automation Object - text-to-speech (TTS) engine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158377 UAC (by AdamUL)] - User Account Control (UAC) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=175719 Utter (by Surya)] - Utilizing more of SAPI (Speech Recognition UDF).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127075 WIMGAPI (by Homes32)] - Manipulate Windows Image Files (.wim) without ImageX.exe.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=28436 Windows Events (by Emperor)] - Create your own Windows events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=6487 Windows Service Control functions (by SumTingWong)] - Some limited functions to control services (create, start, stop, delete, check ...).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81880 Windows Services (by engine)] - Windows Services UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163178 WRMF (by Luigi)] - WRMF - Windows Registry Monitor Call Function.&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&amp;lt;!-- Removed 2020-05-30 as adequate documentation is missing * [https://www.autoitscript.com/forum/topic/178871-dllcall-with-c-example/#comment-1285754 SMSApi (by mLipok)] - UDF for SMSAPi which provides SMS services. --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Removed 2020-05-30 as adequate documentation is missing * [https://www.autoitscript.com/forum/index.php?showtopic=178589 BulkSMS (by Skysnake)] - UDF for BulkSMS which provides SMS services. --&amp;gt;&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145099 _AdlibEnhance (by JScript)] - Enhance Adlib to call functions with parameters, pause and resume.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160936 Android (by Moriba)] - Control any Android device.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97826 Animated tray icons (by Yashied)] - Make animated tray icons easily.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163577 Atom Table (by Ascend4nt)] - Store (add, find, delete, and query) strings locally (at program level) or globally (at OS level) with unique numerical identifiers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170087 Barcode generators (by willichan)] - Creates a Code128A/B/C or Creates a Code39 or Code39Extended optimized barcode from supplied data.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87735 BlockInputEx (by MrCreatoR)] - Supports a few features that built-in BlockInput() function does not.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=199762 BlockInputEx (by Nine)] - Block all input coming from mouse and/or keyboard, without having an UAC warning displayed. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=29763 Clipboard (by eltorro)] - When apps need to watch the clipboard.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170630 ClipboardEx (by ozmike)] - Allows to have more than 1 item in the Clipboard. Handles all data types, not just text.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81267 Clipboard History (by wraithdu)] - Save and restore the entire clipboard contents. Inspired by AHK&#039;s ClipboardAll.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169610 CmdLine (by Jefrey)] - Collection of functions to parse command line arguments.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126569 Console (by Shaggi)] - Functions and features to work wiht Console input/output.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121833 Copy (by Yashied)] - Copy or move files and directories without suspending your script. Retrieve the current state (copied bytes, error code etc.) while copying.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154684 Date / Time convert (by Melba23)] - Transform date/time formats.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=99106 _DLLStructDisplay (by Ascend4nt)] - Show Struct in ListView.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157689 _FileGetMimeType (by Wiliat87)] - Retrieve MIME types based on the extension of the filename/filepath/URL provided.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=117033 File locking with cooperative semaphores (by willichan)] - Simple file locking without a server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157241 FindMimeFromData (by twbradio)] - FindMimeFromData using urlmon.dll.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=181997 Font Icon (by J2TeaM)] - Use Font Awesome in your AutoIt project.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=68422 HotString (by jvanegmond)] - Similar to the HotKey function but trigger on a string, instead of a key or key combination.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173946 LASM - Light Assembler (by minxomat)] - Inline UDF for an Assembler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161628 LFN (by orbs)] - Overcome MAX_PATH limit of 256 chars.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111492 Link Grammar for AutoIt (by JRowe)] -  Input is a regular sentence in English, German or Italian, output is a pattern parsed from the structure of the sentence.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/147-mruau3 MRU (by Yashied)] - Most Recently Used (MRU) List Automation functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186853 _Multiprocess (by jguinch)] - Run several external programs at the same time and retrieve the exit code of each process.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=188158 .NET Common Language Runtime (CLR) Framework (by Danyfirex, Junkew, Larsj, ptrex, Trancexx)] - Allows AutoIt to access .NET Class Libraries.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=101733 NoFocusLines (by Melba23)] - Remove the dotted focus lines from buttons, sliders, radios and checkboxes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149176 NotifyIcon (by FireFox)] - Create, delete and manage self notify icons (formerly TrayIconEx). &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=63318 PixelGetColor (by Manadar)] - Get or Read Pixel from memory.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167024 RDC (by Yashied)] - ReadDirectoryChanges Wrapper.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51103 Resources (by Zedna)] - Embed any binary data into your AutoIt compiled EXE files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162499 ResourcesEx (by guinness)] - Up to date version of Zedna&#039;s Resources UDF. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111215 Restart (by Yashied)] - Allows to restart a script from any location with full restoration of the original command line parameters.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51547 SciLexer (by Kip)] - Editing control, supports multiple editors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=152093 ScriptEditor (by pandel)] - ScriptEditor with I18N support and customizable lexer completely written in AutoIt (based on SciLexer).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162033 Spell Checker (by iCode)] - Spell Checker functions to call Hunspell, Hyphenate and MyThes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164444 Synology filestation (by nend)] - Functions to interact with a Synology NAS server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163328 TimeConvert (by orbs)] - Convert UTC to/from local time, and/or reformat the string representation.&lt;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=User_Defined_Functions&amp;diff=14852</id>
		<title>User Defined Functions</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=User_Defined_Functions&amp;diff=14852"/>
		<updated>2023-07-29T08:30:03Z</updated>

		<summary type="html">&lt;p&gt;MLipok: == Introduction == added to easily maintain header&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This page is a listing of libraries of &#039;&#039;&#039;user defined functions&#039;&#039;&#039; (UDF). These libraries have been written to allow easy integration into your own scripts and are a very valuable resource for any programmer.&amp;lt;br /&amp;gt;&lt;br /&gt;
This list is probably not complete (378 UDFs on 2023-07-27), but constantly supplemented.&lt;br /&gt;
If you do not find a solution here, ask a new question on the [https://www.autoitscript.com/forum/forum/2-general-help-and-support/ forum].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
The listed UDFs might have been written for older versions of AutoIt. So there is no guarantee that every UDF works smoothly with newer versions.&amp;lt;br /&amp;gt;&lt;br /&gt;
None of the UDFs has been tested by the maintainers of this list so you as a user need to make sure that they deliver the expected results.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;When will an UDF be added to this list?&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
It should meet all/most of the general requirements for UDFs as described [[UDF-spec|here]].&amp;lt;br&amp;gt;&lt;br /&gt;
In addition the following requirements should be met:&lt;br /&gt;
* &#039;&#039;&#039;Documentation&#039;&#039;&#039;: So users can tell what the UDF is intended to do (&#039;&#039;mandatory&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;Examples&#039;&#039;&#039;: So users can get an idea how to use the UDF. The more the better (&#039;&#039;mandatory&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;Operating&#039;&#039;&#039; systems: Should support the latest Microsoft OS (&#039;&#039;mandatory&#039;&#039;) plus as many predecessors as possible (&#039;&#039;optional&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;AutoIt&#039;&#039;&#039;: Should support the latest version of AutoIt (&#039;&#039;mandatory&#039;&#039;) plus as many predecessors as possible (&#039;&#039;optional&#039;&#039;)&lt;br /&gt;
* &#039;&#039;&#039;Author&#039;&#039;&#039;: The author should still be active on the forum so he can reply to questions (&#039;&#039;optional&#039;&#039;)&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;What to do when one of your UDFs is missing?&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Please send a [https://www.autoitscript.com/forum/messenger/compose/?to=7903 PM] to user water. Add a short description of the UDF and a link to your post in the [https://www.autoitscript.com/forum/forum/9-autoit-example-scripts/ Example Scripts forum].&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Added in the past two years&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Date !! Section !! Creator !! Description&lt;br /&gt;
|-&lt;br /&gt;
|2023-07-27 || [[User_Defined_Functions#Files.2C_Databases_and_web_connections|Files, Databases and web connections]] || AspirinJunkie || [https://www.autoitscript.com/forum/imndex.php?showtopic=209526 xlsxNative (by AspirinJunkie)] - Read and write xlsx files without excel.&lt;br /&gt;
|-&lt;br /&gt;
|2023-07-27 || [[User_Defined_Functions#OpenOffice.2FLibreOffice|OpenOffice/LibreOffice]] || donnyh13 || [https://www.autoitscript.com/forum/index.php?showtopic=210514 LibreOffice Writer] - A huge list of functions for LibreOffice Writer.&lt;br /&gt;
|-&lt;br /&gt;
|2023-02-03 || [[User_Defined_Functions#Graphics_and_image|Graphics and image]] || Starg || [https://www.autoitscript.com/forum/index.php?showtopic=152950 S3D] - Draw simple 3D graphics with GDI+.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Files.2C_Databases_and_web_connections|Files, Databases and web connections]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209502 JSON] - Interacting with JSON data in AutoIt.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging|Script Coding/Analyzing/Debugging]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209529 Set] - Provides a set data type and brings the corresponding mathematical functions.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Maths|Maths]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209527 Stat] - Statistics for Autoit.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging|Script Coding/Analyzing/Debugging]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209523 ArrayPlus] - Functions for flexible Array handling (creating, extracting, rebuilding, sorting, filtering, finding, printing).&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-21 || [[User_Defined_Functions#Script_Coding.2FAnalyzing.2FDebugging|Script Coding/Analyzing/Debugging]] || AspirinJunkie || [https://www.autoitscript.com/forum/index.php?showtopic=209528 ArrayCombinations] - Different ways of composing elements of a set.&lt;br /&gt;
|-&lt;br /&gt;
| 2023-01-04 || [[User_Defined_Functions#Sound|Sound]] || MattyD || [https://www.autoitscript.com/forum/index.php?showtopic=208116 MIDI UDF] - Wrap of the Windows MIDI functions.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-06-19 || [[User_Defined_Functions#Internet protocol suite|Internet protocol suite]] || Beege || [https://www.autoitscript.com/forum/index.php?showtopic=207859 cURLX64] - cURL UDF with x64 support.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-05-24 || [[User_Defined_Functions#Controls|Controls]] || kurtykurtyboy || [https://www.autoitscript.com/forum/index.php?showtopic=197654 GuiFlatButton] - Change colors of regular buttons.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-04-25 || [[User_Defined_Functions#Social_Media_and_other_Website_API|Social Media and other Website API]] || Ascer || [https://www.autoitscript.com/forum/index.php?showtopic=192391 oAuth] - Open standard for access delegation, commonly used to grant websites or applications access to other websites.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-02-22 || [[User_Defined_Functions#Files.2C_Databases_and_web_connections|Files, Databases and web connections]] || czardas || [https://www.autoitscript.com/forum/index.php?showtopic=155748 CSVSplit] - Convert to and from CSV format.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-02-11 || [[User_Defined_Functions#Inter_Process_Communications|Inter Process Communications]] || Nine || [https://www.autoitscript.com/forum/index.php?showtopic=204734 Overlapped Named Pipe IPC] - Very fast interprocess communication that could be used between VBS or AutoIt.&lt;br /&gt;
|-&lt;br /&gt;
| 2022-01-11 || [[User_Defined_Functions#Media|Media]] || MrKm || [https://www.autoitscript.com/forum/index.php?showtopic=206133 OCRSpace] - Convert Images to text with the OCRSpace API. &lt;br /&gt;
|-&lt;br /&gt;
| 2022-01-11 || [[User_Defined_Functions#Media|Media]] || Danyfirex || [https://www.autoitscript.com/forum/index.php?showtopic=207324 UWPOCR] - Universal Windows Platform Optical Character Recognition API.&lt;br /&gt;
|-&lt;br /&gt;
| 2021-08-18 || [[User_Defined_Functions#Graphics_and_image|Graphics and image]] || smbape || [https://www.autoitscript.com/forum/index.php?showtopic=206432 OpenCV v4+] -  OpenCV UDF with support for OpenCV v4+.&lt;br /&gt;
|-&lt;br /&gt;
| 2021-08-04 || [[User_Defined_Functions#Windows|Windows]] || DonChunior || [https://www.autoitscript.com/forum/index.php?showtopic=206400 BITS] - Background Intelligent Transfer Service to download/upload files from/to HTTP web servers and SMB file shares.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Automation ==&lt;br /&gt;
&lt;br /&gt;
===Browsers===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154439 Chrome (by seangriffin)] - Automate the most common tasks in Chrome with this UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95595 Firefox (by Stilgar)] - A little less support for automation than IE, but still very good.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167661 Firefox (by Danp2)] - Modified newer version of Stilgar Firefox UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/224-firefox-profile-backup/ FireFox Profile Backup 1.0 (by careca)] - Backup or restore your firefox profile. The application searches for the profile in home drive that will be the one to backup.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124330 _FF_AutoLogin (by Stilgar)] - This is a auto-login function and login-function-generator for FireFox and the FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=92035 _FF_DM (by Stilgar)] - UDF to control the FireFox Download-Manager (not the download-window).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91650 _FF_FoxBox (by Stilgar)] - UDF to control Fox!Box (A Mozilla Firefox extension for the AVM FRITZ!Box) with FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91665 _FF_Screengrab (by Stilgar)] - UDF to control Screengrab! (FireFox-AddOn) with FF.au3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124330 _HTML (by Stilgar)] - Get informations from any HTML (XML) source, without any browser.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166542 HTMLDocumentEvents (by SmOke_N)] - Track IE document events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167035 IEEx (by SmOke_N)] - IE extended library with some Javascript options.&lt;br /&gt;
* Internet Explorer (by DaleHohm et al.) - IE library that is now supplied with a standard AutoIt install.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=153520 IUIAutomation MS framework (by junkew)] - IUIAutomation MS framework to automate chrome, FF, IE etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149203 NavInfo (by Nessie)] - With this UDF you can check if a specified browser/software is installed and which version is being used.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=61090 Opera (by MrCreatoR,)] - Automate the most common tasks in Opera with this UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191990 WebDriver (by Danp2)] - W3C compliant Webriver UDF.&lt;br /&gt;
&lt;br /&gt;
===Microsoft Office===&lt;br /&gt;
Some features of Microsoft&#039;s Office products are proprietary and cannot readily be manipulated.  Sometimes workarounds are required.&amp;lt;br&amp;gt;&amp;lt;u&amp;gt;[[Known issues with Microsoft Office automation.|This page]]&amp;lt;/u&amp;gt; is dedicated to identifying those issues, provide explanations and list solutions or workarounds.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32144 Microsoft Office Access (by randallc)] - Automate Microsoft Access.&lt;br /&gt;
* Microsoft Office Excel (by water et al.) - This UDF is included in AutoIt. Link to the [[Excel_UDF|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135312 Microsoft Office Excel Charts (by water, GreenCan)] - Creating charts using Microsoft Excel.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=204034 Microsoft Office Excel Pivot Tables (by SudeepJD)] - Create and Update Excel Pivot Tables and Charts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126305 Microsoft Office Outlook (Items) (by water)] - Automate Microsoft Outlook Items. Link to the [[OutlookEX_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202451 Microsoft Office Outlook (GUI) (by water)] - Automate Microsoft Outlook GUI. Link to the [[OutlookEX_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197346 Microsoft Office Outlook Tools (by water)] - Built on top of the OutlookEX UDF it offers some often needed extended functionality (import/export ics/vcf files etc.). Link to the [[OutlookTools|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50254 Microsoft Office PowerPoint (by Toady)] - Automate Microsoft PowerPoint.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=178783 Microsoft Office PowerPoint (by water)] - Automate Microsoft PowerPoint. Link to the [[Powerpoint|documentation]] pages.&lt;br /&gt;
* Microsoft Office Word (by water et al.) - This UDF is included in AutoIt. Link to the [[Word_UDF|documentation]] pages.&lt;br /&gt;
&lt;br /&gt;
===OpenOffice/LibreOffice===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=210514 LibreOffice Writer (by donnyh13)] - A huge list of functions for LibreOffice Writer.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151530 OOo/LibO Calc (by GMK)] - OpenOfficeCalc UDF (works also for Libre Office).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=185932 OpenOffice/LibreOffice Spell Checker (by GMK)] - Function to validate words, and show spell alternatives.&lt;br /&gt;
&lt;br /&gt;
===Other Applications===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106163 Active Directory (by water)] - Extensive library to control and manipulate the Windows active directory ([https://www.autoitscript.com/forum/files/file/355-ad-active-directory-udf/ Download]). Link to the [[Active_Directory_UDF_-_General|documentation]] pages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87956 Java (by seangriffin)] - Creates an access bridge between your application and a Java application. Allowing you to automate some Java applications.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=86574 SAP (by seangriffin)] - SAP business management automation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149540 SAPWizard (by ozmike)] - SAPWizard UDF.&lt;br /&gt;
&lt;br /&gt;
== Script Coding/Analyzing/Debugging ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209528 ArrayCombinations (by AspirinJunkie)] - Different ways of composing elements of a set.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155442 ArrayMultiColSort (by Melba23)] - Function to sort a 2D array on several columns.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209523 ArrayPlus (by AspirinJunkie)] - Functions for flexible Array handling (creating, extracting, rebuilding, sorting, filtering, finding, printing)&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=180467 ArrayWorkshop (by czardas)] - Multidimensional array functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=59174 Associative array functions (by Nutster)] - Manage a version of associative arrays in single AutoIt variables. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=198929 AutoIt error logger (AUERLO) (by user4157124)] - File- and stdout (etc.) output of messages, regular- and COM Object errors, exit method and -code, etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=110379 AutoItObject (by ProgAndy and others)] - Brings the Object Orientation programming paradigm to AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=112879 AutoIt Syntax Highlight (by MrCreatoR)] - Highlights AutoIt v3 syntax code to html/bbcode format.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191488 cDebug (by c.haslam)] - Dumps the values of all AutoIt subtypes and expressions including nested arrays, DLL structs and maps.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195882 ErrorLog (by mLipok)] - Logs program activities and errors to different output locations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143167 GetOpt (by dany)] - Parse GNU and DOS style command line options similar to getopt().&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=156196 Log4a (by zorphnog)] - Logging library loosely based upon the log4j and NLog libaries.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195862 Loga (by Danyfirex)] - Simple logging library to keep track of code with an integrated console.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119032 Log UDF (by Yashied)] - Create a text log files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202832 OnDebugMsgBox (by argumentum)] - Catch the dreaded &amp;quot;AutoIt Error&amp;quot; MsgBox and prettify or hide it.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209529 Set (by AspirinJunkie)] - Provides a set data type and brings the corresponding mathematical functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=200660 Variants and Safearrays (by LarsJ)] - Create/access/process Variants and SafeArrays.&lt;br /&gt;
&lt;br /&gt;
=== Inter Process Communications ===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202485 AppInteract (by MrCreatoR)] - Reliably pass arrays or other types between processes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=205109 AutoItSharedData (by SEuBo)] - Create a shared data storage, a simple AutoItObject-Object, using AutoItObject_Internal.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=188991 Autoit-Socket-IO (by tarretarretarre)] - Event driven TCP/IP wrapper inspired by Socket.IO with focus on user friendliness and long term sustainability.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126936 Container (by MrCreatoR)] - Scripts interaction method. Allows to transfer whole arrays as data, and even COM objects.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=55994 DDEML (by doudou)] - Use your AutoIt script as DDE client or server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=193277 FMIPC (by argumentum)] - IPC via FileMapping.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127615 Interprocess (by JScript)] - Remotely execute a function in another script (using Mailslot).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=193158 IPC_IO (by JohnWIlling)] - IPC library supporting multiple connection types (such as: Named Pipe, File, TCP, SharedMemory, MailSlot).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202618 IPC Techniques through ROT Objects (by LarsJ)] - Implementing IRunningObjectTable Interface.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106710 Mailslot (by trancexx)] - IPC using Mailslots.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=204734 Overlapped Named Pipe IPC (by Nine)] - Very fast interprocess communication that could be used between VBS or AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169797 Pool - Post Office for Organized Labour (by RTFC)] - Provides multiple AutoIt processes with an infrastructure for exchanging messages, data, and remote-control instructions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202587 WCD IPC (by Nine)] - Framework for Inter Process Communication using Windows Messages WM_COPYDATA.&lt;br /&gt;
&lt;br /&gt;
== Files, Databases and web connections ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=180850 ADO (by mLipok)] - A modifed version of the _SQL UDF to access all kind of databases (MSSQL, MySQL, PostgreSQL, SQLite, MS ACCESS, XLS, TXT, and many other which use ADO and ODBC).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105875 ADODB (by spudw2k)] - ADODB Example.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=176895 AXML (by Aipion)] - This is a Wrapper for Pugixml, made with C++.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145142 DBF (by funkey)] - dBase database read and write with DLL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/114406-csv-file-to-multidimensional-array/?do=findComment&amp;amp;comment=799820 CSV (by ProgAndy)] - Read/write CSV files to/from 2D arrays.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197909 CSV (by seangriffin)] - Manipulate CSV files using SQLite.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155748 CSVSplit (by czardas)] - Convert to and from CSV format.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119238 Excel file generation (by jerome)] - Excel file generation (multi-sheet workbook) without the need to have Excel installed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143866 Excel XML (by FireFox)] - Work with SpreadsheetML (Open XML file formats).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155905 EXml (by jdelaney)] - Create Excel file (SpreadsheetML) through &amp;quot;Microsoft.XMLDOM&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116072 EzMySql (by Yoriz)] - Use MySQL Databases with AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148232 _FileGetProperty (by BrewManNH)] - Retrieve properties of a file.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94920 FireBird (by eltorro)] - FireBird, Interbase DLL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197421 jq (by TheXman)] - Brings the power and flexibility of jq (an open-source command-line based JSON processor) to AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209502 JSON (by AspirinJunkie)] - Interacting with JSON data in AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=104150 JSON (by Gabriel13)] - RFC4627 compliant JSON encode/decode.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148114 JSON (by Ward)] - JSMN - A Non-Strict JSON UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=156794 JSON (by ozmike)] - Bridge to Native Windows JSON plus OO extension for AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173797 JSONgen: JSON generator (by Jefrey)] - Generate JSON.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127101 MS SQL (by TheLuBu)] - MSSQL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51952 MS SQL (by ChrisL)] - _SQL. ADODB Connection.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20814 MySQL (by cdkid)] - MySQL relational database management system.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=85617 MySQL (by ProgAndy)] - MySQL UDFs (without ODBC - working with libmysql.dll).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=122360 MySQL (by James)] - MySQL ODBC Connector.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=187223 romaSQL (rynow)] - Built on the concept of Laravel Query &amp;amp; doctrine. Connection string is based on ADODB / ODBC.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143331 Sharepoint 2007/2010 (by schoppet)] - Access the SOAP-Webservices of Sharepoint 2007/2010.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=17099 SQLite (by ptrex)] - SQLite is a library that implements a self-contained, embeddable, zero-configuration SQL database engine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=142977 SQLite Array Functions (by SmOke_N)] - SQLite Array Functions - a faster method for unique arrays and sorting methods.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140521 SQLite - Database (by PhoenixXL)] - UDF for SQLite so that beginners will also be able to do the stuff.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157853 SQLiteEx (by 57ar7up)] - SQLiteEx UDF v0.5.1 - Simplest work with SQLite.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163633 Xbase I/O (by RTFC)] - Transfer data between Xbase Data file (*.dbf) and AutoIt array written in pure AutoIt (no SQL, no ADO, no dlls, no external dependencies).&lt;br /&gt;
* [https://www.autoitscript.com/forum/imndex.php?showtopic=209526 xlsxNative (by AspirinJunkie)] - Read and write xlsx files without excel.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=19848 XML DOM Wrapper (by eltorro)] - Supports CRUD operations on XML. Including XSL and XPath.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=176895 XML (by mLipok)] - New version of XML DOM Wrapper, with many new features.&lt;br /&gt;
&lt;br /&gt;
== Data compression ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=85094 7z, zip, gzip, bzip2, tar (by rasim)] - Extensive library that uses a external DLL that must be provided with the script.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=92958 gZip (by Zinthose)] - Based on the parsing of gZip.exe output. It can work with memory, it doesn&#039;t work with files. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87441 LZMA (by trancexx)] - LZMA (Native Windows).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138838 Package (by Yashied)] - Package UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=129529 pZip (by asdf8)] - PureZIP_L library UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=76176 UnRAR (by rasim)] - UnRAR.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=17727 XZip (by eltorro)] - Another UDF for &amp;quot;XStandard XZIP Component&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161847 XZip (by mLipok)] - UDF for &amp;quot;XStandard XZIP Component&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=44524 Zip plugin (by eltorro)] - Zip plugin.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=73425 ZIP (by torels)] - ZIP UDF in pure AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116565 zip (by wraithdu)] - Create ZIP files and unpack ZIP files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135565 ZIP (by joakim)] - ZIP STRUCTS UDF (from scratch).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87284 ZLib (by monoceres)] - Based on ZLib.dll. It can compress/uncompress data in memory, it doesn&#039;t work with files.&lt;br /&gt;
&lt;br /&gt;
== Encryption and hash ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81332 _Base64Encode, _Base64Decode (by trancexx)] - Fast _Base64Encode, _Base64Decode.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=153246 Base91 and Base128 (by Beege)] - Base91 and Base128 functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155538 Codecrypter (by RTFC)] - Encrypt scripts without placing the key inside the script.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=201002 Cryptography API: Next Gen (by TheXman)] - Microsoft&#039;s long-term replacement for their CryptoAPI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=203990 GDPR (by mLipok)] - Functions to encrypt/decrypt strings and files with the GDPR in mind.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95558 Hashes for files (by trancexx)] - Fast RC32, MD4, MD5, SHA1 calculation for big files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=107784 TrueCrypt (by FuryCell)] - TrueCrypt UDFs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140737 WinTrust (by kasty)] - verify the integrity of a file with its embedded signature or a given catalog.&lt;br /&gt;
&lt;br /&gt;
== GUI Additions ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97241 3D Pie chart (by WideBoyDixon)] - 3D Pie chart.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173924 Chart_UDF (by Kanashius)] - This UDF can be used to Display bar charts in a window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=96258 ContextHelp (by Yashied)] - Management of context help ([https://www.autoitscript.com/forum/index.php?showtopic=72152-contexthelp/ original]).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=109096 ExtMsgBox (by Melba23)] - A very customisable replacement for MsgBox.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105582 GUICtrlOnChangeRegister (by Mat)] - Call a function when an edits content is changed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145149 GUIExtender (by Melba23)] - Expand and contract sections of your GUI ([https://www.autoitscript.com/forum/index.php?showtopic=117909 original]).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=197654 GuiFlatButton (by kurtykurtyboy)] - Change colors of regular buttons.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=119505 GUIFrame (by Melba23 &amp;amp; Kip)] - Divide a GUI into adjustable frames.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=144207 GUI Panel (by FireFox)] - Manage child GUIs as panel ctrls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113723 GUI Scrollbars (by Melba23)] - Automatically sized scrollbars with a single command.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161184 MetroGUI (by BBs19)] - Windows 10 style buttons, toggles, radios etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20967 Modern tray menu (by Holger)] - Allows the creation of modern, fancy GUI and tray menus with icons and colors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=194693 MTSkin (by Taskms4)] - Simply create modern looking GUIs (borderless GUI, Interactive menu panel (with mouse-over detection), a bunch of skins).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182136 Notifications (by S3cret91)] - Display permanent desktop notifications.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=136149 Notify (by Melba23)] - Small notifications on the edge of the display.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161750 Pie chart (by Andreik)] - Pie chart.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75429 Real Vista Aero Glass (by James)] - Real Vista Aero Glass UDF - you can apply glass effect to your GUI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=71811 SetOnEvent (by martin)] - Provides an easy way for an event to call functions with parameters.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=103871 _SysTray (by wraithdu)] - Get info about and manipulate Systray icons.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108445 Toast (by Melba23)] - Small message GUIs which pop out of the Systray.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=110003 Tray Icon Bar Graph (by BeeGee)] - Creates a scrolling bar graph as the tray icon.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=132864 Uskin (by JScript)] - Allows you to skin your GUI using the Windows &#039;&#039;.MSstyles&#039;&#039; files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191821 Wi3SMenu (by NHD)] - Create a slide menu with Windows 10 style. Supports color, icon and opacity.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=129196 WinSnap (by Beege)] - Automatic Window Alignment by applying that &amp;quot;snappy edge&amp;quot; effect to your GUI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32494 XSkin (by Valuater)] - Allows skinning of your GUI and to apply custom skins.&lt;br /&gt;
&lt;br /&gt;
=== Controls ===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202529 BrowseForFolder (by MrCreatoR)] - Handle SHBrowseForFolderW with more options, such as multi selection (checkboxes), window position, controls text and more. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=146406 Calendar (by jmon)] - Calendar UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=125293 ChooseFileFolder (byMelba23)] - Single and multiple selections from specified path treeview listing.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=96464 Colorpicker (by Yashied)] - Create a button for the user to select a color.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=123409 Explorer Frame UDF (by Beege)] - Takes any frame created by GUIFrame and turns it into a MS-Windows like Explorer window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173929 GDIPlus Slider UDF (by Kanashius)] - This UDF can be used to create a slider with an imagebackground and an image to move.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=79412 Graph control (by andybiochem)] - Easily create and show bar chart and line charts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=104399 GraphGDIPlus UDF (by andybiochem)] - Easily create and show bar chart and line charts with GDI+ to take advantage of double-buffering.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105682 GUICtrlCreateFinder (by Mat)] - Allows you to create a window finder control like the one seen in AutoIt Window Info.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=107965 GUIHotkey (by Mat)] - UDF for using native hotkey controls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182492 GUIListViewEx (by Melba23)] - Insert, delete, move, drag, sort, edit and colour ListView items.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111438 GUIPager (by Mat)] - Create and control native pager controls.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=20967 GUI/Tray Menu (by Holger, LarsJ, AZJIO)] - GUI/Tray Menu with icons and colors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166594 GUITreeViewEx (by Melba23)] - Check/clear parent and child checkboxes in a TreeView.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=90598 Hotkey input control (by Yashied)] - Hotkeys Input Control UDF Library (Non-native).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173932 ListView Edit UDF (by Kanashius)] - This UDF can be used to simply edit an Listview.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=109355 ListView - Explorer like ListView UDF (by Beege)] - This UDF simplify creating MS Explorer-like ListViews.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143711 Marquee (by Melba23)] - Make tickertape info bars.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=143380 Predict Text UDF (by PhoenixXL)] - Sub classes the edit control and matches the current word through the Database &amp;amp; sets selection in accordance.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163939 Progressbar new style (by Muzaiyan)] - New styles for your progress bar.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=74649 Progressbar with GDIplus (by ProgAndy)] - You even can use full textured images.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151636 RestrictEdit_SRE UDF (by PhoenixXL)] - Restrict the text that can be entered in an editbox through a String Regular Expression.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=128242 Ribbon (by trancexx)] - UDF for Windows Ribbon framework.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114034 StringSize (by Melba23)] - Automatically size controls to fit the text you want to put in them.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126958 Syslink (by Yashied)] - Provides a convenient way to embed hypertext links in a window.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=105814 Table (by andybiochem)] - Table UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=125251 TVExplorer (by Yashied)] - Allows to create TreeView (TV) Explorer controls that display a tree of files and folders.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=190659 Virtual Listview (by LarsJ)] - Virtual Listview for large amounts of data with a large number of rows.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=195053 Windows Message Monitor (by LarsJ)] - Monitor Windows Messages of a window or control.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=118317 Battery UDF (by Yashied)] - Retrieves a various information and current status of the battery(s).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154727 BuildPartitionTable (by RTFC)] - Scans a physical drive&#039;s partition table and returns a partition_table, allocation_table and volumes_table.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155674 CommAPI (by therealhanuta)] - Serial and parallel communication (COM port, RS-232, LPT port) - without installing DLL&#039;s (using Windows API calls).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=77731 Device Management (by weaponx)] - Device Management API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97487 DirectShow (by monoceres)] - DirectShow UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164700 DirectSound (by eukalyptus)] - DirectSound UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164701 Direct2D (by eukalyptus)] - Direct2D UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=99713 Drive Info (by NerdFencer)] - Gathers drive info for Hard Drives, Disk Drives, and Floppy Drives.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138989 FritzBox (by Allow2010)] - _FB_Tools - manage your FritzBox from Autoit.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121084 I/O Port Functions (by Ascend4nt)] - Input/Output UDF for interacting with ports (x64 Parallel Port, Keyboard etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=203207 MediaDevice (by Danyfirex)] - Transfer files to portable devices like phones, storages.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154350 Monitor Configuration (by jaberwacky)] - Monitor Configuration UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155469 Mouse (by AlmarM)] - AutoIt powered mouse events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=147325 MouseTrapEvent (by ozmike)] - MouseTrapEvent UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149083 NetInfo (by Nessie)] - UDF for test internet download speed and upload speed.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155539 Network configuration (by jguinch)] - Network configuration UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182684 Nitgen (by Jefrey)] - UDF to work with Nitgen fingerprint readers that use NGenBio SDK.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=155485 Printers management with WMI (by jguinch)] - Allows to manage printers: add/delete printer, driver, port, or obtain configuration, set default printer ...&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=189190 Serial port UDF / COM port UDF (by MazeM)] - Another UDF for the serial port. It is very similar to CommAPI using kernel32.dll, but all code is packed into a single file without any dependencies.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=128546 Serial Port/COM (by martin)] - Serial Port /COM Port UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27755 SMARTDRIVE (by ptrex)] - SMART drive Analysis.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158640 SPI Hardware Interface (by Blinky)] - Communicate with the MAX335 chip using the SPI protocol via the LPT (printer) port.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=8188 VISA/GPIB (by Angel)] - VISA/GPIB library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=68866 Webcam (by LIMITER)] - Webcam UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70857 Webcam (by ludocus)] - Webcam UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91018 WiFi (by MattyD)] - Low level control over your wireless LAN.&lt;br /&gt;
&lt;br /&gt;
== Information gathering ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=29404 Computer information (by JSThePatriot)] - A general purpose library to get various details about a Windows machine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151920 NetworkStatistics (by Ascend4nt)] - Network Interface Info, Statistics, and Traffic.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=54039 WinPcap (by JRSmile)] - Wrapper for the windows packet capture library WinPcap.&lt;br /&gt;
* [https://opensource.grisambre.net/pcapau3/ WinPcap (by Nicolas Ricquemaque)] - A library to access the main functionalities offered by the WinPcap driver.&lt;br /&gt;
&lt;br /&gt;
== Internet protocol suite ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=207859 cURLX64 (by Beege)] - cURL UDF with x64 support.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=137456 cURL (by seangriffin)] - A UDF for transferring data with URL syntax.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=187718 HTTP lib (by Jefrey)] - HTTP lib (GET, POST and upload) UDF to simplify HTTP requests, mainly when dealing about POST data or file uploads.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202895 HttpApi (by TheXman)] - HTTP Server API enables applications to communicate over HTTP without using MS Internet Information Server (IIS).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=40243 IMAP (by mikeytown2)] - IMAP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108422 IMAP4 (by Tipulatoid)] - IMAP4 UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=43515 IRC (by McGod)] - A lightweight library for communicating with IRC servers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=159285 IRC (by rcmaehl)] - IRC UDF - Updated Version of Chips&#039; IRC UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=22838 POP3 (by Apzo)] - POP3 library for retrieving email messages. Not compatible with Gmail because it uses SSL.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167339 POP3 (by mLipok)] - POP3 UDF According to the 1939 RFC, modified version with Quoted Printable decoder.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154530 Prowl (by mrflibblehat)] - Push notifications to iPhone, iPod touch or iPad using Prowl (Growl client for iOS).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=138095 SFTP (by Lupo73)] - UDF to support SFTP protocol using PSFTP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154054 Socket UDF (by funkey)] - Socket UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=23860 SMTP (by Jos)] - Smtp Mailer That Supports Html And Attachments.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167292 SMTP Mailer UDF (by mLipok)] - Smtp Mailer That Supports Html And Attachments - Modified Version with support to save EML files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81687 SNMP (by enaiman)] - SNMP_UDF for SNMPv1 and SNMPv2c.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70759 SNMP - MIB protocol (by ptrex)] - Reading toner status from SNMP device with WMI.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166579 SSH (by jeanphile)] - Use the SSH protocol very easily in your code.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=185329 STUN (by j0kky)] - STUN is a protocol that permits you to know your external IP but, more interesting, your external port associated to your internal port.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=184817 SyslogSend (by Irios)] - This allows sending (BSD) messages to a syslog server using UDP.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169774 TCPServer (by Jefrey)] - Multi client, event-based, able to bind console app to socket.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=57022 UPnP Protocol (by ptrex)] - UPnP - Read and Control your devices in side out.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=84133 WinHTTP (by trancexx)] - Access the HTTP protocol for creating GET and POST requests and submitting them with conforming standards, cookies not supported.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=77503 WinInet (by -Ultima-)] - Access standard Internet protocols (FTP, Gopher and HTTP). Supports GET/POST requests and cookies.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=181645 Winsock (by j0kky)] - Create client/server application using native winsock functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=191954 WSA_NBTCP (by ripdad)] - Windows Sockets API - Non-Blocking Transmission Control Protocol.&lt;br /&gt;
&lt;br /&gt;
== Maths ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170658 Advanced Math UDF (by scintilla4evr)] - Advanced mathematical functions (primes, number sequences, interpolate, calculate values of functions like Riemann zeta etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=102686 Advanced rounding (by Mat)] - Support for different measures of accuracy and 8 ways to resolve tie breaks.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83529 Big number (by eukalyptus)] - Make calculations with extremely large numbers that AutoIt normally is not able to support.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=106551 Decimal To fraction (by Malkey)] - Converts any decimal number to a fraction. Example: 1.2 to 6/5.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/319-eigen4autoit/ Eigen4AutoIt (by RFTC)] - Allows to perform fast matrix operations on large numerical data sets, and much more ....&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=140789 MathsEx UDF (by PhoenixXL)] - Functions for Carrying Out More Advanced Mathematical Calculations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81189 Number base conversion (by james3mg)] - From, to and between positive bases less than 63 (decimals supported).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=117156 NumToWord (by Mat)] - Convert numerals to a human readable string.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=108803 Polynomials (by Mat)] - Functions for using polynomials.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83091 Primes (by jennico)] - Many functions dealing with prime number generation and calculations.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94770 Roman Numerals (by AZJIO)] - Roman Numerals.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=98160 Root function (by Mat)] - Working out real roots of numbers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=209527 Stat (by AspirinJunkie)] - Statistics for Autoit.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163899 StringAPL (by minx)] - inline APL interpreter.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=82722 Trigonometric and math functions (by trancexx)] - _ATan2(), _Cosh(), _Frexp(), _Hypot(), _Ldexp(), _Logb(), _Sinh(), _Tanh().&lt;br /&gt;
&lt;br /&gt;
== Media ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=95357 FreeImage library (by ProgAndy)] - Various operations on images, such as rotate, resize, flip.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127263 HtmlHelp (by Geodetic)] - HtmlHelp functions for context-sensitive help from CHM (compiled HTML) files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116009 HyperCam (by seangriffin)] - HyperCam (Screen Recording) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=182535 HyCam2 (by willichan)] - Automation for HyCam2 screen recording utility.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50608 OCR (by ptrex)] - Real OCR in AU3 - MODI with MS Office 2003.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=89542 OCR (by seangriffin)] - Tesseract (Screen OCR) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=206133 OCRSpace (by MrKm)] - Convert Images to text with the OCRSpace API. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51054 Printer controller (by martin)] - Print text in any font, size and colour at any position on the page, draw lines, curves, elipses, pies in any colour, and print images.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=73993 Printing (by GRS)] - Printing from AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202621 QRCreator (by BugFix)] - Simple QR-code creation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161831 RTF_Printer (by mLipok)] - Printing RichEdit in the background.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=94834 Simple DirectMedia Layer (by AdmiralClaws)] - Adds support for joysticks, CDs, 2D graphics, timers. See [https://www.libsdl.org/ SDL website] for more information.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=207324 UWPOCR (by Danyfirex)] - Universal Windows Platform Optical Character Recognition API.&lt;br /&gt;
&lt;br /&gt;
===Graphics and image===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202987 AutoYolo3 (by smartee)] - Real-Time Object Detection using YOLOv3 wrapper.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113881 au3Irrlicht2 (by JRowe)] - Combining Irrlicht and AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=86748 AVI writing udf (by monoceres)] - Create uncompressed avi&#039;s from bitmap files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27362 Bitmap Library (by evilertoaster)] - Bitmap Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=202663 GIF animation (by Nine)] - Fast cached GIF animation.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150231 GTK+  (by prazetto)] - GTK+ Framework | Widgets.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=13096 ImageGetInfo (by Lazycat)] - Read info from JPEG, TIFF, BMP, PNG and GIF - size, color depth, resolution.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/471-image-search-udf Image Search (by VIP)] - Search for an image on the desktop. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70506 IrrLicht (by A. Percy)] - A 3D graphics engine suitable for creating games.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160732 OpenCV (by myliseJ)] - UDF for the OpenCV library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=206432 OpenCV v4+ (by smbape)] - OpenCV UDF with support for OpenCV v4+.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=151011 OpenGL (by LarsJ)] - OpenGL without external libraries etc. For JPEG files it also retrieves various Exif information.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=148129 OpenGL (2.0) (by minx)] - New set of UDFs for OpenGL + AutoIt.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=152950 S3D (by Starg)] - Draw simple 3D graphics with GDI+.&lt;br /&gt;
&lt;br /&gt;
===Players===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114143 VLC (by seangriffin)] - VLC (Media Player) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=91316 VLC Media Player (by ptrex)] - VLC Media Player.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=27352 WMP (by ConsultingJoe)] - Windows Media Player UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=44008 WMP - Media Controls (by CFire)] - Another Windows Media Player UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=203154 WMP - GUI Control (by SudeepJD)] - IE based WMP Control.&lt;br /&gt;
&lt;br /&gt;
===Sound===&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83481 BASS Function Library (by BrettF)] - Sound and Music via wrappers for Bass, BassEnc, Bass FX, BassSFX, BassAsio and BassCd DLLs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173808 libZPlay (by Danyfirex)] - Multimedia library for playing mp3, mp2, mp1, ogg, flac, ac3, aac, oga, wav and pcm files and streams.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=37072 MIDI (by eynstyne)] - MIDI UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=208116 MIDI (by MattyD)] - Wrap of the Windows MIDI functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114742 SAPIListBox (by seangriffin)] - SAPIListBox (Speech Recognition) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=100439 TTS (by Beege)] - Text-to-Speech UDF.&lt;br /&gt;
&lt;br /&gt;
== PDF ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162195 Acrobat Reader - ActiveX Viewer (by mLipok)] - Make your own PDF Viewer GUI with Acrobat Reader ActiveX COM Object &amp;quot;AcroPDF.PDF.1&amp;quot;.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164469 Debenu PDF Viewer SDK (by mLipok)] - A collection of functions to display PDF files in your applications using Debenu PDF Viewer SDK.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160875 Debenu Quick PDF Library (by mLipok)] - A collection of functions for Debenu Quick PDF Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75832 FoxIt Reader (by ptrex)] - PDF Reader in AU3.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=118827 MPDF (by taietel)] - Create PDF from your application.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=42776 PDFCreator (by ptrex)] - Automation of PDFCreator allows you to create and manipulate PDF files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170550 PDFCreator (by mLipok)] - UDF for PDFCreator v1.x.x with working EVENTs Handler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=32261 _StringToPDF (by Tam0r)] - Write a string to a PDF file and specify font size, type etc.&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145158 Firewall (by JLogan3o13)] - Control and manipulate the Windows Firewall (enable/disable, Exclusions list, enable/disable ports etc.).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=194015 Firewall policy2 (by Bilgus)]- Provides access to the firewall policy for Windows Vista+.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150819 VirusTotal (by Danyfirex)] - VirusTotal API 2.0 UDF.&lt;br /&gt;
&lt;br /&gt;
== Social Media and other Website API ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=159254 Cex.io (by AquilesCrespo)] - UDF script for using with the web api from https://cex.io/ server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169333 CrowdinAPI (by mLipok)] - Uses the [https://crowdin.com/page/api crowdin.net website API] for some functions (create projects, add and update files, download translations or integrate localization).&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/290-dropbox-authenticator/ Dropbox authenticator (by Gimerly)] - Dropbox authenticator.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158106 Easypost (by dcat127)] - Print USPS Postage Labels.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=114801 eBay (by seangriffin)] - eBay UDF (functions GetItemStatus and GetSingleItem from the &amp;quot;Shopping API&amp;quot;).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=141340 Gmail (by PhoenixXL)] - Remote Gmail (UDF).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=192422 Gmail API (by Ascer)] - Automate communication with Gmail using oAuth 2.0 security. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=98504 Google Functions (by Beege)] - Google Functions (Suggestions, Definitions, Translate, Convert).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=115437 Google Maps (by seangriffin)] - Google Maps UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=70675 iTunes (by torels)] - iTunes UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=101802 iTunes (by Beege)] - Another iTunes UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150985 No-IP (by Nessie)] - Simply update your no-ip hostname(s) and retrieve the ip address of an no-ip address.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=192391 oAuth (by Ascer)] - Open standard for access delegation, commonly used to grant websites or applications access to other websites.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=150838 PasteBin (by mrflibblehat)] - Pastebin UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121767 Skype (by FireFox)] - Skype4COM provides an ActiveX interface to the Skype API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113234 Teamspeak 3 (by chipDE)] - Teamspeak 3 UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186944 TeamViewer API (by mLipok)] - A collection of function for use with TeamViewer API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186381 Telegram Bot (by LinkOut)] - UDF for [https://core.telegram.org/api Telegram messenger API].&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=166547 TVmaze.com API (by BBs19)] - TVmaze.com API UDF (TV-Series).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=116600 Twitter (by seangriffin)] - Manage Twitter.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149247 Yahoo Weather (by Nessie)] - Yahoo Weather API.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=112775 Youtube Uploader (by BrettF)] - AYTU - AutoIt Youtube Uploader.&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50880 ACL (by ptrex)] - Set ACL on windows Objects.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=134508 ACL (by FredAl)] - Do most everything with the DACL and ownership on all types of objects: Files or folders, Registry keys, services, Kernel and WMI objects, etc.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=206400 BITS (by DonChunior)] - Background Intelligent Transfer Service to download files from or upload files to HTTP web servers and SMB file shares.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=184937 CertUtil (by mLipok)] - Wrapper for windows certutil.exe (command-line program that is installed in Windows as part of Certificate Services).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=113560 FileSystemMonitor (by seangriffin)] - Monitors the file system by recording all file system events occurring within a given path.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111018 ITaskBarList (by Beege)] - ITaskBarList UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=74118 Local account (by engine)] - Manage local accounts.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161193 Magnifier Functions (by Ascend4nt)] - Exposes most of the useful Magnifier API functions available since Windows Vista.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=75250 Registry (by engine)] - Windows Registry UDFs.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=50551 Registry (by seanhart)] - RegWriteAllUsers / RegDeleteAllUsers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=80201 Service (by arcker)] - Build your own service with AutoIt code.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=124508 Startup (by guinness)] - Create Startup entries in the Startup Folder or Registry.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164756 SCCM (by JLogan3o13)] - Systems Center Configuration Manager Library.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=134628 System restore (by FredAI)] - System restore UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186111 SubstWrapper (by mLipok)] - Wrapper for windows subst.exe command - (Associates a path with a drive letter).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=135994 Taskplanner/Taskscheduler COM (by Allow2010)] - an UDF for using the Windows Taskplaner / Task Scheduler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=83355 Task Scheduler (by dbzfanatic)] - Task Scheduler UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=200068 TaskScheduler (by water)] - Brushed up Task Scheduler UDF. Link to the [[TaskScheduler|documentation pages]].&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173934 TTS (by Kanashius)] - Used with SAPI Automation Object - text-to-speech (TTS) engine.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=158377 UAC (by AdamUL)] - User Account Control (UAC) UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=175719 Utter (by Surya)] - Utilizing more of SAPI (Speech Recognition UDF).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=127075 WIMGAPI (by Homes32)] - Manipulate Windows Image Files (.wim) without ImageX.exe.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=28436 Windows Events (by Emperor)] - Create your own Windows events.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=6487 Windows Service Control functions (by SumTingWong)] - Some limited functions to control services (create, start, stop, delete, check ...).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81880 Windows Services (by engine)] - Windows Services UDF.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163178 WRMF (by Luigi)] - WRMF - Windows Registry Monitor Call Function.&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&amp;lt;!-- Removed 2020-05-30 as adequate documentation is missing * [https://www.autoitscript.com/forum/topic/178871-dllcall-with-c-example/#comment-1285754 SMSApi (by mLipok)] - UDF for SMSAPi which provides SMS services. --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Removed 2020-05-30 as adequate documentation is missing * [https://www.autoitscript.com/forum/index.php?showtopic=178589 BulkSMS (by Skysnake)] - UDF for BulkSMS which provides SMS services. --&amp;gt;&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=145099 _AdlibEnhance (by JScript)] - Enhance Adlib to call functions with parameters, pause and resume.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=160936 Android (by Moriba)] - Control any Android device.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=97826 Animated tray icons (by Yashied)] - Make animated tray icons easily.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163577 Atom Table (by Ascend4nt)] - Store (add, find, delete, and query) strings locally (at program level) or globally (at OS level) with unique numerical identifiers.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170087 Barcode generators (by willichan)] - Creates a Code128A/B/C or Creates a Code39 or Code39Extended optimized barcode from supplied data.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=87735 BlockInputEx (by MrCreatoR)] - Supports a few features that built-in BlockInput() function does not.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=199762 BlockInputEx (by Nine)] - Block all input coming from mouse and/or keyboard, without having an UAC warning displayed. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=29763 Clipboard (by eltorro)] - When apps need to watch the clipboard.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=170630 ClipboardEx (by ozmike)] - Allows to have more than 1 item in the Clipboard. Handles all data types, not just text.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=81267 Clipboard History (by wraithdu)] - Save and restore the entire clipboard contents. Inspired by AHK&#039;s ClipboardAll.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=169610 CmdLine (by Jefrey)] - Collection of functions to parse command line arguments.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=126569 Console (by Shaggi)] - Functions and features to work wiht Console input/output.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=121833 Copy (by Yashied)] - Copy or move files and directories without suspending your script. Retrieve the current state (copied bytes, error code etc.) while copying.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=154684 Date / Time convert (by Melba23)] - Transform date/time formats.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=99106 _DLLStructDisplay (by Ascend4nt)] - Show Struct in ListView.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157689 _FileGetMimeType (by Wiliat87)] - Retrieve MIME types based on the extension of the filename/filepath/URL provided.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=117033 File locking with cooperative semaphores (by willichan)] - Simple file locking without a server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=157241 FindMimeFromData (by twbradio)] - FindMimeFromData using urlmon.dll.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=181997 Font Icon (by J2TeaM)] - Use Font Awesome in your AutoIt project.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=68422 HotString (by jvanegmond)] - Similar to the HotKey function but trigger on a string, instead of a key or key combination.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=173946 LASM - Light Assembler (by minxomat)] - Inline UDF for an Assembler.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=161628 LFN (by orbs)] - Overcome MAX_PATH limit of 256 chars.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111492 Link Grammar for AutoIt (by JRowe)] -  Input is a regular sentence in English, German or Italian, output is a pattern parsed from the structure of the sentence.&lt;br /&gt;
* [https://www.autoitscript.com/forum/files/file/147-mruau3 MRU (by Yashied)] - Most Recently Used (MRU) List Automation functions.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=186853 _Multiprocess (by jguinch)] - Run several external programs at the same time and retrieve the exit code of each process.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=188158 .NET Common Language Runtime (CLR) Framework (by Danyfirex, Junkew, Larsj, ptrex, Trancexx)] - Allows AutoIt to access .NET Class Libraries.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=101733 NoFocusLines (by Melba23)] - Remove the dotted focus lines from buttons, sliders, radios and checkboxes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=149176 NotifyIcon (by FireFox)] - Create, delete and manage self notify icons (formerly TrayIconEx). &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=63318 PixelGetColor (by Manadar)] - Get or Read Pixel from memory.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=167024 RDC (by Yashied)] - ReadDirectoryChanges Wrapper.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51103 Resources (by Zedna)] - Embed any binary data into your AutoIt compiled EXE files.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162499 ResourcesEx (by guinness)] - Up to date version of Zedna&#039;s Resources UDF. &lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=111215 Restart (by Yashied)] - Allows to restart a script from any location with full restoration of the original command line parameters.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=51547 SciLexer (by Kip)] - Editing control, supports multiple editors.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=152093 ScriptEditor (by pandel)] - ScriptEditor with I18N support and customizable lexer completely written in AutoIt (based on SciLexer).&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=162033 Spell Checker (by iCode)] - Spell Checker functions to call Hunspell, Hyphenate and MyThes.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=164444 Synology filestation (by nend)] - Functions to interact with a Synology NAS server.&lt;br /&gt;
* [https://www.autoitscript.com/forum/index.php?showtopic=163328 TimeConvert (by orbs)] - Convert UTC to/from local time, and/or reformat the string representation.&lt;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14838</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14838"/>
		<updated>2023-07-17T21:10:50Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* FAQ */ 1. How to connect to a running browser instance ++ Google Chrome&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 for FireFox] or [https://www.autoitscript.com/forum/topic/201537-webdriver-example-scripts-collection/page/2/#comment-1505978  this post for Google Chrome].&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: Use _WD_CapabilitiesDefine() function like int the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesDefine($_WD_CAPS_TYPES__SPECIFICVENDOR_ARRAY, &#039;NewCapabilityArray&#039;)&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-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 use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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-FAQ18&amp;quot;&amp;gt;18. How to troubleshoot when you can&#039;t locate the desired element using _WD_FindElement() ?&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-FAQ18&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
When you encounter a problem locating an item with _WD_FindElement() you should follow this procedure:&lt;br /&gt;
&lt;br /&gt;
WIP....&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) is valid&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find one or multiple instances of the element&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find element in different frame or if this is within #shadow-root&lt;br /&gt;
* use _WD_FrameList() to check if you have multiple even nested frames in website you are trying to automate&lt;br /&gt;
* use _WD_LocateElement() to check Element location within multiple even nested frames&lt;br /&gt;
* use _WD_FrameEnter() to change frame to be able to use _WD_FindElement() in order to find element within desired frame&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&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;
== 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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for Firefox], [https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof Save Page WE for Chrome])&lt;br /&gt;
* [https://github.com/openstyles/stylus Stylus]﻿ ﻿Stylus is a fork of Stylish for Chrome, also compatible with Firefox as a WebExtension&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/208633-webdriver-udf-w3c-compliant-version-20221003/ 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;
** [https://github.com/mlipok/Au3WebDriver-testing Au3WebDriver-testing - Some complex template for testing Au3WebDriver cases]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14837</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14837"/>
		<updated>2023-06-22T18:51:27Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* References */ added link to github: Au3WebDriver-testing&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: Use _WD_CapabilitiesDefine() function like int the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesDefine($_WD_CAPS_TYPES__SPECIFICVENDOR_ARRAY, &#039;NewCapabilityArray&#039;)&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-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 use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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-FAQ18&amp;quot;&amp;gt;18. How to troubleshoot when you can&#039;t locate the desired element using _WD_FindElement() ?&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-FAQ18&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
When you encounter a problem locating an item with _WD_FindElement() you should follow this procedure:&lt;br /&gt;
&lt;br /&gt;
WIP....&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) is valid&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find one or multiple instances of the element&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find element in different frame or if this is within #shadow-root&lt;br /&gt;
* use _WD_FrameList() to check if you have multiple even nested frames in website you are trying to automate&lt;br /&gt;
* use _WD_LocateElement() to check Element location within multiple even nested frames&lt;br /&gt;
* use _WD_FrameEnter() to change frame to be able to use _WD_FindElement() in order to find element within desired frame&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&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;
== 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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for Firefox], [https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof Save Page WE for Chrome])&lt;br /&gt;
* [https://github.com/openstyles/stylus Stylus]﻿ ﻿Stylus is a fork of Stylish for Chrome, also compatible with Firefox as a WebExtension&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/208633-webdriver-udf-w3c-compliant-version-20221003/ 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;
** [https://github.com/mlipok/Au3WebDriver-testing Au3WebDriver-testing - Some complex template for testing Au3WebDriver cases]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14836</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14836"/>
		<updated>2023-03-23T14:18:57Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* FAQ */ ..._WD_LocateElement()&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: Use _WD_CapabilitiesDefine() function like int the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesDefine($_WD_CAPS_TYPES__SPECIFICVENDOR_ARRAY, &#039;NewCapabilityArray&#039;)&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-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 use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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-FAQ18&amp;quot;&amp;gt;18. How to troubleshoot when you can&#039;t locate the desired element using _WD_FindElement() ?&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-FAQ18&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
When you encounter a problem locating an item with _WD_FindElement() you should follow this procedure:&lt;br /&gt;
&lt;br /&gt;
WIP....&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) is valid&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find one or multiple instances of the element&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find element in different frame or if this is within #shadow-root&lt;br /&gt;
* use _WD_FrameList() to check if you have multiple even nested frames in website you are trying to automate&lt;br /&gt;
* use _WD_LocateElement() to check Element location within multiple even nested frames&lt;br /&gt;
* use _WD_FrameEnter() to change frame to be able to use _WD_FindElement() in order to find element within desired frame&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&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;
== 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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for Firefox], [https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof Save Page WE for Chrome])&lt;br /&gt;
* [https://github.com/openstyles/stylus Stylus]﻿ ﻿Stylus is a fork of Stylish for Chrome, also compatible with Firefox as a WebExtension&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/208633-webdriver-udf-w3c-compliant-version-20221003/ 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;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14835</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14835"/>
		<updated>2023-03-23T14:17:27Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* FAQ */ 18. How to troubleshoot when you can&amp;#039;t locate the desired element using _WD_FindElement() ?&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: Use _WD_CapabilitiesDefine() function like int the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesDefine($_WD_CAPS_TYPES__SPECIFICVENDOR_ARRAY, &#039;NewCapabilityArray&#039;)&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-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 use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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-FAQ18&amp;quot;&amp;gt;18. How to troubleshoot when you can&#039;t locate the desired element using _WD_FindElement() ?&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-FAQ18&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
When you encounter a problem locating an item with _WD_FindElement() you should follow this procedure:&lt;br /&gt;
&lt;br /&gt;
WIP....&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) is valid&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find one or multiple instances of the element&lt;br /&gt;
* check in your browser if your locator (XPATH , CSSSelector) find element in different frame or if this is within #shadow-root&lt;br /&gt;
* use _WD_FrameList() to check if you have multiple even nested frames in website you are trying to automate&lt;br /&gt;
* use _WD_LocateElement() to check Element within multiple even nested frames&lt;br /&gt;
* use _WD_FrameEnter() to change frame to be able to use _WD_FindElement() in order to find element within desired frame&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&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;
== 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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for Firefox], [https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof Save Page WE for Chrome])&lt;br /&gt;
* [https://github.com/openstyles/stylus Stylus]﻿ ﻿Stylus is a fork of Stylish for Chrome, also compatible with Firefox as a WebExtension&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/208633-webdriver-udf-w3c-compliant-version-20221003/ 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;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14834</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14834"/>
		<updated>2023-03-23T14:10:46Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* FAQ */  17. How to troubleshoot  &amp;gt;&amp;gt; 18. How to troubleshoot&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: Use _WD_CapabilitiesDefine() function like int the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesDefine($_WD_CAPS_TYPES__SPECIFICVENDOR_ARRAY, &#039;NewCapabilityArray&#039;)&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-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 use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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-FAQ18&amp;quot;&amp;gt;18. How to troubleshoot when you can&#039;t locate the desired element using _WD_FindElement() ?&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-FAQ18&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
When you encounter a problem locating an item with _WD_FindElement() you should follow this procedure:&lt;br /&gt;
&lt;br /&gt;
WIP....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&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;
== 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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for Firefox], [https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof Save Page WE for Chrome])&lt;br /&gt;
* [https://github.com/openstyles/stylus Stylus]﻿ ﻿Stylus is a fork of Stylish for Chrome, also compatible with Firefox as a WebExtension&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/208633-webdriver-udf-w3c-compliant-version-20221003/ 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;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14833</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14833"/>
		<updated>2023-03-23T14:09:39Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* 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: 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: Use _WD_CapabilitiesDefine() function like int the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesDefine($_WD_CAPS_TYPES__SPECIFICVENDOR_ARRAY, &#039;NewCapabilityArray&#039;)&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-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 troubleshoot when you can&#039;t locate the desired element using _WD_FindElement() ?&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;
When you encounter a problem locating an item with _WD_FindElement() you should follow this procedure:&lt;br /&gt;
&lt;br /&gt;
WIP....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&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 use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for Firefox], [https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof Save Page WE for Chrome])&lt;br /&gt;
* [https://github.com/openstyles/stylus Stylus]﻿ ﻿Stylus is a fork of Stylish for Chrome, also compatible with Firefox as a WebExtension&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/208633-webdriver-udf-w3c-compliant-version-20221003/ 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;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14832</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14832"/>
		<updated>2023-03-23T14:09:03Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* FAQ */ 17. How to troubleshoot when you can&amp;#039;t locate the desired element using _WD_FindElement() ?&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: Use _WD_CapabilitiesDefine() function like int the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesDefine($_WD_CAPS_TYPES__SPECIFICVENDOR_ARRAY, &#039;NewCapabilityArray&#039;)&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-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;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ17&amp;quot;&amp;gt;17. How to troubleshoot when you can&#039;t locate the desired element using _WD_FindElement() ?&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;
When you encounter a problem locating an item with _WD_FindElement() you should follow this procedure:&lt;br /&gt;
&lt;br /&gt;
WIP....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&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;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;usermessage mw-customtoggle-FAQ17&amp;quot;&amp;gt;17. How to use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for Firefox], [https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof Save Page WE for Chrome])&lt;br /&gt;
* [https://github.com/openstyles/stylus Stylus]﻿ ﻿Stylus is a fork of Stylish for Chrome, also compatible with Firefox as a WebExtension&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/208633-webdriver-udf-w3c-compliant-version-20221003/ 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;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14830</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14830"/>
		<updated>2023-02-19T23:43:06Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Tools */ ++Stylus&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: Use _WD_CapabilitiesDefine() function like int the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesDefine($_WD_CAPS_TYPES__SPECIFICVENDOR_ARRAY, &#039;NewCapabilityArray&#039;)&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-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 use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for Firefox], [https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof Save Page WE for Chrome])&lt;br /&gt;
* [https://github.com/openstyles/stylus Stylus]﻿ ﻿Stylus is a fork of Stylish for Chrome, also compatible with Firefox as a WebExtension&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/208633-webdriver-udf-w3c-compliant-version-20221003/ 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;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14829</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14829"/>
		<updated>2023-02-18T18:52:30Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* FAQ */ 14. How to add browser/specific/vendor options to capabilities?&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: Use _WD_CapabilitiesDefine() function like int the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesDefine($_WD_CAPS_TYPES__SPECIFICVENDOR_ARRAY, &#039;NewCapabilityArray&#039;)&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-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 use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for 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/208633-webdriver-udf-w3c-compliant-version-20221003/ 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;br /&gt;
[[Category:UDF]]&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14808</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14808"/>
		<updated>2022-12-26T20:36:46Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* References */ WebDriver UDF (W3C compliant version) link fixed&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 use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for 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/208633-webdriver-udf-w3c-compliant-version-20221003/ 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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14807</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14807"/>
		<updated>2022-10-31T11:20:34Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* FAQ */ 17. How to use devtools in browsers?&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 use devtools in browsers?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for 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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14806</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14806"/>
		<updated>2022-10-31T11:19:33Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* FAQ */ 17. How to use inspecting 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: 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 use inspecting tools?&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;
** [https://www.youtube.com/watch?v=Me9hjqd74m8&amp;amp;t=58s YouTube video: How to work with frames in Firefox?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=TUpsyv9A9vU YouTube video: Inspecting a webpage&#039;s HTML using Developer Tools in Google Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=1l4xz1QQhew YouTube video: How to use Google Chrome Inspect Element tool]&lt;br /&gt;
** [https://www.youtube.com/watch?v=NRn70H8XOZc YouTube video: A Fun Way to Use the Inspect Tool in Chrome]&lt;br /&gt;
** [https://www.youtube.com/watch?v=f5pTCMPomuA YouTube video: How to use Inspect Element on disappearing items (hidden content) - Google Chrome Browser?]&lt;br /&gt;
** [https://www.youtube.com/watch?v=WfKG9C00giI YouTube video: How to Use the Google Chrome Inspect Tool]&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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for 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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14805</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14805"/>
		<updated>2022-10-31T10:53:17Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Tools */ Save Page WE URL&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 ([https://addons.mozilla.org/pl/firefox/addon/save-page-we Save Page WE for 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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14802</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14802"/>
		<updated>2022-09-14T11:04:13Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Translate IE UDF to WebDriver */ _IEFrameGetCollection &amp;gt; _WD_FrameList&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 another browser 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 on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || $__WDVERSION || &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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14801</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14801"/>
		<updated>2022-09-14T11:00:02Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Translate IE UDF to WebDriver */ _IEFormElementGetValue &amp;gt; _WD_ElementAction fixed&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 another browser 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_FindElement + _WD_FrameEnter || You are not able to get all Frames at once.&lt;br /&gt;
You must get all that are available in current document context, then go to each frame and find all sub frames.&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 on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || $__WDVERSION || &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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14797</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14797"/>
		<updated>2022-08-10T08:15:53Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* References */ WebDriver UDF - Help &amp;amp; Support (III)&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 another browser 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_ElementSelectAction || _WD_FindElement + _WD_ElementSelectAction($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_FindElement + _WD_FrameEnter || You are not able to get all Frames at once.&lt;br /&gt;
You must get all that are available in current document context, then go to each frame and find all sub frames.&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 on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || $__WDVERSION || &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 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 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;excludeSwitches&amp;quot;, &amp;quot;enable-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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14796</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14796"/>
		<updated>2022-08-08T07:49:52Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Translate IE UDF to WebDriver */ _IEErrorNotify&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 another browser 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_ElementSelectAction || _WD_FindElement + _WD_ElementSelectAction($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_FindElement + _WD_FrameEnter || You are not able to get all Frames at once.&lt;br /&gt;
You must get all that are available in current document context, then go to each frame and find all sub frames.&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 on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || $__WDVERSION || &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 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 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;excludeSwitches&amp;quot;, &amp;quot;enable-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/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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14795</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14795"/>
		<updated>2022-08-08T07:47:02Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Translate IE UDF to WebDriver */ _IEDocWriteHTML&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 another browser 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 || || &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_ElementSelectAction || _WD_FindElement + _WD_ElementSelectAction($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_FindElement + _WD_FrameEnter || You are not able to get all Frames at once.&lt;br /&gt;
You must get all that are available in current document context, then go to each frame and find all sub frames.&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 on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || $__WDVERSION || &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 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 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;excludeSwitches&amp;quot;, &amp;quot;enable-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/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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14794</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14794"/>
		<updated>2022-08-08T07:40:50Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Translate IE UDF to WebDriver */ _IEBodyWriteHTML&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 another browser 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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEErrorNotify || || &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_ElementSelectAction || _WD_FindElement + _WD_ElementSelectAction($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_FindElement + _WD_FrameEnter || You are not able to get all Frames at once.&lt;br /&gt;
You must get all that are available in current document context, then go to each frame and find all sub frames.&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 on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || $__WDVERSION || &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 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 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;excludeSwitches&amp;quot;, &amp;quot;enable-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/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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14793</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14793"/>
		<updated>2022-08-08T07:39:20Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Translate IE UDF to WebDriver */ _IEBodyReadText&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 another browser 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 || || &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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEErrorNotify || || &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_ElementSelectAction || _WD_FindElement + _WD_ElementSelectAction($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_FindElement + _WD_FrameEnter || You are not able to get all Frames at once.&lt;br /&gt;
You must get all that are available in current document context, then go to each frame and find all sub frames.&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 on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || $__WDVERSION || &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 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 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;excludeSwitches&amp;quot;, &amp;quot;enable-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/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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14792</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14792"/>
		<updated>2022-08-08T07:38:34Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Translate IE UDF to WebDriver */ _IEBodyReadText&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 another browser 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 || Local $sText = _WD_ExecuteScript($sSession, &#039;return document.body.innerText&#039;,Default,Default, $_WD_JSON_Value) || &lt;br /&gt;
|-&lt;br /&gt;
| _IEBodyWriteHTML || || &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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEErrorNotify || || &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_ElementSelectAction || _WD_FindElement + _WD_ElementSelectAction($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_FindElement + _WD_FrameEnter || You are not able to get all Frames at once.&lt;br /&gt;
You must get all that are available in current document context, then go to each frame and find all sub frames.&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 on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || $__WDVERSION || &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 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 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;excludeSwitches&amp;quot;, &amp;quot;enable-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/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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14787</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14787"/>
		<updated>2022-07-21T13:51:30Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* FAQ */  How to work with frames in Firefox?&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;
; 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 another browser 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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEBodyWriteHTML || || &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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEErrorNotify || || &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_ElementSelectAction || _WD_FindElement + _WD_ElementSelectAction($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_FindElement + _WD_FrameEnter || You are not able to get all Frames at once.&lt;br /&gt;
You must get all that are available in current document context, then go to each frame and find all sub frames.&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 on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || $__WDVERSION || &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 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 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;excludeSwitches&amp;quot;, &amp;quot;enable-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/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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14782</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14782"/>
		<updated>2022-06-10T07:30:29Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* 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: 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;
; 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 another browser 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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEBodyWriteHTML || || &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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEErrorNotify || || &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_ElementSelectAction || _WD_FindElement + _WD_ElementSelectAction($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_FindElement + _WD_FrameEnter || You are not able to get all Frames at once.&lt;br /&gt;
You must get all that are available in current document context, then go to each frame and find all sub frames.&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 on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || $__WDVERSION || &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 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 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;excludeSwitches&amp;quot;, &amp;quot;enable-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;
== 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/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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14781</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14781"/>
		<updated>2022-06-10T07:29:49Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* FAQ */ Locator strategies - selenium 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: 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;
; 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 another browser 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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEBodyWriteHTML || || &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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEErrorNotify || || &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_ElementSelectAction || _WD_FindElement + _WD_ElementSelectAction($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_FindElement + _WD_FrameEnter || You are not able to get all Frames at once.&lt;br /&gt;
You must get all that are available in current document context, then go to each frame and find all sub frames.&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 on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || $__WDVERSION || &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]&lt;br /&gt;
A: Take a look on this link: [https://www.selenium.dev/documentation/webdriver/elements/locators/ Locator strategies]&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?]&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 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 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;excludeSwitches&amp;quot;, &amp;quot;enable-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;
== 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/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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14780</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14780"/>
		<updated>2022-06-08T11:24:35Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* FAQ */ How can I check XPath and CSSSelector in the Browser?&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;
; 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 another browser 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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEBodyWriteHTML || || &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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEErrorNotify || || &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_ElementSelectAction || _WD_FindElement + _WD_ElementSelectAction($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_FindElement + _WD_FrameEnter || You are not able to get all Frames at once.&lt;br /&gt;
You must get all that are available in current document context, then go to each frame and find all sub frames.&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 on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || $__WDVERSION || &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]&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?]&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 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 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;excludeSwitches&amp;quot;, &amp;quot;enable-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;
== 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/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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14778</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14778"/>
		<updated>2022-06-03T16:11:01Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* FAQ */ 12. How to download PDF file automatically? - suplemented&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;
; 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 another browser 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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEBodyWriteHTML || || &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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEErrorNotify || || &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_ElementSelectAction || _WD_FindElement + _WD_ElementSelectAction($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_FindElement + _WD_FrameEnter || You are not able to get all Frames at once.&lt;br /&gt;
You must get all that are available in current document context, then go to each frame and find all sub frames.&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 on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || $__WDVERSION || &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://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?]&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 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 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;excludeSwitches&amp;quot;, &amp;quot;enable-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;
== 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/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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14777</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14777"/>
		<updated>2022-06-03T16:08:31Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* FAQ */ 16. How to disable logging into webdriver console?&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;
; 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 another browser 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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEBodyWriteHTML || || &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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEErrorNotify || || &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_ElementSelectAction || _WD_FindElement + _WD_ElementSelectAction($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_FindElement + _WD_FrameEnter || You are not able to get all Frames at once.&lt;br /&gt;
You must get all that are available in current document context, then go to each frame and find all sub frames.&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 on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || $__WDVERSION || &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://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?]&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;
&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 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 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;excludeSwitches&amp;quot;, &amp;quot;enable-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;
== 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/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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14776</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14776"/>
		<updated>2022-05-31T22:26:58Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* 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: 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;
; 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 another browser 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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEBodyWriteHTML || || &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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEErrorNotify || || &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_ElementSelectAction || _WD_FindElement + _WD_ElementSelectAction($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_FindElement + _WD_FrameEnter || You are not able to get all Frames at once.&lt;br /&gt;
You must get all that are available in current document context, then go to each frame and find all sub frames.&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 on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || $__WDVERSION || &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://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?]&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;
&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;
== 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/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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14775</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14775"/>
		<updated>2022-05-31T22:26:21Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Tools */ Save Page WE&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;
; 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 another browser 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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEBodyWriteHTML || || &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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEErrorNotify || || &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_ElementSelectAction || _WD_FindElement + _WD_ElementSelectAction($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_FindElement + _WD_FrameEnter || You are not able to get all Frames at once.&lt;br /&gt;
You must get all that are available in current document context, then go to each frame and find all sub frames.&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 on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || $__WDVERSION || &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://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?]&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;
&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;
== 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 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/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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14774</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14774"/>
		<updated>2022-05-31T22:25:25Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Tools */ Save Page WE&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;
; 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 another browser 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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEBodyWriteHTML || || &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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEErrorNotify || || &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_ElementSelectAction || _WD_FindElement + _WD_ElementSelectAction($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_FindElement + _WD_FrameEnter || You are not able to get all Frames at once.&lt;br /&gt;
You must get all that are available in current document context, then go to each frame and find all sub frames.&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 on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || $__WDVERSION || &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://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?]&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;
&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;
== 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/] plugin: helps to save web page content as single MHTML file (Firefox, [https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof 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/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>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver_Capabilities&amp;diff=14770</id>
		<title>WebDriver Capabilities</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver_Capabilities&amp;diff=14770"/>
		<updated>2022-04-09T23:17:40Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Additional sources of information */ URL added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WIP}}&lt;br /&gt;
&lt;br /&gt;
= WebDriver Capabilities =&lt;br /&gt;
What are Capabilities?&amp;lt;p&amp;gt;&lt;br /&gt;
A good description can be found [https://www.selenium.dev/documentation/legacy/desired_capabilities/ ]:&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Not all server implementations will support every WebDriver feature. Therefore, the client and server should use JSON objects with the properties listed below when describing which features a user requests that a session support. If a session cannot support a capability that is requested in the desired capabilities, no error is thrown; a read-only capabilities object is returned that indicates the capabilities the session actually supports.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Capabilities are options that you can use to customize and configure a Browser session&lt;br /&gt;
* The capabilities you want to set are passed as a formatted string to function _WD_CreateSession&lt;br /&gt;
* The WebDriver UDF uses the Capabilities class to pass the capabilities string to the WebDriver exe file&lt;br /&gt;
* Format and content of the capabilities string differ from Browser to Browser&lt;br /&gt;
* Some capabilities are read-only, some are read-write&lt;br /&gt;
* There are [https://www.w3.org/TR/webdriver/#capabilities standard capabilities] each implementation must support. An implementation may define additional extension capabilities&lt;br /&gt;
* Some capabilities are [https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities#legacy_capabilities deprecated] and should be avoided.&lt;br /&gt;
&lt;br /&gt;
== Chrome related documentations ==&lt;br /&gt;
Link to the [https://chromedriver.chromium.org/capabilities Documentation of Capabilities for Chrome].&lt;br /&gt;
&lt;br /&gt;
Link to the [https://peter.sh/experiments/chromium-command-line-switches/ List of Chromium Command Line Switches].&lt;br /&gt;
&lt;br /&gt;
== Firefox related documentations ==&lt;br /&gt;
Link to the [https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities/firefoxOptions Documentation of Capabilities for Firefox].&lt;br /&gt;
&lt;br /&gt;
== Edge related documentations ==&lt;br /&gt;
Link to the [https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium/capabilities-edge-options Documentation of Capabilities for Edge].&lt;br /&gt;
&lt;br /&gt;
== Desired/Required capabilities ==&lt;br /&gt;
In many sources there are names such as: &#039;&#039;&#039;desiredCapabilities&#039;&#039;&#039; and &#039;&#039;&#039;requiredCapabilities&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
These are old nomenclatures for old solutions.&lt;br /&gt;
&lt;br /&gt;
`[https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities#legacy_capabilities Some drivers support these legacy capabilities, but they are deprecated and should be avoided.]`&lt;br /&gt;
&lt;br /&gt;
Currently &#039;&#039;&#039;Capabilities&#039;&#039;&#039; should be used.&lt;br /&gt;
&lt;br /&gt;
For more details take a look on:&lt;br /&gt;
 * [https://www.selenium.dev/documentation/legacy/desired_capabilities/ Legacy Selenium Desired Capabilities].&lt;br /&gt;
 * [https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities#legacy_capabilities Legacy capabilities]&lt;br /&gt;
&lt;br /&gt;
= WD_Capabilities UDF =&lt;br /&gt;
Creating a correct Capabilities string can become quite complex. Debugging problems as well.&amp;lt;br&amp;gt;&lt;br /&gt;
That&#039;s why the WD_Capabilities.au3 UDF has been created. It makes sure the created Capabilities string is perfectly formatted all the time.&lt;br /&gt;
The WD_Capabilities.au3 UDF is part of [https://github.com/Danp2/WebDriver AutoIt WebDriver sets of UDF].&lt;br /&gt;
&lt;br /&gt;
== Chrome Examples ==&lt;br /&gt;
To get the following Capabilities string&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;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;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
you have to call this sequence of functions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesStartup()&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;, &amp;quot;chrome&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;w3c&amp;quot;, True)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;excludeSwitches&amp;quot;, &amp;quot;enable-automation&amp;quot;)&lt;br /&gt;
Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Firefox Examples ==&lt;br /&gt;
To get the following Capabilities string&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $sCapabilities = &#039;{&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}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
you have to call this sequence of functions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesStartup()&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;, &amp;quot;firefox&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;browserName&amp;quot;, &amp;quot;firefox&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;acceptInsecureCerts&amp;quot;, True)&lt;br /&gt;
Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Edge Examples ==&lt;br /&gt;
To get the following Capabilities string&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $sCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;ms:edgeOptions&amp;quot;: {&amp;quot;excludeSwitches&amp;quot;: [ &amp;quot;enable-automation&amp;quot;]}}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
you have to call this sequence of functions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesStartup()&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;, &amp;quot;edge&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;excludeSwitches&amp;quot;, &amp;quot;enable-automation&amp;quot;)&lt;br /&gt;
Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== A complete working example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;wd_capabilities.au3&amp;quot;&lt;br /&gt;
#include &amp;quot;wd_helper.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
_Example_UsingCapabilitesWithChrome()&lt;br /&gt;
If @error Then 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; : Error launching browser&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
Func _Example_UsingCapabilitesWithChrome()&lt;br /&gt;
	#Region - creating capabilities string&lt;br /&gt;
	; startup - cleaning internal capabilities JSON object&lt;br /&gt;
	_WD_CapabilitiesStartup()&lt;br /&gt;
	; starting with &amp;quot;alwaysMatch&amp;quot; settings&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;)&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;acceptInsecureCerts&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
	; switching to &amp;quot;firstMatch&amp;quot; with &amp;quot;chrome&amp;quot; which will specify to use &amp;quot;goog:chromeOptions&amp;quot;&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;firstMatch&amp;quot;, &amp;quot;chrome&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; setting vendor specific &amp;quot;goog:chromeOptions&amp;quot; settings&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;w3c&amp;quot;, True)&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;prefs&amp;quot;, &amp;quot;download.default_directory&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\Downloads&amp;quot;)&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;excludeSwitches&amp;quot;, &amp;quot;enable-automation&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; dump Capabilities string to Console - reason: only to check how it looks&lt;br /&gt;
	_WD_CapabilitiesDump(@ScriptLineNumber &amp;amp; &amp;quot; Testing&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; get/assign Capabilities JSON Object content to string&lt;br /&gt;
	Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
	#EndRegion - creating capabilities string&lt;br /&gt;
&lt;br /&gt;
	; setting WebDriver options&lt;br /&gt;
	_WD_Option(&amp;quot;Driver&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\chromedriver.exe&amp;quot;)&lt;br /&gt;
	_WD_Option(&amp;quot;Port&amp;quot;, 9515)&lt;br /&gt;
	_WD_Option(&amp;quot;DefaultTimeout&amp;quot;, 1000)&lt;br /&gt;
	_WD_Option(&amp;quot;DriverParams&amp;quot;, &amp;quot;--log-path=&amp;quot; &amp;amp; Chr(34) &amp;amp; @ScriptDir &amp;amp; &amp;quot;\WebDriver_Testing.log&amp;quot; &amp;amp; Chr(34))&lt;br /&gt;
&lt;br /&gt;
	; starting WebDriver with specified options&lt;br /&gt;
	_WD_Startup()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, &amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; trying to create Session - connecting to WebDriver with specified capabilities&lt;br /&gt;
	Local $WD_SESSION = _WD_CreateSession($sCapabilities)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, $WD_SESSION)&lt;br /&gt;
&lt;br /&gt;
	; this MsgBox is placed here only to have possibility to manually check if all is fine with Chrome instance&lt;br /&gt;
	If Not @Compiled Then MsgBox($MB_OK + $MB_TOPMOST + $MB_ICONINFORMATION, &amp;quot;Information #&amp;quot; &amp;amp; @ScriptLineNumber, &amp;quot;Waiting before _WD_Shutdown()&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; delete/close session - disconnecting AutoIt script from running WebDriver process&lt;br /&gt;
	_WD_DeleteSession($WD_SESSION)&lt;br /&gt;
&lt;br /&gt;
	; close WebDriver process&lt;br /&gt;
	_WD_Shutdown()&lt;br /&gt;
EndFunc   ;==&amp;gt;_Example_UsingCapabilitesWithChrome&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example generates and uses Capabilities string as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;capabilities&amp;quot;:{&lt;br /&gt;
        &amp;quot;alwaysMatch&amp;quot;:{&lt;br /&gt;
            &amp;quot;acceptInsecureCerts&amp;quot;:true&lt;br /&gt;
        },&lt;br /&gt;
        &amp;quot;firstMatch&amp;quot;:[&lt;br /&gt;
            {&lt;br /&gt;
                &amp;quot;goog:chromeOptions&amp;quot;:{&lt;br /&gt;
                    &amp;quot;w3c&amp;quot;:true,&lt;br /&gt;
                    &amp;quot;prefs&amp;quot;:{&lt;br /&gt;
                        &amp;quot;download.default_directory&amp;quot;:&amp;quot;C:\\Testing\\WD_Download&amp;quot;&lt;br /&gt;
                    },&lt;br /&gt;
                    &amp;quot;excludeSwitches&amp;quot;:[&lt;br /&gt;
                        &amp;quot;enable-automation&amp;quot;&lt;br /&gt;
                    ]&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        ]&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional sources of information =&lt;br /&gt;
For Additional sources of information take a look on this following links:&lt;br /&gt;
&lt;br /&gt;
* https://w3c.github.io/webdriver/#capabilities&lt;br /&gt;
* https://github.com/Danp2/au3WebDriver/blob/master/wd_capabilities.au3&lt;br /&gt;
* https://docs.yugabyte.com/preview/api/ysql/datatypes/type_json/primitive-and-compound-data-types&lt;br /&gt;
* https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities&lt;br /&gt;
* https://chromedriver.chromium.org/capabilities&lt;br /&gt;
* https://www.selenium.dev/documentation/webdriver/capabilities/shared/&lt;br /&gt;
* https://www.selenium.dev/documentation/webdriver/capabilities/internet_explorer/&lt;br /&gt;
* https://github.com/SeleniumHQ/seleniumhq.github.io/tree/dev/website_and_docs/content/documentation/webdriver/capabilities&lt;br /&gt;
*&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver_Capabilities&amp;diff=14769</id>
		<title>WebDriver Capabilities</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver_Capabilities&amp;diff=14769"/>
		<updated>2022-04-09T23:16:42Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Additional sources of information */ recursion&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WIP}}&lt;br /&gt;
&lt;br /&gt;
= WebDriver Capabilities =&lt;br /&gt;
What are Capabilities?&amp;lt;p&amp;gt;&lt;br /&gt;
A good description can be found [https://www.selenium.dev/documentation/legacy/desired_capabilities/ ]:&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Not all server implementations will support every WebDriver feature. Therefore, the client and server should use JSON objects with the properties listed below when describing which features a user requests that a session support. If a session cannot support a capability that is requested in the desired capabilities, no error is thrown; a read-only capabilities object is returned that indicates the capabilities the session actually supports.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Capabilities are options that you can use to customize and configure a Browser session&lt;br /&gt;
* The capabilities you want to set are passed as a formatted string to function _WD_CreateSession&lt;br /&gt;
* The WebDriver UDF uses the Capabilities class to pass the capabilities string to the WebDriver exe file&lt;br /&gt;
* Format and content of the capabilities string differ from Browser to Browser&lt;br /&gt;
* Some capabilities are read-only, some are read-write&lt;br /&gt;
* There are [https://www.w3.org/TR/webdriver/#capabilities standard capabilities] each implementation must support. An implementation may define additional extension capabilities&lt;br /&gt;
* Some capabilities are [https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities#legacy_capabilities deprecated] and should be avoided.&lt;br /&gt;
&lt;br /&gt;
== Chrome related documentations ==&lt;br /&gt;
Link to the [https://chromedriver.chromium.org/capabilities Documentation of Capabilities for Chrome].&lt;br /&gt;
&lt;br /&gt;
Link to the [https://peter.sh/experiments/chromium-command-line-switches/ List of Chromium Command Line Switches].&lt;br /&gt;
&lt;br /&gt;
== Firefox related documentations ==&lt;br /&gt;
Link to the [https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities/firefoxOptions Documentation of Capabilities for Firefox].&lt;br /&gt;
&lt;br /&gt;
== Edge related documentations ==&lt;br /&gt;
Link to the [https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium/capabilities-edge-options Documentation of Capabilities for Edge].&lt;br /&gt;
&lt;br /&gt;
== Desired/Required capabilities ==&lt;br /&gt;
In many sources there are names such as: &#039;&#039;&#039;desiredCapabilities&#039;&#039;&#039; and &#039;&#039;&#039;requiredCapabilities&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
These are old nomenclatures for old solutions.&lt;br /&gt;
&lt;br /&gt;
`[https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities#legacy_capabilities Some drivers support these legacy capabilities, but they are deprecated and should be avoided.]`&lt;br /&gt;
&lt;br /&gt;
Currently &#039;&#039;&#039;Capabilities&#039;&#039;&#039; should be used.&lt;br /&gt;
&lt;br /&gt;
For more details take a look on:&lt;br /&gt;
 * [https://www.selenium.dev/documentation/legacy/desired_capabilities/ Legacy Selenium Desired Capabilities].&lt;br /&gt;
 * [https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities#legacy_capabilities Legacy capabilities]&lt;br /&gt;
&lt;br /&gt;
= WD_Capabilities UDF =&lt;br /&gt;
Creating a correct Capabilities string can become quite complex. Debugging problems as well.&amp;lt;br&amp;gt;&lt;br /&gt;
That&#039;s why the WD_Capabilities.au3 UDF has been created. It makes sure the created Capabilities string is perfectly formatted all the time.&lt;br /&gt;
The WD_Capabilities.au3 UDF is part of [https://github.com/Danp2/WebDriver AutoIt WebDriver sets of UDF].&lt;br /&gt;
&lt;br /&gt;
== Chrome Examples ==&lt;br /&gt;
To get the following Capabilities string&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;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;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
you have to call this sequence of functions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesStartup()&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;, &amp;quot;chrome&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;w3c&amp;quot;, True)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;excludeSwitches&amp;quot;, &amp;quot;enable-automation&amp;quot;)&lt;br /&gt;
Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Firefox Examples ==&lt;br /&gt;
To get the following Capabilities string&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $sCapabilities = &#039;{&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}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
you have to call this sequence of functions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesStartup()&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;, &amp;quot;firefox&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;browserName&amp;quot;, &amp;quot;firefox&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;acceptInsecureCerts&amp;quot;, True)&lt;br /&gt;
Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Edge Examples ==&lt;br /&gt;
To get the following Capabilities string&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $sCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;ms:edgeOptions&amp;quot;: {&amp;quot;excludeSwitches&amp;quot;: [ &amp;quot;enable-automation&amp;quot;]}}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
you have to call this sequence of functions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesStartup()&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;, &amp;quot;edge&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;excludeSwitches&amp;quot;, &amp;quot;enable-automation&amp;quot;)&lt;br /&gt;
Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== A complete working example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;wd_capabilities.au3&amp;quot;&lt;br /&gt;
#include &amp;quot;wd_helper.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
_Example_UsingCapabilitesWithChrome()&lt;br /&gt;
If @error Then 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; : Error launching browser&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
Func _Example_UsingCapabilitesWithChrome()&lt;br /&gt;
	#Region - creating capabilities string&lt;br /&gt;
	; startup - cleaning internal capabilities JSON object&lt;br /&gt;
	_WD_CapabilitiesStartup()&lt;br /&gt;
	; starting with &amp;quot;alwaysMatch&amp;quot; settings&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;)&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;acceptInsecureCerts&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
	; switching to &amp;quot;firstMatch&amp;quot; with &amp;quot;chrome&amp;quot; which will specify to use &amp;quot;goog:chromeOptions&amp;quot;&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;firstMatch&amp;quot;, &amp;quot;chrome&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; setting vendor specific &amp;quot;goog:chromeOptions&amp;quot; settings&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;w3c&amp;quot;, True)&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;prefs&amp;quot;, &amp;quot;download.default_directory&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\Downloads&amp;quot;)&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;excludeSwitches&amp;quot;, &amp;quot;enable-automation&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; dump Capabilities string to Console - reason: only to check how it looks&lt;br /&gt;
	_WD_CapabilitiesDump(@ScriptLineNumber &amp;amp; &amp;quot; Testing&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; get/assign Capabilities JSON Object content to string&lt;br /&gt;
	Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
	#EndRegion - creating capabilities string&lt;br /&gt;
&lt;br /&gt;
	; setting WebDriver options&lt;br /&gt;
	_WD_Option(&amp;quot;Driver&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\chromedriver.exe&amp;quot;)&lt;br /&gt;
	_WD_Option(&amp;quot;Port&amp;quot;, 9515)&lt;br /&gt;
	_WD_Option(&amp;quot;DefaultTimeout&amp;quot;, 1000)&lt;br /&gt;
	_WD_Option(&amp;quot;DriverParams&amp;quot;, &amp;quot;--log-path=&amp;quot; &amp;amp; Chr(34) &amp;amp; @ScriptDir &amp;amp; &amp;quot;\WebDriver_Testing.log&amp;quot; &amp;amp; Chr(34))&lt;br /&gt;
&lt;br /&gt;
	; starting WebDriver with specified options&lt;br /&gt;
	_WD_Startup()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, &amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; trying to create Session - connecting to WebDriver with specified capabilities&lt;br /&gt;
	Local $WD_SESSION = _WD_CreateSession($sCapabilities)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, $WD_SESSION)&lt;br /&gt;
&lt;br /&gt;
	; this MsgBox is placed here only to have possibility to manually check if all is fine with Chrome instance&lt;br /&gt;
	If Not @Compiled Then MsgBox($MB_OK + $MB_TOPMOST + $MB_ICONINFORMATION, &amp;quot;Information #&amp;quot; &amp;amp; @ScriptLineNumber, &amp;quot;Waiting before _WD_Shutdown()&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; delete/close session - disconnecting AutoIt script from running WebDriver process&lt;br /&gt;
	_WD_DeleteSession($WD_SESSION)&lt;br /&gt;
&lt;br /&gt;
	; close WebDriver process&lt;br /&gt;
	_WD_Shutdown()&lt;br /&gt;
EndFunc   ;==&amp;gt;_Example_UsingCapabilitesWithChrome&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example generates and uses Capabilities string as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;capabilities&amp;quot;:{&lt;br /&gt;
        &amp;quot;alwaysMatch&amp;quot;:{&lt;br /&gt;
            &amp;quot;acceptInsecureCerts&amp;quot;:true&lt;br /&gt;
        },&lt;br /&gt;
        &amp;quot;firstMatch&amp;quot;:[&lt;br /&gt;
            {&lt;br /&gt;
                &amp;quot;goog:chromeOptions&amp;quot;:{&lt;br /&gt;
                    &amp;quot;w3c&amp;quot;:true,&lt;br /&gt;
                    &amp;quot;prefs&amp;quot;:{&lt;br /&gt;
                        &amp;quot;download.default_directory&amp;quot;:&amp;quot;C:\\Testing\\WD_Download&amp;quot;&lt;br /&gt;
                    },&lt;br /&gt;
                    &amp;quot;excludeSwitches&amp;quot;:[&lt;br /&gt;
                        &amp;quot;enable-automation&amp;quot;&lt;br /&gt;
                    ]&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        ]&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional sources of information =&lt;br /&gt;
For Additional sources of information take a look on this following links:&lt;br /&gt;
&lt;br /&gt;
* https://github.com/Danp2/au3WebDriver/blob/master/wd_capabilities.au3&lt;br /&gt;
* https://docs.yugabyte.com/preview/api/ysql/datatypes/type_json/primitive-and-compound-data-types&lt;br /&gt;
* https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities&lt;br /&gt;
* https://chromedriver.chromium.org/capabilities&lt;br /&gt;
* https://www.selenium.dev/documentation/webdriver/capabilities/shared/&lt;br /&gt;
* https://www.selenium.dev/documentation/webdriver/capabilities/internet_explorer/&lt;br /&gt;
* https://github.com/SeleniumHQ/seleniumhq.github.io/tree/dev/website_and_docs/content/documentation/webdriver/capabilities&lt;br /&gt;
*&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver_Capabilities&amp;diff=14768</id>
		<title>WebDriver Capabilities</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver_Capabilities&amp;diff=14768"/>
		<updated>2022-04-09T18:07:10Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Additional sources of information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WIP}}&lt;br /&gt;
&lt;br /&gt;
= WebDriver Capabilities =&lt;br /&gt;
What are Capabilities?&amp;lt;p&amp;gt;&lt;br /&gt;
A good description can be found [https://www.selenium.dev/documentation/legacy/desired_capabilities/ ]:&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Not all server implementations will support every WebDriver feature. Therefore, the client and server should use JSON objects with the properties listed below when describing which features a user requests that a session support. If a session cannot support a capability that is requested in the desired capabilities, no error is thrown; a read-only capabilities object is returned that indicates the capabilities the session actually supports.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Capabilities are options that you can use to customize and configure a Browser session&lt;br /&gt;
* The capabilities you want to set are passed as a formatted string to function _WD_CreateSession&lt;br /&gt;
* The WebDriver UDF uses the Capabilities class to pass the capabilities string to the WebDriver exe file&lt;br /&gt;
* Format and content of the capabilities string differ from Browser to Browser&lt;br /&gt;
* Some capabilities are read-only, some are read-write&lt;br /&gt;
* There are [https://www.w3.org/TR/webdriver/#capabilities standard capabilities] each implementation must support. An implementation may define additional extension capabilities&lt;br /&gt;
* Some capabilities are [https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities#legacy_capabilities deprecated] and should be avoided.&lt;br /&gt;
&lt;br /&gt;
== Chrome related documentations ==&lt;br /&gt;
Link to the [https://chromedriver.chromium.org/capabilities Documentation of Capabilities for Chrome].&lt;br /&gt;
&lt;br /&gt;
Link to the [https://peter.sh/experiments/chromium-command-line-switches/ List of Chromium Command Line Switches].&lt;br /&gt;
&lt;br /&gt;
== Firefox related documentations ==&lt;br /&gt;
Link to the [https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities/firefoxOptions Documentation of Capabilities for Firefox].&lt;br /&gt;
&lt;br /&gt;
== Edge related documentations ==&lt;br /&gt;
Link to the [https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium/capabilities-edge-options Documentation of Capabilities for Edge].&lt;br /&gt;
&lt;br /&gt;
== Desired/Required capabilities ==&lt;br /&gt;
In many sources there are names such as: &#039;&#039;&#039;desiredCapabilities&#039;&#039;&#039; and &#039;&#039;&#039;requiredCapabilities&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
These are old nomenclatures for old solutions.&lt;br /&gt;
&lt;br /&gt;
`[https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities#legacy_capabilities Some drivers support these legacy capabilities, but they are deprecated and should be avoided.]`&lt;br /&gt;
&lt;br /&gt;
Currently &#039;&#039;&#039;Capabilities&#039;&#039;&#039; should be used.&lt;br /&gt;
&lt;br /&gt;
For more details take a look on:&lt;br /&gt;
 * [https://www.selenium.dev/documentation/legacy/desired_capabilities/ Legacy Selenium Desired Capabilities].&lt;br /&gt;
 * [https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities#legacy_capabilities Legacy capabilities]&lt;br /&gt;
&lt;br /&gt;
= WD_Capabilities UDF =&lt;br /&gt;
Creating a correct Capabilities string can become quite complex. Debugging problems as well.&amp;lt;br&amp;gt;&lt;br /&gt;
That&#039;s why the WD_Capabilities.au3 UDF has been created. It makes sure the created Capabilities string is perfectly formatted all the time.&lt;br /&gt;
The WD_Capabilities.au3 UDF is part of [https://github.com/Danp2/WebDriver AutoIt WebDriver sets of UDF].&lt;br /&gt;
&lt;br /&gt;
== Chrome Examples ==&lt;br /&gt;
To get the following Capabilities string&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;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;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
you have to call this sequence of functions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesStartup()&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;, &amp;quot;chrome&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;w3c&amp;quot;, True)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;excludeSwitches&amp;quot;, &amp;quot;enable-automation&amp;quot;)&lt;br /&gt;
Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Firefox Examples ==&lt;br /&gt;
To get the following Capabilities string&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $sCapabilities = &#039;{&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}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
you have to call this sequence of functions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesStartup()&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;, &amp;quot;firefox&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;browserName&amp;quot;, &amp;quot;firefox&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;acceptInsecureCerts&amp;quot;, True)&lt;br /&gt;
Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Edge Examples ==&lt;br /&gt;
To get the following Capabilities string&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $sCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;ms:edgeOptions&amp;quot;: {&amp;quot;excludeSwitches&amp;quot;: [ &amp;quot;enable-automation&amp;quot;]}}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
you have to call this sequence of functions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesStartup()&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;, &amp;quot;edge&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;excludeSwitches&amp;quot;, &amp;quot;enable-automation&amp;quot;)&lt;br /&gt;
Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== A complete working example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;wd_capabilities.au3&amp;quot;&lt;br /&gt;
#include &amp;quot;wd_helper.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
_Example_UsingCapabilitesWithChrome()&lt;br /&gt;
If @error Then 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; : Error launching browser&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
Func _Example_UsingCapabilitesWithChrome()&lt;br /&gt;
	#Region - creating capabilities string&lt;br /&gt;
	; startup - cleaning internal capabilities JSON object&lt;br /&gt;
	_WD_CapabilitiesStartup()&lt;br /&gt;
	; starting with &amp;quot;alwaysMatch&amp;quot; settings&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;)&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;acceptInsecureCerts&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
	; switching to &amp;quot;firstMatch&amp;quot; with &amp;quot;chrome&amp;quot; which will specify to use &amp;quot;goog:chromeOptions&amp;quot;&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;firstMatch&amp;quot;, &amp;quot;chrome&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; setting vendor specific &amp;quot;goog:chromeOptions&amp;quot; settings&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;w3c&amp;quot;, True)&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;prefs&amp;quot;, &amp;quot;download.default_directory&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\Downloads&amp;quot;)&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;excludeSwitches&amp;quot;, &amp;quot;enable-automation&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; dump Capabilities string to Console - reason: only to check how it looks&lt;br /&gt;
	_WD_CapabilitiesDump(@ScriptLineNumber &amp;amp; &amp;quot; Testing&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; get/assign Capabilities JSON Object content to string&lt;br /&gt;
	Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
	#EndRegion - creating capabilities string&lt;br /&gt;
&lt;br /&gt;
	; setting WebDriver options&lt;br /&gt;
	_WD_Option(&amp;quot;Driver&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\chromedriver.exe&amp;quot;)&lt;br /&gt;
	_WD_Option(&amp;quot;Port&amp;quot;, 9515)&lt;br /&gt;
	_WD_Option(&amp;quot;DefaultTimeout&amp;quot;, 1000)&lt;br /&gt;
	_WD_Option(&amp;quot;DriverParams&amp;quot;, &amp;quot;--log-path=&amp;quot; &amp;amp; Chr(34) &amp;amp; @ScriptDir &amp;amp; &amp;quot;\WebDriver_Testing.log&amp;quot; &amp;amp; Chr(34))&lt;br /&gt;
&lt;br /&gt;
	; starting WebDriver with specified options&lt;br /&gt;
	_WD_Startup()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, &amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; trying to create Session - connecting to WebDriver with specified capabilities&lt;br /&gt;
	Local $WD_SESSION = _WD_CreateSession($sCapabilities)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, $WD_SESSION)&lt;br /&gt;
&lt;br /&gt;
	; this MsgBox is placed here only to have possibility to manually check if all is fine with Chrome instance&lt;br /&gt;
	If Not @Compiled Then MsgBox($MB_OK + $MB_TOPMOST + $MB_ICONINFORMATION, &amp;quot;Information #&amp;quot; &amp;amp; @ScriptLineNumber, &amp;quot;Waiting before _WD_Shutdown()&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; delete/close session - disconnecting AutoIt script from running WebDriver process&lt;br /&gt;
	_WD_DeleteSession($WD_SESSION)&lt;br /&gt;
&lt;br /&gt;
	; close WebDriver process&lt;br /&gt;
	_WD_Shutdown()&lt;br /&gt;
EndFunc   ;==&amp;gt;_Example_UsingCapabilitesWithChrome&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example generates and uses Capabilities string as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;capabilities&amp;quot;:{&lt;br /&gt;
        &amp;quot;alwaysMatch&amp;quot;:{&lt;br /&gt;
            &amp;quot;acceptInsecureCerts&amp;quot;:true&lt;br /&gt;
        },&lt;br /&gt;
        &amp;quot;firstMatch&amp;quot;:[&lt;br /&gt;
            {&lt;br /&gt;
                &amp;quot;goog:chromeOptions&amp;quot;:{&lt;br /&gt;
                    &amp;quot;w3c&amp;quot;:true,&lt;br /&gt;
                    &amp;quot;prefs&amp;quot;:{&lt;br /&gt;
                        &amp;quot;download.default_directory&amp;quot;:&amp;quot;C:\\Testing\\WD_Download&amp;quot;&lt;br /&gt;
                    },&lt;br /&gt;
                    &amp;quot;excludeSwitches&amp;quot;:[&lt;br /&gt;
                        &amp;quot;enable-automation&amp;quot;&lt;br /&gt;
                    ]&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        ]&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional sources of information =&lt;br /&gt;
For Additional sources of information take a look on this following links:&lt;br /&gt;
&lt;br /&gt;
* https://www.autoitscript.com/wiki/WebDriver_Capabilities&lt;br /&gt;
* https://github.com/Danp2/au3WebDriver/blob/master/wd_capabilities.au3&lt;br /&gt;
* https://docs.yugabyte.com/preview/api/ysql/datatypes/type_json/primitive-and-compound-data-types&lt;br /&gt;
* https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities&lt;br /&gt;
* https://chromedriver.chromium.org/capabilities&lt;br /&gt;
* https://www.selenium.dev/documentation/webdriver/capabilities/shared/&lt;br /&gt;
* https://www.selenium.dev/documentation/webdriver/capabilities/internet_explorer/&lt;br /&gt;
* https://github.com/SeleniumHQ/seleniumhq.github.io/tree/dev/website_and_docs/content/documentation/webdriver/capabilities&lt;br /&gt;
*&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver_Capabilities&amp;diff=14767</id>
		<title>WebDriver Capabilities</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver_Capabilities&amp;diff=14767"/>
		<updated>2022-04-09T17:46:32Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* WebDriver Capabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WIP}}&lt;br /&gt;
&lt;br /&gt;
= WebDriver Capabilities =&lt;br /&gt;
What are Capabilities?&amp;lt;p&amp;gt;&lt;br /&gt;
A good description can be found [https://www.selenium.dev/documentation/legacy/desired_capabilities/ ]:&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Not all server implementations will support every WebDriver feature. Therefore, the client and server should use JSON objects with the properties listed below when describing which features a user requests that a session support. If a session cannot support a capability that is requested in the desired capabilities, no error is thrown; a read-only capabilities object is returned that indicates the capabilities the session actually supports.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Capabilities are options that you can use to customize and configure a Browser session&lt;br /&gt;
* The capabilities you want to set are passed as a formatted string to function _WD_CreateSession&lt;br /&gt;
* The WebDriver UDF uses the Capabilities class to pass the capabilities string to the WebDriver exe file&lt;br /&gt;
* Format and content of the capabilities string differ from Browser to Browser&lt;br /&gt;
* Some capabilities are read-only, some are read-write&lt;br /&gt;
* There are [https://www.w3.org/TR/webdriver/#capabilities standard capabilities] each implementation must support. An implementation may define additional extension capabilities&lt;br /&gt;
* Some capabilities are [https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities#legacy_capabilities deprecated] and should be avoided.&lt;br /&gt;
&lt;br /&gt;
== Chrome related documentations ==&lt;br /&gt;
Link to the [https://chromedriver.chromium.org/capabilities Documentation of Capabilities for Chrome].&lt;br /&gt;
&lt;br /&gt;
Link to the [https://peter.sh/experiments/chromium-command-line-switches/ List of Chromium Command Line Switches].&lt;br /&gt;
&lt;br /&gt;
== Firefox related documentations ==&lt;br /&gt;
Link to the [https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities/firefoxOptions Documentation of Capabilities for Firefox].&lt;br /&gt;
&lt;br /&gt;
== Edge related documentations ==&lt;br /&gt;
Link to the [https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium/capabilities-edge-options Documentation of Capabilities for Edge].&lt;br /&gt;
&lt;br /&gt;
== Desired/Required capabilities ==&lt;br /&gt;
In many sources there are names such as: &#039;&#039;&#039;desiredCapabilities&#039;&#039;&#039; and &#039;&#039;&#039;requiredCapabilities&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
These are old nomenclatures for old solutions.&lt;br /&gt;
&lt;br /&gt;
`[https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities#legacy_capabilities Some drivers support these legacy capabilities, but they are deprecated and should be avoided.]`&lt;br /&gt;
&lt;br /&gt;
Currently &#039;&#039;&#039;Capabilities&#039;&#039;&#039; should be used.&lt;br /&gt;
&lt;br /&gt;
For more details take a look on:&lt;br /&gt;
 * [https://www.selenium.dev/documentation/legacy/desired_capabilities/ Legacy Selenium Desired Capabilities].&lt;br /&gt;
 * [https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities#legacy_capabilities Legacy capabilities]&lt;br /&gt;
&lt;br /&gt;
= WD_Capabilities UDF =&lt;br /&gt;
Creating a correct Capabilities string can become quite complex. Debugging problems as well.&amp;lt;br&amp;gt;&lt;br /&gt;
That&#039;s why the WD_Capabilities.au3 UDF has been created. It makes sure the created Capabilities string is perfectly formatted all the time.&lt;br /&gt;
The WD_Capabilities.au3 UDF is part of [https://github.com/Danp2/WebDriver AutoIt WebDriver sets of UDF].&lt;br /&gt;
&lt;br /&gt;
== Chrome Examples ==&lt;br /&gt;
To get the following Capabilities string&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;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;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
you have to call this sequence of functions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesStartup()&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;, &amp;quot;chrome&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;w3c&amp;quot;, True)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;excludeSwitches&amp;quot;, &amp;quot;enable-automation&amp;quot;)&lt;br /&gt;
Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Firefox Examples ==&lt;br /&gt;
To get the following Capabilities string&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $sCapabilities = &#039;{&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}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
you have to call this sequence of functions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesStartup()&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;, &amp;quot;firefox&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;browserName&amp;quot;, &amp;quot;firefox&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;acceptInsecureCerts&amp;quot;, True)&lt;br /&gt;
Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Edge Examples ==&lt;br /&gt;
To get the following Capabilities string&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $sCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;ms:edgeOptions&amp;quot;: {&amp;quot;excludeSwitches&amp;quot;: [ &amp;quot;enable-automation&amp;quot;]}}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
you have to call this sequence of functions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesStartup()&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;, &amp;quot;edge&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;excludeSwitches&amp;quot;, &amp;quot;enable-automation&amp;quot;)&lt;br /&gt;
Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== A complete working example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;wd_capabilities.au3&amp;quot;&lt;br /&gt;
#include &amp;quot;wd_helper.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
_Example_UsingCapabilitesWithChrome()&lt;br /&gt;
If @error Then 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; : Error launching browser&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
Func _Example_UsingCapabilitesWithChrome()&lt;br /&gt;
	#Region - creating capabilities string&lt;br /&gt;
	; startup - cleaning internal capabilities JSON object&lt;br /&gt;
	_WD_CapabilitiesStartup()&lt;br /&gt;
	; starting with &amp;quot;alwaysMatch&amp;quot; settings&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;)&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;acceptInsecureCerts&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
	; switching to &amp;quot;firstMatch&amp;quot; with &amp;quot;chrome&amp;quot; which will specify to use &amp;quot;goog:chromeOptions&amp;quot;&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;firstMatch&amp;quot;, &amp;quot;chrome&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; setting vendor specific &amp;quot;goog:chromeOptions&amp;quot; settings&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;w3c&amp;quot;, True)&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;prefs&amp;quot;, &amp;quot;download.default_directory&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\Downloads&amp;quot;)&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;excludeSwitches&amp;quot;, &amp;quot;enable-automation&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; dump Capabilities string to Console - reason: only to check how it looks&lt;br /&gt;
	_WD_CapabilitiesDump(@ScriptLineNumber &amp;amp; &amp;quot; Testing&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; get/assign Capabilities JSON Object content to string&lt;br /&gt;
	Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
	#EndRegion - creating capabilities string&lt;br /&gt;
&lt;br /&gt;
	; setting WebDriver options&lt;br /&gt;
	_WD_Option(&amp;quot;Driver&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\chromedriver.exe&amp;quot;)&lt;br /&gt;
	_WD_Option(&amp;quot;Port&amp;quot;, 9515)&lt;br /&gt;
	_WD_Option(&amp;quot;DefaultTimeout&amp;quot;, 1000)&lt;br /&gt;
	_WD_Option(&amp;quot;DriverParams&amp;quot;, &amp;quot;--log-path=&amp;quot; &amp;amp; Chr(34) &amp;amp; @ScriptDir &amp;amp; &amp;quot;\WebDriver_Testing.log&amp;quot; &amp;amp; Chr(34))&lt;br /&gt;
&lt;br /&gt;
	; starting WebDriver with specified options&lt;br /&gt;
	_WD_Startup()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, &amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; trying to create Session - connecting to WebDriver with specified capabilities&lt;br /&gt;
	Local $WD_SESSION = _WD_CreateSession($sCapabilities)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, $WD_SESSION)&lt;br /&gt;
&lt;br /&gt;
	; this MsgBox is placed here only to have possibility to manually check if all is fine with Chrome instance&lt;br /&gt;
	If Not @Compiled Then MsgBox($MB_OK + $MB_TOPMOST + $MB_ICONINFORMATION, &amp;quot;Information #&amp;quot; &amp;amp; @ScriptLineNumber, &amp;quot;Waiting before _WD_Shutdown()&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; delete/close session - disconnecting AutoIt script from running WebDriver process&lt;br /&gt;
	_WD_DeleteSession($WD_SESSION)&lt;br /&gt;
&lt;br /&gt;
	; close WebDriver process&lt;br /&gt;
	_WD_Shutdown()&lt;br /&gt;
EndFunc   ;==&amp;gt;_Example_UsingCapabilitesWithChrome&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example generates and uses Capabilities string as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;capabilities&amp;quot;:{&lt;br /&gt;
        &amp;quot;alwaysMatch&amp;quot;:{&lt;br /&gt;
            &amp;quot;acceptInsecureCerts&amp;quot;:true&lt;br /&gt;
        },&lt;br /&gt;
        &amp;quot;firstMatch&amp;quot;:[&lt;br /&gt;
            {&lt;br /&gt;
                &amp;quot;goog:chromeOptions&amp;quot;:{&lt;br /&gt;
                    &amp;quot;w3c&amp;quot;:true,&lt;br /&gt;
                    &amp;quot;prefs&amp;quot;:{&lt;br /&gt;
                        &amp;quot;download.default_directory&amp;quot;:&amp;quot;C:\\Testing\\WD_Download&amp;quot;&lt;br /&gt;
                    },&lt;br /&gt;
                    &amp;quot;excludeSwitches&amp;quot;:[&lt;br /&gt;
                        &amp;quot;enable-automation&amp;quot;&lt;br /&gt;
                    ]&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        ]&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver_Capabilities&amp;diff=14766</id>
		<title>WebDriver Capabilities</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver_Capabilities&amp;diff=14766"/>
		<updated>2022-04-09T17:42:42Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* Desired/Required capabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WIP}}&lt;br /&gt;
&lt;br /&gt;
= WebDriver Capabilities =&lt;br /&gt;
What are Capabilities?&amp;lt;p&amp;gt;&lt;br /&gt;
A good description can be found [https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities here]:&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Not all server implementations will support every WebDriver feature. Therefore, the client and server should use JSON objects with the properties listed below when describing which features a user requests that a session support. If a session cannot support a capability that is requested in the desired capabilities, no error is thrown; a read-only capabilities object is returned that indicates the capabilities the session actually supports.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Capabilities are options that you can use to customize and configure a Browser session&lt;br /&gt;
* The capabilities you want to set are passed as a formatted string to function _WD_CreateSession&lt;br /&gt;
* The WebDriver UDF uses the Capabilities class to pass the capabilities string to the WebDriver exe file&lt;br /&gt;
* Format and content of the capabilities string differ from Browser to Browser&lt;br /&gt;
* Some capabilities are read-only, some are read-write&lt;br /&gt;
* There are [https://www.w3.org/TR/webdriver/#capabilities standard capabilities] each implementation must support. An implementation may define additional extension capabilities&lt;br /&gt;
* Some capabilities are [https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities#legacy_capabilities deprecated] and should be avoided.&lt;br /&gt;
&lt;br /&gt;
== Chrome related documentations ==&lt;br /&gt;
Link to the [https://chromedriver.chromium.org/capabilities Documentation of Capabilities for Chrome].&lt;br /&gt;
&lt;br /&gt;
Link to the [https://peter.sh/experiments/chromium-command-line-switches/ List of Chromium Command Line Switches].&lt;br /&gt;
&lt;br /&gt;
== Firefox related documentations ==&lt;br /&gt;
Link to the [https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities/firefoxOptions Documentation of Capabilities for Firefox].&lt;br /&gt;
&lt;br /&gt;
== Edge related documentations ==&lt;br /&gt;
Link to the [https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium/capabilities-edge-options Documentation of Capabilities for Edge].&lt;br /&gt;
&lt;br /&gt;
== Desired/Required capabilities ==&lt;br /&gt;
In many sources there are names such as: &#039;&#039;&#039;desiredCapabilities&#039;&#039;&#039; and &#039;&#039;&#039;requiredCapabilities&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
These are old nomenclatures for old solutions.&lt;br /&gt;
&lt;br /&gt;
`[https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities#legacy_capabilities Some drivers support these legacy capabilities, but they are deprecated and should be avoided.]`&lt;br /&gt;
&lt;br /&gt;
Currently &#039;&#039;&#039;Capabilities&#039;&#039;&#039; should be used.&lt;br /&gt;
&lt;br /&gt;
For more details take a look on:&lt;br /&gt;
 * [https://www.selenium.dev/documentation/legacy/desired_capabilities/ Legacy Selenium Desired Capabilities].&lt;br /&gt;
 * [https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities#legacy_capabilities Legacy capabilities]&lt;br /&gt;
&lt;br /&gt;
= WD_Capabilities UDF =&lt;br /&gt;
Creating a correct Capabilities string can become quite complex. Debugging problems as well.&amp;lt;br&amp;gt;&lt;br /&gt;
That&#039;s why the WD_Capabilities.au3 UDF has been created. It makes sure the created Capabilities string is perfectly formatted all the time.&lt;br /&gt;
The WD_Capabilities.au3 UDF is part of [https://github.com/Danp2/WebDriver AutoIt WebDriver sets of UDF].&lt;br /&gt;
&lt;br /&gt;
== Chrome Examples ==&lt;br /&gt;
To get the following Capabilities string&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;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;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
you have to call this sequence of functions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesStartup()&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;, &amp;quot;chrome&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;w3c&amp;quot;, True)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;excludeSwitches&amp;quot;, &amp;quot;enable-automation&amp;quot;)&lt;br /&gt;
Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Firefox Examples ==&lt;br /&gt;
To get the following Capabilities string&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $sCapabilities = &#039;{&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}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
you have to call this sequence of functions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesStartup()&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;, &amp;quot;firefox&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;browserName&amp;quot;, &amp;quot;firefox&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;acceptInsecureCerts&amp;quot;, True)&lt;br /&gt;
Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Edge Examples ==&lt;br /&gt;
To get the following Capabilities string&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Local $sCapabilities = &#039;{&amp;quot;capabilities&amp;quot;: {&amp;quot;alwaysMatch&amp;quot;: {&amp;quot;ms:edgeOptions&amp;quot;: {&amp;quot;excludeSwitches&amp;quot;: [ &amp;quot;enable-automation&amp;quot;]}}}}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
you have to call this sequence of functions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
_WD_CapabilitiesStartup()&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;, &amp;quot;edge&amp;quot;)&lt;br /&gt;
_WD_CapabilitiesAdd(&amp;quot;excludeSwitches&amp;quot;, &amp;quot;enable-automation&amp;quot;)&lt;br /&gt;
Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== A complete working example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;MsgBoxConstants.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;wd_capabilities.au3&amp;quot;&lt;br /&gt;
#include &amp;quot;wd_helper.au3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
_Example_UsingCapabilitesWithChrome()&lt;br /&gt;
If @error Then 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; : Error launching browser&amp;quot; &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
Func _Example_UsingCapabilitesWithChrome()&lt;br /&gt;
	#Region - creating capabilities string&lt;br /&gt;
	; startup - cleaning internal capabilities JSON object&lt;br /&gt;
	_WD_CapabilitiesStartup()&lt;br /&gt;
	; starting with &amp;quot;alwaysMatch&amp;quot; settings&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;alwaysMatch&amp;quot;)&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;acceptInsecureCerts&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
	; switching to &amp;quot;firstMatch&amp;quot; with &amp;quot;chrome&amp;quot; which will specify to use &amp;quot;goog:chromeOptions&amp;quot;&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;firstMatch&amp;quot;, &amp;quot;chrome&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; setting vendor specific &amp;quot;goog:chromeOptions&amp;quot; settings&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;w3c&amp;quot;, True)&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;prefs&amp;quot;, &amp;quot;download.default_directory&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\Downloads&amp;quot;)&lt;br /&gt;
	_WD_CapabilitiesAdd(&amp;quot;excludeSwitches&amp;quot;, &amp;quot;enable-automation&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; dump Capabilities string to Console - reason: only to check how it looks&lt;br /&gt;
	_WD_CapabilitiesDump(@ScriptLineNumber &amp;amp; &amp;quot; Testing&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; get/assign Capabilities JSON Object content to string&lt;br /&gt;
	Local $sCapabilities = _WD_CapabilitiesGet()&lt;br /&gt;
	#EndRegion - creating capabilities string&lt;br /&gt;
&lt;br /&gt;
	; setting WebDriver options&lt;br /&gt;
	_WD_Option(&amp;quot;Driver&amp;quot;, @ScriptDir &amp;amp; &amp;quot;\chromedriver.exe&amp;quot;)&lt;br /&gt;
	_WD_Option(&amp;quot;Port&amp;quot;, 9515)&lt;br /&gt;
	_WD_Option(&amp;quot;DefaultTimeout&amp;quot;, 1000)&lt;br /&gt;
	_WD_Option(&amp;quot;DriverParams&amp;quot;, &amp;quot;--log-path=&amp;quot; &amp;amp; Chr(34) &amp;amp; @ScriptDir &amp;amp; &amp;quot;\WebDriver_Testing.log&amp;quot; &amp;amp; Chr(34))&lt;br /&gt;
&lt;br /&gt;
	; starting WebDriver with specified options&lt;br /&gt;
	_WD_Startup()&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, &amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; trying to create Session - connecting to WebDriver with specified capabilities&lt;br /&gt;
	Local $WD_SESSION = _WD_CreateSession($sCapabilities)&lt;br /&gt;
	If @error Then Return SetError(@error, @extended, $WD_SESSION)&lt;br /&gt;
&lt;br /&gt;
	; this MsgBox is placed here only to have possibility to manually check if all is fine with Chrome instance&lt;br /&gt;
	If Not @Compiled Then MsgBox($MB_OK + $MB_TOPMOST + $MB_ICONINFORMATION, &amp;quot;Information #&amp;quot; &amp;amp; @ScriptLineNumber, &amp;quot;Waiting before _WD_Shutdown()&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	; delete/close session - disconnecting AutoIt script from running WebDriver process&lt;br /&gt;
	_WD_DeleteSession($WD_SESSION)&lt;br /&gt;
&lt;br /&gt;
	; close WebDriver process&lt;br /&gt;
	_WD_Shutdown()&lt;br /&gt;
EndFunc   ;==&amp;gt;_Example_UsingCapabilitesWithChrome&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example generates and uses Capabilities string as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;capabilities&amp;quot;:{&lt;br /&gt;
        &amp;quot;alwaysMatch&amp;quot;:{&lt;br /&gt;
            &amp;quot;acceptInsecureCerts&amp;quot;:true&lt;br /&gt;
        },&lt;br /&gt;
        &amp;quot;firstMatch&amp;quot;:[&lt;br /&gt;
            {&lt;br /&gt;
                &amp;quot;goog:chromeOptions&amp;quot;:{&lt;br /&gt;
                    &amp;quot;w3c&amp;quot;:true,&lt;br /&gt;
                    &amp;quot;prefs&amp;quot;:{&lt;br /&gt;
                        &amp;quot;download.default_directory&amp;quot;:&amp;quot;C:\\Testing\\WD_Download&amp;quot;&lt;br /&gt;
                    },&lt;br /&gt;
                    &amp;quot;excludeSwitches&amp;quot;:[&lt;br /&gt;
                        &amp;quot;enable-automation&amp;quot;&lt;br /&gt;
                    ]&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        ]&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MLipok</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14764</id>
		<title>WebDriver</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=WebDriver&amp;diff=14764"/>
		<updated>2022-03-24T07:37:20Z</updated>

		<summary type="html">&lt;p&gt;MLipok: /* FAQ */ date&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;
; 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 another browser 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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEBodyWriteHTML || || &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 || || &lt;br /&gt;
|-&lt;br /&gt;
| _IEErrorNotify || || &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_ElementSelectAction || _WD_FindElement + _WD_ElementSelectAction($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_FindElement + _WD_FrameEnter || You are not able to get all Frames at once.&lt;br /&gt;
You must get all that are available in current document context, then go to each frame and find all sub frames.&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 on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_Introduction || N/A || Take a look on  wd_demo.au3 script&lt;br /&gt;
|-&lt;br /&gt;
| _IE_VersionInfo || $__WDVERSION || &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://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?]&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;
&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;
== 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: 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/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>MLipok</name></author>
	</entry>
</feed>