How to pass the variable in xpath by using @FindBy?

To read the particular row data in table, i am using the xpath as

String sRow = “2”;

String rdata =

driver.findElement(By.xpath(“/html/body/div[1]/div[2]/div/div[2]/article/div/table/tbody/tr[“+sRow+“])).getText();
But, how can we write the xpath for the above scenario in @FindBy ?
Default Asked on February 9, 2018 in Selenium WebDriver.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.