-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 –