RE: Create a proper XML file to run specific tests in a class


package FrameWork;

public class SFAutomation {

public WebDriver driver;
@Test(priority = 0, enabled = true)

public void Login() {
Test something 1

@Test(priority = 1, enabled = true)

public void accountTab()  {
Test  something 2

@Test(priority = 2, enabled = true)

public void createAccount() throws InterruptedException  {
Test  something 3


I’m trying to run select tests from my class using an XML file rather than using the enable flag as I’m doing now. Or do I need to create separate classes for each test? I’m not sure of the XML configuration to do it.

Add Comment
1 Answers
Best answer

I founds a way to auto generate the XML then I added my tests:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE suite SYSTEM "">

<suite name="Suite qa" parallel="none">

<test name="accountTab">


<class name="FrameWork.SFAutomation"/>


<include name="Login"/>

<include name="Login"/>

<include name="createAccount"/>



</test> <!-- My Test -->

</suite> <!-- Suite qa -->

Train Answered on October 15, 2014.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.