Execution Cloud setup and installation
Prerequisites
To work with Applitools Execution Cloud, you need the following:
-
Permission to use Eyes Execution Cloud. To get access, contact the Applitools Support team.
-
A valid Eyes account with a valid API key. For details see How to retrieve your API key.
-
Eyes SDK in one of the following languages:
-
Selenium Java
-
Selenium JavaScript
-
Selenium Python
-
Selenium C#
-
Selenium Ruby
-
WebDriverIO
-
Robot Framework
-
Setting up Execution Cloud
To set up Execution Cloud, follow these steps:
-
Set the following environment variables:
-
APPLITOOLS_API_KEY
– Your API key. See How to obtain your API key. -
APPLITOOLS_SERVER_URL
– The URL of the Eyes server. If you use the public Eyes server, the URL ishttps://eyes.applitools.com
You can also set these variables using Chrome capabilities:
Copy'applitools:eyesServerUrl': 'https://eyesapi.applitools.com',
'applitools:apiKey': 'api-key',or in the following format:
Copyapplitools:options' {
eyesServerUrl: 'https://eyesapi.applitools.com',
apiKey: 'api-key',
} -
-
Use the following code to replace your local driver setup:
- Java
- JavaScript
- Python
- C#
- Ruby
- WebDriverIO
- Robot
DesiredCapabilities caps = new DesiredCapabilities();
caps.setBrowserName("chrome");
WebDriver driver = new RemoteWebDriver(new URL(Eyes.getExecutionCloudURL()), caps);
const executionCloudUrl = await Eyes.getExecutionCloudUrl()
const driver = await new Builder()
.withCapabilities({
browserName: 'chrome',
})
.usingServer(executionCloudUrl)
.build()
from selenium import webdriver
driver = webdriver.Remote(command_executor=Eyes.get_execution_cloud_url(), options=webdriver.ChromeOptions())
var chromeOptions = new ChromeOptions();
var driver = new RemoteWebDriver(new Uri(Eyes.GetExecutionCloudUrl(), chromeOptions)
execution_cloud_url = Applitools::EyesBase.get_execution_cloud_url
# for Selenium 3
driver = Selenium::WebDriver.for :remote, desired_capabilities: caps, url: execution_cloud_url
# for Selenium 4
driver = Selenium::WebDriver.for :remote, capabilities: caps, url: execution_cloud_url
const executionCloudUrl = new URL(await Eyes.getExecutionCloudUrl())
const protocol_val = executionCloudUrl.protocol.substring(0, executionCloudUrl.protocol.length - 1)
browser = await remote({
logLevel: 'trace',
protocol: protocol_val,
hostname: executionCloudUrl.hostname,
port: Number(executionCloudUrl.port),
capabilities: {
browserName: 'chrome',
}
})
*** Keywords ***
# For setup, load the demo site's login page and open Eyes to start visual testing.
Setup
${selfHealingOptions} = Create Dictionary findElementsSupport=${True}
${remote_url}= Get Execution Cloud URL
Open Browser https://demo.applitools.com chrome remote_url=${remote_url}
... options=set_capability('applitools:useSelfHealing', ${True});set_capability('applitools:tunnel', ${False});set_capability('browserVersion', 'latest');set_capability('selfHealingOptions', ${selfHealingOptions})
Eyes Open
Testing local websites without a public URL
To test your local websites with Applitools Execution Cloud use a secured tunnel between the remote browser and the local network. The remote Execution Cloud browser will then be able to control all network requests through the local network.
Set the following environment variable:
-
APPLITOOLS_TUNNEL=true
Or using the Chrome capabilities, set 'applitools:tunnel'
to true
.
Setting the Execution Cloud region
By default, Execution Cloud resides on a cloud which is located in the United States. You can set the following Chrome capabilities to work with a cloud located in Australia:
"applitools:region": "australia"