Child Class
public class US_FranchisePartner_English extends SuperTestNG
{
@Test(retryAnalyzer = Retry.class)
public void testFP_US_English()
{
System.out.println("***********************FranchisePartner_US_English_TransformationManager Pack***********************");
Select country = new Select(driver.findElement(By.xpath("//select[@ng-model='selectedCountry']")));
country.selectByIndex(7);
Select language = new Select(driver.findElement(By.xpath("//select[@ng-model='settings.locale']")));
language.selectByIndex(0);
new HomePage(driver).Selectbusinessfp();
new BasePage(driver).Continue();
new InitialOrderPage(driver).TransformationManager();
}
@Test(retryAnalyzer = Retry.class)
public void testFP_US_Spanish()
{
System.out.println("***********************FranchisePartner_US_Spanish_TransformationJr.Manager Pack***********************");
Select country = new Select(driver.findElement(By.xpath("//select[@ng-model='selectedCountry']")));
country.selectByIndex(7);
Select language = new Select(driver.findElement(By.xpath("//select[@ng-model='settings.locale']")));
language.selectByIndex(1);
// click continuar button in INICIO page
new BasePage(driver).Continuar();
// click on Gerente Jr. de Transformacion pack in ORDEN INICIAL
new InitialOrderPage(driver).GerenteJrdeTransformacion();
}
@Test(retryAnalyzer = Retry.class)
public void testPC_US_English()
{
System.out.println("***********************PreferredCustomer_US_English_Transformation Pack***********************");
Select country = new Select(driver.findElement(By.xpath("//select[@ng-model='selectedCountry']")));
country.selectByIndex(7);
Select language = new Select(driver.findElement(By.xpath("//select[@ng-model='settings.locale']")));
language.selectByIndex(0);
// click on preffered customer radio button
new HomePage(driver).Selectbusinesspc();
// click on continue button in homepage
new BasePage(driver).Continue();
// click on transformation pack radio button in initial order page
new InitialOrderPage(driver).Transformation();
}
}
Parent Class
@BeforeMethod(alwaysRun=true)
public void beforeMethod() {
System.setProperty("webdriver.chrome.driver","C:/Users/sumancb/Downloads/chromedriver_win32_19/chromedriver.exe");
driver = new ChromeDriver();
// maximize the chrome browser
driver.manage().window().maximize();
// Time to wait for visible elements
driver.manage().timeouts().implicitlyWait(20,TimeUnit.SECONDS);
// enter the test url
driver.get("http://enroll.ng.unicityqa.com/master/build/#/enroll/start");
}
@AfterMethod(alwaysRun=true)
public void afterMethod() {
JavascriptExecutor IOpage2 = (JavascriptExecutor)driver;
IOpage2.executeScript("scroll(0, 250)");
JavascriptExecutor IOpage4 = (JavascriptExecutor)driver;
IOpage4.executeScript("scroll(0, 250)");
driver.findElement(By.xpath("(//button[@ng-click='searchProducts = search_all'])[2]")).click();
JavascriptExecutor IOpage1 = (JavascriptExecutor)driver;
IOpage1.executeScript("scroll(0, 250)");
driver.findElement(By.xpath("(//span[text()='ADD'])[1]")).click();
JavascriptExecutor IOpage3 = (JavascriptExecutor)driver;
IOpage3.executeScript("scroll(0, 250)");
driver.findElement(By.xpath("(//span[text()='Suggesfdsgsted products'])[1]")).click();
JavascriptExecutor IOpage43 = (JavascriptExecutor)driver;
IOpage43.executeScript("scroll(0, 250)");
driver.findElement(By.xpath("(//span[text()='ADD'])[1]")).click();
driver.close();
}