1

I hope you can help me. Selenium is running headless with Docker. I am able to access the Webserver from my Grid, opening google and doing Selenium Teststeps is no problem.

Now I want to test my application with a specific locale.

    @Before
    public void setUp() throws Exception {
            selenium = new DefaultSelenium("localhost",4444,"*firefox","http://wildfly:8080");
            selenium.start();
    }
    @Test
    public void testSeleniumSupplier() throws Exception {
            selenium.open("/");
            selenium.click("link=Lieferant");

Unfortunately I have not developed this application, i am only testing it. I already opened a bug that I am not able to access the site with locale en. I need to access this page with locale de. How can I set it within Selenium or Docker to access the site with german locale? With Webdriver I would know how to change, but not in Selenium Grid, I am new to Selenium Grid.

Thank you very much in advance for your help :)

Simon
  • 605
  • 1
  • 6
  • 18

1 Answers1

2

For this you will need to create a FirefoxProfile. In this profile you can set your preferences.

Note: DefaultSelenium is deprecated so you don't want to use this.

FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("intl.accept_languages", "de");

// Start the driver with the new profile
DesiredCapabilities dc = DesiredCapabilities.firefox();
dc.setCapability(FirefoxDriver.PROFILE, profile);
WebDriver driver = new RemoteWebDriver(
                                new URL("http://localhost:4444/wd/hub"), 
                                dc);
RemcoW
  • 4,196
  • 1
  • 22
  • 37