Open khalam1 opened 2 years ago
See this file for an example of how to configure Serenity with Saucelabs: https://github.com/serenity-bdd/serenity-core/blob/master/serenity-smoketests/src/test/resources/serenity.conf
serenity conf file :
webdriver {
base.url = "https://xxxx.com/apphome"
autodownload = true
}
environments {
run_with_saucelabs {
webdriver.driver = remote
webdriver.remote.url = "https://
screenResolution = "1280x1024"
strictFileInteractability = true
unhandledPromptBehavior = "ignore"
tunnelIdentifier = "xxx"
tunnelOwner = "xxx"
timeouts {
script = 20000
pageLoad = 400000
implicit = 1000
}
saucelabs {
#
# Mandatory SauceLabs fields
#
platformName = "MAC"
browserName = "chrome"
browserVersion = "latest"
#
# The saucelabs.datacenter property tells Serenity to use SauceLabs for these tests
#
datacenter = "us-west-1"
#
# Some optional saucelabs-specific fields
#
tags = ["end-to-end"]
maxDuration = 900
}
} }
serenity { logging = "VERBOSE" }
driver is getting initialised through :
@Managed
WebDriver driver;
Facing the issue : net.thucydides.core.webdriver.DriverConfigurationError: Could not instantiate class org.openqa.selenium.remote.RemoteWebDriver
@wakaleo I ran into a similar issue where the remote web driver could not be instantiated. I followed the SauceLabs guide and have also tried the sample configuration in the same serenity.conf file and had no success.
Here's my serenity.conf
sauce {
username = "some.user"
key = "some.key"
active = true
}
serenity{
take.screenshots = BEFORE_AND_AFTER_EACH_STEP
}
webdriver {
driver = "remote"
remote.url = "https://ondemand.us-west-1.saucelabs.com/wd/hub"
autodownload = true
capabilities {
browserName = "chrome"
"goog:chromeOptions" {
args = [
"headless=new"
"start-maximized",
"no-sandbox",
"ignore-certificate-errors",
"disable-popup-blocking",
"disable-default-apps",
"disable-extensions-file-access-check",
"disable-infobars",
"disable-gpu",
"incognito",
]
excludeSwitches = [
"enable-automation",
"load-extension"
]
prefs {
default_content_settings.popups = 0,
credentials_enable_service = false,
password_manager_enabled = false
}
}
version = "latest-1"
platform = "Linux"
"sauce:options" {
tags = [
"end-to-end"
]
recordVideo = true
recordLogs = true
}
}
}
What works: @Override public WebDriver newDriver(){ try { ChromeOptions options = new ChromeOptions(); options.setPlatformName("Windows 11"); options.setBrowserVersion("latest"); options.addArguments("start-maximized");
What does not work: saucelabs.url saucelabs.target.platform
saucelabs.driver.version saucelabs.test.name saucelabs.access.key saucelabs.user.id