I am new to TestNG and Selenium. I am trying to write test cases using Eclipse IDE.
Following is a sample test case which I am using :
package JenkinsPackage;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;
public class JenkinsClass {
@Test
public void jenkinsfunction(){
System.out.println("Hello");
System.setProperty("webdriver.gecko.driver","D:\\software\\geckodriver-v0.14.0-win64\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("http://my.domain.com");
System.out.println(driver.getTitle());
driver.quit();
}
}
When I run the above code it is working perfectly. I have the following questions.
- How to create a runnable jar of this project , which will run xml file
- I want to deploy this jar to Jenkins, how to do this ? Since I am not able to create a runnable jar