This is My String in non framework, declared at the class level.

private final String fruits= "//a/h4[text()='%s']";

Which is used in same class in some method like this:

public void clickFruitHeading(String string) {, string)));, "Apple")));

But when using PageFactory it is written like this:

@FindBy(xpath = "//a/h4[text()='%s']")
private static WebElement fruits;

How to use String.format here?

Source link


Please enter your comment!
Please enter your name here