R
R
Ray2017-06-16 15:07:44
linux
Ray, 2017-06-16 15:07:44

How to run a Linux java test?

I am writing tests (Selenium WebDriver + Java) on Windows.
Tests like these:

public void loginUser() throws Exception {
    driver.get("http://my-site/login");
    waitAssert.login(driver);
    ElementsLoginPage.login(driver).sendKeys("[email protected]");
    ElementsLoginPage.password(driver).sendKeys("qwerty");
    ElementsLoginPage.submitButton(driver).click();
    waitAssert.logoutButton(driver);
    assertTrue(ElementsLoginPage.buttonLogout(driver).isDisplayed());
    ElementsLoginPage.buttonLogout(driver).click();
  }

I need to run them on Linux from the console.
I am new to this.
How to do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Valera Figol, 2017-06-16
@Kamrit

JUnit, in theory, should also be on Linux. It can be run through the console and through the development environment

W
wwarlock, 2017-06-22
@wwarlock

Judging by the above code, you are using the HtmlUnit driver, which is the default in Selenium.
So it does not affect the launch in the linux environment.
If the driver is different, please specify. If the graphic server is not installed on the linux machine, then you need headless drivers.
What build environment are you using in the project (ant/maven/gradle/...)?
If none, then I recommend using Gradle, it will be the fastest option for you.
And finally, running a java application on linux is no different from running on other operating systems.
How do you run your application on Windows?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question