Hey gauge folks,
I am a Twer in Xi’an China. Nowadays I am playing with gauge. Now I am facing a problem.
Here’s my page segment:
@FindBy(how = How.LINK_TEXT, linkText = category)
public WebElement q_powerBankCategory;
public void chooseCategory(String catetory) {
q_powerBankCategory.click();
}
My problem is category. I want to pass category as a parameter to FindBy to locate the element. How can I do this?
Thanks
@FindBy(how = How.LINK_TEXT, linkText = "linkTestText")
public WebElement q_powerBankCategory;
public void chooseCategory(String category) { q_powerBankCategory.click();
}
public WebElement q_powerBankCategory;
public void chooseCategory(String category) {
q_powerBankCategory.findElement(By.linkText("linkTestText"));
q_powerBankCategory.click();
}
FirefoxDriver firefoxDriver = new FirefoxDriver();
firefoxDriver.get("https://www.google.co.in");
WebElement settings = firefoxDriver.findElement(By.linkText("Settings"));
System.out.println(settings.getText());