Android 量角器定位器在PageObjectModel结构中不起作用
框架:Appium+量角器+Cucumber+使用POM模型的TypescriptAndroid 量角器定位器在PageObjectModel结构中不起作用,android,typescript,protractor,appium,Android,Typescript,Protractor,Appium,框架:Appium+量角器+Cucumber+使用POM模型的Typescript 我用POM结构设计了appium的量角器框架 应用程序的初始页面将识别在不同ts文件中调用的定位器,以及在不同ts文件中调用的tap、ISD等功能 但一旦它通过应用程序中的初始页面,比如说3页。没有标识调用其他函数的定位器,但直接传递它们时会标识它们(如driver.findelelements(by.css(“”))。单击)这样做有效 问题是我不能总是在step definition.ts文件中这样传递代码
- 我用POM结构设计了appium的量角器框架
- 应用程序的初始页面将识别在不同ts文件中调用的定位器,以及在不同ts文件中调用的tap、ISD等功能
- 但一旦它通过应用程序中的初始页面,比如说3页。没有标识调用其他函数的定位器,但直接传递它们时会标识它们(如driver.findelelements(by.css(“”))。单击)这样做有效
- 问题是我不能总是在step definition.ts文件中这样传递代码,因为它不是一个好的结构
})) 由于页面出现故障,自动化会将其视为非角度页面,而定位器在不同的函数中调用时会失败或无法定位它们。当我引入browser.ignoresynchronization=true来为非角度应用程序/页面进行角度同步时,它起作用了。由于页面出现故障,自动化将其视为非角度页面,并且在不同的函数中调用时,定位器用于故障或无法定位它们。当我引入browser.ignoresynchronization=true来为非角度应用程序/页面进行角度同步时,它起到了作用。我发现很难想象您所描述的代码。你能提供一个页面对象函数的示例以及如何调用它(包括一个有效的调用和一个无效的调用)@DublinDev谢谢你的评论,我已经用代码示例更新了摘要,该代码示例有效,但无效。如果你需要更多的信息,请告诉我。期待一些评论/帮助/建议我发现很难描绘出您所描述的代码。你能提供一个页面对象函数的示例以及如何调用它(包括一个有效的调用和一个无效的调用)@DublinDev谢谢你的评论,我已经用代码示例更新了摘要,该代码示例有效,但无效。如果你需要更多的信息,请告诉我。期待您的评论/帮助/建议
Then(/^VIC should be selected from the state or territory drop down$/, async () => {
await browser.driver.findElement(by.css('button[sp-automation-id=\'select-state-toggle\']')).click();
await browser.driver.findElement(by.css('page-action-sheet label[sp-automation-id=\'action-sheet-option-VIC\']')).click(); });
Then(/^VIC should be selected from the state or territory drop down$/, async () => {
await AutomationAction.tap(Onboarding.State);
await AutomationAction.tap(Onboarding.VIC); });
Then(/^I enter the mobile number and tap next button on the your mobile number screen$/, async () => {
MobileNo = AutomationAction.getMobileNumber("mobileNumber");
SameMobileNo = MobileNo;
await AutomationAction.sendKeyText(Onboarding.InputMobileNo,MobileNo);
await AutomationAction.tap(Onboarding.Next_BTN_YourMobileNumber);