serenity-bdd / serenity-documentation

The main Serenity BDD documentation
Apache License 2.0
40 stars 61 forks source link

Not able to pass boolean values in chrome capabilites #133

Open cvarshn-cloud opened 3 years ago

cvarshn-cloud commented 3 years ago

@wakaleo @jeffjensen @mojavelinux @vikramvi @mthmulders I am running tests on selenoid using serenity and not able to pass below capabilities:

  1. enableVNC=true;
  2. enableVideo=true;

Getting below error

Caused by: org.openqa.selenium.WebDriverException: json: cannot unmarshal string into Go struct field Caps.desiredCapabilities.enableVideo of type bool (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 165 milliseconds Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'slave-m6xpj', ip: '10.233.94.150', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-1127.19.1.el7.x86_64', java.version: '1.8.0_242' Driver info: driver.version: DefaultRemoteDriver

Tried below not successful:

  1. serenity.driver.capabilities="enableVNC:true; enableVideo:true"
  2. chrome.capabilities.enableVNC=true chrome.capabilities.enableVideo=true 3.chrome.switches="--headless,--disable-plugins,--disable-extensions,--disable-infobars,--enableVNC=true,--enableVideo=true"

Can you please help me out ASAP on this?

wakaleo commented 3 years ago

Serenity already converts Strings like this to booleans before passing it into the capabilities object. What version of Serenity are you using?

cvarshn-cloud commented 3 years ago

Serenity already converts Strings like this to booleans before passing it into the capabilities object. What version of Serenity are you using?

2.2.13

wakaleo commented 3 years ago

Try with 2.4.34

Cvarshney-clgx commented 1 year ago

@wakaleo @jeffjensen @mojavelinux Its not working , I need to pass below to serenity.properties file

ChromeOptions options = new ChromeOptions(); options.setCapability("browserVersion", "108.0"); options.setCapability("selenoid:options", new HashMap<String, Object>() {{ / How to add test badge / put("name", "Test badge...");

/* How to set session timeout */
put("sessionTimeout", "15m");

/* How to set timezone */
put("env", new ArrayList<String>() {{
    add("TZ=UTC");
}});

/* How to add "trash" button */
put("labels", new HashMap<String, Object>() {{
    put("manual", "true");
}});

/* How to enable video recording */
put("enableVideo", true);

}}); RemoteWebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), options);

How to pass these capabilities in serenity.properties. I am using 3.4.3 version?