xpath = //strong[text()='Review the information below, then click "Cancel this Order."']
说明:
@Locator(as=As.XPATH,use ="//strong[text()='Review the information below, then click "Cancel this Order.")
代码:
public List<PageElement> reviewTextElement;
public int count(){
int count= reviewTextElement.size();
return count;
}
答案 0 :(得分:0)
代码返回0,因为xpath未标识元素。如果您提到的xpath是正确的,则使用\"
周围的转义序列Cancel this Order
可以解决问题。
@Locator(as=As.XPATH, use ="//strong[text()='Review the information below, then click \"Cancel this Order.\"")