-1
xpath = //strong[text()='Review the information below, then click "Cancel this Order."']
如何断言是否有2个webelements?
描述:
- 利用上述的xpath 2个元件得到使用firepath位于在Firefox。
- 我想断言页面中是否有2个可用元素。
- 尝试用下面的代码,但它返回0;
@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;
}
它看起来像在xpath中缺少关闭']'提供HTML代码来帮助您使用xpath –