Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <!-- <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> -->
- <suite name="Suite" parallel="classes" thread-count="2">
- <test name="NavigationTest">
- <classes>
- <class name="Test1" />
- <class name="Test2" />
- </classes>
- </test>
- </suite>
- public class Test1 {
- loginToUserPage(strUserName, strPassword);
- }
- public class Test2{
- loginToUserPage(strUserName, strPassword);
- }
- public class Test3
- {
- public void loginToUserPage(String strUserName,String strPassword)
- {
- webdriverCommon.windowMaximise();
- webdriverCommon.sendElement(CommonRepo.userName_Edit, strUserName);
- webdriverCommon.sendElement(CommonRepo.password_Edit, strPassword);
- webdriverCommon.clickElement(CommonRepo.logginButton_buttton);
- }
- }
- public class TestBase {
- protected WebDriver driver;
- protected String baseUrl = "http://example.com/";
- protected String hubUrl = "http://localhost:4444/wd/hub";
- @Before
- public void setUp() throws Exception{
- try {
- DesiredCapabilities capability = DesiredCapabilities.chrome();
- driver = new RemoteWebDriver(new URL(hubUrl), capability);
- }
- catch (Exception e){
- System.setProperty("webdriver.chrome.driver", "C:\Selenium\chromedriver.exe");
- driver = new ChromeDriver();
- }
- driver.manage().deleteAllCookies();
- driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
- }
- @After
- public void tearDown() throws Exception{
- driver.quit();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement