Using Selenium Webdriver Selectors in Appium ios

前端 未结 3 1245
说谎
说谎 2021-01-24 06:41

A project I\'m on is developing a web app at the same time as an ios app (for the same thing) and I\'m hoping to be able to use existing Selenium tests, but we\'re having troubl

3条回答
  •  花落未央
    2021-01-24 07:14

    Didn't quite get the question but for Appium You have separated annotations for bot iOS and Android platform similar as for web via:

    @FindBy(id="buttonOK")
    private WebElement buttonPopUp;
    

    Here is example for Android and iOS

    @iOSFindBy(id = "lets_do_it")
    @AndroidFindBy(id = "message_popup_dismiss_button")
    @WithTimeout(unit = TimeUnit.SECONDS, time = 1)
    private MobileElement buttonPopUp;
    

    So in same pageObject you have covered both platforms.

    Mobile platform can work together, but recommendation is not to mix web and mobile, but mobile platforms can play together just fine, and is recommended so can share same code functionality.

提交回复
热议问题