WebDriver is a w3c standard to handle test automation on the most popular browsers. GXtest takes advantage of this standard while providing an abstraction layer in GeneXus to create UI tests.
There are 3 main functions in order to start a new UI test. By default, all test will run in a local browser using a driver unless you specify the opposite:
If you don't specify a browser type inside your test (using SetBrowser function) the test will run using the Knowledge Base property that is set under the Test section:

As a good practice if you want to run tests on another browser, change this property instead of setting the browser type inside the test.

Goal: To set the browser type to be used in the test.
Parameters:
- browser: A string with browser type (you can use Browsers domain for this purpose like the example)
Examples of use:
&driver.SetBrowser(Browsers.Firefox)
&driver.SetBrowser("Chrome")
Note: As mentioned, it is recommended to avoid using this function and to change the default browser property in the KB properties instead.

Goal: To get the current browser set.
Returns:
- the last browser set, not necessarily the browser where the test is running (in cases where a SetBrowser command is executed after the Start command)
Examples of use:
if &driver.GetBrowser() = Browsers.Firefox

Goal: To start a test session using WebDriver
Example of use:
&driver.Start()

Goal: To end a test session using WebDriver
Example of use:
&driver.End()
To run tests on any remote web driver node (Selenium node or Cloud), you can use these 2 functions:

Goal: To add a desired capability for a Remote WebDriver node.
Parameters:
- capabilityName: A capability key name.
- capabilityValue: The capability desired value.
Returns: n/a
Example of use:
&driver.AddCapability("browserName", "MicrosoftEdge")
&driver.AddCapability("platform", "Windows 10")
&driver.AddCapability("version", "16.16299")

Goal: To set a remote WebDriver node URL to spin remote browsers.
Parameters:
- URL: The remote WebDriver node.
Returns: n/a
Example of use:
&driver.SetRemoteWebDriver("http://[USER]:[KEY]@testmachine.mydomain.com:4444/wd/hub")
|