-
-
Save anonymous/29246c0de32f9290388e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test(priority=2) | |
public void method() | |
{ | |
objThirdClass.action1(); | |
System.out.println("after action"); //-> This line is being printed | |
objThirdClass.action2(param1, param2, param3); | |
} | |
public class ThirdClass { | |
WebDriver driver = Driver.AppDriver.getInstance(); | |
public ThirdClass(){ | |
//This initElements method will create all WebElements | |
PageFactory.initElements(driver, this); | |
} | |
@FindBy(xpath=<xpath>) | |
WebElement elementCreate; | |
@FindBy(id=<id1>) | |
Select selectElement1; | |
@FindBy(id=<id2>) | |
Select selectElement2; | |
@FindBy(id=<id3>) | |
Select selectElement3; | |
@FindBy(id="submit") | |
WebElement elementSubmit; | |
public void action1() | |
{ | |
JavascriptExecutor executor2 = (JavascriptExecutor)driver; | |
executor2.executeScript("arguments[0].click();", elementCreate); | |
System.out.println("Create link found"); | |
} | |
public void setElement1(String str1) | |
{ | |
selectCourse.selectByVisibleText(str1); | |
} | |
public void setElement1(String str2) | |
{ | |
selectCourse.selectByVisibleText(str2); | |
} | |
public void setElement1(String str3) | |
{ | |
selectCourse.selectByVisibleText(str3); | |
} | |
public void submit() | |
{ | |
submit.click(); | |
} | |
public void action2(String string1, String string2, String string3,) | |
{ | |
this.setElement1(str1); | |
this.setElement2(str2); | |
this.setElement3( str3) | |
this.submit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment