Open topic with navigation

# TestNG code samples (Java SDK)

In this topic:

## Simple TestNG test

The following is an example of a Java test to be used together with the suite XML file below.

Only the methods specified in the XML file will be launched.

    @Test
    public void testIE() throws GeneralLeanFtException {
    	String url = "www.hpe.com";
    	Browser browser = BrowserFactory.launch(BrowserType.INTERNET_EXPLORER);
    	browser.navigate(url);
    }

Suite XML:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >

    <suite name="suite1">
    	<test name="test1">
    	  <classes>
    		<class name="com.hp.leanft.examples.testng.SimpleTest">
    		<methods>
    			<include name="testIE"/>
    		</methods>
    		</class>
    	  </classes>
    	</test>
    </suite>

Back to top

See also:

- Parallel testing code samples (Java SDK)
- Lean Functional Testing (LeanFT) Java SDK Reference