我是完美移动设备自动化的新手。我遇到了一个名称字段,它在应用程序的两行中返回值。像下面
School Name : ABCD
INTERNATIONAL
我发现定位器是 Xpath 为 //*[text()="ABCD INTERNATIONAL"],它在两行中返回值,当我运行代码并断言该值时,我确认了这一点。所以基本上错误如下
expected [ABCD INTERNATIONAL] but found [ABCD
INTERNATIONAL]
我的功能文件就像
Feature: Verify the school Details
Scenario : Verify the school Name
Given User logs into Application
When User verifies the school name as "ABCD INTERNATIONAL"
Then user logs of
步骤防御:
@When("User verifies the school name as {string}")
public void a_User_verifies_the_school_name_as (String Name) throws Exception {
String School_Name = utility.getText(appiumDriver, "//*[text()="ABCD INTERNATIONAL"]);
Assert.assertEquals(School_Name, Name);
}
您对解决这个问题的帮助意义重大。