我正在为我的项目使用页面工厂设置,其中有以下内容:
@FindBy(how=How.XPATH,using="//*[contains(@text,'Monthly Pass')]")
private WebElement monthlyPass;
@FindBy(how=How.XPATH,using="//*[contains(@text,'Ten Ride Ticket')]")
private WebElement tenRideTicket;
@FindBy(how=How.XPATH,using=""./parent::android.view.View/following-sibling::android.view.View[1]/android.view.View[2]")
private WebElement AmountForThePass;
public void getAmountValue(){
if(monthlyPass.isDisplayed){
// Here I want to findElement 'AmountForThePass' from the element 'monthlyPass'
// The actual element is //*[contains(@text,'Monthly Pass')]/parent::android.view.View/following-
// sibling::android.view.View[1]/android.view.View[2]
// which I have broken into 2 parts.The second part 'AmountForThePass' is same for other
// 'tenRideTicket'
}
}
如何结合 WebElements(monthlyPass 与 AmountForThePass)或(tenRideTicket 与 AmountForThePass)