Beginner on selenium grid, I just created a small test that allows to navigate on the home page of stackoverflow For this I placed the selenium server on my disk, I opened 2 terminals as shown in the documentation here.
https://www.selenium.dev/documentation/grid/getting_started/#hub-and-nodes
The test starts well, and now I would like to run the same test under firefox while modifying the OS (for example: windows). How do I do this? Do I have to create another test file in my project? And then how to run the test with multiple configurations? I can’t find an answer to these questions.
My configuration:
-Linux Ubuntu 20.04
-Google and chrome 95
-the last version selenium server : 4.1.1
Here's the code of the test:
public class StepGoStackoverflow { RemoteWebDriver driver; String nodeUrl; @Given("I'm on google search page") public void i_m_on_google_search_page() { try { nodeUrl = "http://localhost:4444"; ChromeOptions options = new ChromeOptions(); // options.addArguments("--headless"); options.addArguments("start-maximized"); driver = new RemoteWebDriver(new URL(nodeUrl), options); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.manage().timeouts().pageLoadTimeout(10, TimeUnit.SECONDS); driver.get("https://www.google.com"); } catch (MalformedURLException error) { error.printStackTrace(); } } @When("I enter the name of the site") public void i_enter_the_name_of_the_site() { WebElement webElementList = driver.findElement(By.id("L2AGLb")); webElementList.click(); driver.findElement(By.name("q")).sendKeys("stackoverflow", Keys.ENTER); } @Then("I'm navigated on the home page of stackoverflow") public void i_m_navigated_on_the_home_page_of_stackoverflow() { driver.findElement(By.xpath("//a[@href='https://stackoverflow.com/']")).click(); driver.close(); } } EDIT: I forgot to give the snipet of Gerkhin:
Feature: search the home page of stackoverflow Scenario: Go to the site stackoverflow Given I'm on google search page When I enter the name of the site Then I'm navigated on the home page of stackoverflow Thank you