Skip to content

Instantly share code, notes, and snippets.

Created May 19, 2015 13:40
Show Gist options
  • Save anonymous/29246c0de32f9290388e to your computer and use it in GitHub Desktop.
Save anonymous/29246c0de32f9290388e to your computer and use it in GitHub Desktop.
@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