0

I have integrated the Selenium Code with jenkins to execute the test cases with following steps:

https://wiki.jenkins.io/display/JENKINS/Zephyr+For+Jira+Test+Management+Plugin

Right now I have to narrate my Test cases according to the project structure. Example : PackageName.ClassName.MethodName which is not the correct approach.

Please let me know if there is any other way to identify test cases using Test ID

public class AppTest {

    public static WebDriver driver;
    public static String path = System.getProperty("user.dir");

    @BeforeSuite
    public void setUp() {
        System.setProperty("webdriver.chrome.driver", path + "\\Utilities_files\\chromedriver.exe");
        driver = new ChromeDriver();
        System.out.println(driver);
        driver.manage().window().maximize();
    }

    @Test
    public void testApp() {
        try {
            driver.get("");
            driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Test
    public void testApp1() {
        driver.findElement(By.xpath("aaa")).click();
    }

    @AfterSuite
    public void tear() {
        driver.quit();

    }
}
Roberto Pegoraro
  • 1,313
  • 2
  • 16
  • 31

1 Answers1

0

Not sure exactly what you mean. But if you are trying to use test ng than may you can go ahead and run your test cases from testng.xml instead f running the class directly. There you can specify test cases with id which will be unique for each test cases(scenarios). Please follow below link in case if you need more info in testng.xml creation and use.

tesng xml link

Arun Prasat
  • 340
  • 1
  • 9