Xpath Indexing not working

178 views
Skip to first unread message

Praveen Kumar

unread,
Nov 29, 2018, 8:38:22 AM11/29/18
to qaf users
Hi chirag,

We are writing xpath with index as mentioned below and same is not working in QAF framework.Please let us know if this framewrok supports this kind of format, if not what is the alternative way of using it.

EX : @FindBy(locator = "(//h2/span[contains(text(),'Pending Transactions')]/following::div/p)[1]")
private QAFWebElement msg_PendingTransactions;

Thanks in advance

Praveen.

cjayswal

unread,
Nov 29, 2018, 12:10:44 PM11/29/18
to qaf-...@googlegroups.com
Is it working with selenium IDE? or in code like driver.findElement(By.xpath("loc"))? If yes then it should work with FindBy as well.
Another observation is, you are missing to provide locator strategy while providing locator string.  for example:
instead of
@FindBy(locator = "locator-value")
it should be
@FindBy(locator = "strategy=locator-value")

in your case you need to use xpath as strategy
@FindBy(locator = "xpath=(//h2/span[contains(text(),'Pending Transactions')]/following::div/p)[1]")




गुरुवार, 29 नवंबर 2018 को 5:38:22 पूर्व UTC-8 को, Praveen Kumar ने लिखा:

Praveen Kumar

unread,
Nov 30, 2018, 6:08:08 AM11/30/18
to qaf users
It’s working fine now .. Thanks Chirag
Reply all
Reply to author
Forward
0 new messages