0

After updating chrome and the corresponding chromedriver to version 75 I cannot use findby name when the corresponding name contains special characters:

  @FindBy(name = "head['such']")
private WebElement searchWordInput;

After some quick search I found this thread facing the same problem, due to the default enabled w3c mode: https://groups.google.com/forum/#!msg/selenium-users/TwWf4uwYB5A/5XmNBb7IDAAJ

In order to get our tests to run I would like to temporarily disable w3c mode of chrome since there is a long term solution (e.g. chromedriver or selenium fix).

This answer gives an example on how to do it in java as code: How to turn off w3c in chromedriver to address the error unknown command: Cannot call non W3C standard command while in W3C

In my case I do not configure the chrome driver in java but user serenity's @Managed annotation in our tests:

@Managed(driver = "chrome")
WebDriver driver;

If possible I do not want to configure the driver by myself because this would lead to refactor many tests.

Unfortunately I can't figure out how to do this with serenity. What I've tried was specifying it in a serenity.conf file like this:

chrome {
    capabilities {
        chromeOptions {
            "w3c" = false
        }
    }
}

Somehow serenity picked up my configuration but I think not in the correct way:

[main] INFO net.serenitybdd.core.webdriver.driverproviders.ProvideNewDriver - Driver capabilities: Capabilities {acceptInsecureCerts: false, browserName: chrome, chromeOptions.w3c: false, goog:chromeOptions: {args: [--enable-automation, --test-type], extensions: []}, platform: ANY, version: }

How can I disable chrome w3c mode either in a serenity.conf or serenity.properties file?

Zteve
  • 341
  • 1
  • 2
  • 12
  • I've edited the question to clarify my point. In my opinion this is not a duplicate. Could you check this again? Thanks! – Zteve Jul 17 '19 at 07:15
  • Have you followed http://thucydides.info/docs/serenity-staging/#_advanced_webdriver_integration ? – Alohci Jul 17 '19 at 08:22

0 Answers0