Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saucelabs configuration does not work, however if we set it up at below remote driver works, any suggestion? #2717

Open
khalam1 opened this issue Feb 19, 2022 · 3 comments

Comments

@khalam1
Copy link

khalam1 commented Feb 19, 2022

What works:
@OverRide
public WebDriver newDriver(){
try {
ChromeOptions options = new ChromeOptions();
options.setPlatformName("Windows 11");
options.setBrowserVersion("latest");
options.addArguments("start-maximized");

        Map<String, Object> sauceOptions = new HashMap<>();
        sauceOptions.put("username", "");
        sauceOptions.put("accessKey", "");
        sauceOptions.put("screenResolution", "");
        sauceOptions.put("name", "");

        options.setCapability("sauce:options", sauceOptions);
        URL url = new URL("https://ondemand.us-west-1.saucelabs.com/wd/hub");

        return new RemoteWebDriver(url, options);
    }
    catch (IOException e) {
        throw new Error(e);
    }
}

What does not work:
saucelabs.url
saucelabs.target.platform

saucelabs.driver.version
saucelabs.test.name
saucelabs.access.key
saucelabs.user.id

@wakaleo
Copy link
Member

wakaleo commented Feb 19, 2022

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

@Sreedeep-7821
Copy link

Sreedeep-7821 commented Jan 2, 2024

serenity conf file :
webdriver {
base.url = "https://xxxx.com/apphome"
autodownload = true
}
environments {
run_with_saucelabs {
webdriver.driver = remote
webdriver.remote.url = "https://:@ondemand.us-west-1.saucelabs.com:443/wd/hub"
# Some W3C Capabilities
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

@bliu13
Copy link

bliu13 commented Apr 23, 2024

@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
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants