Locator Strategy 'css selector' is not supported for this session issue with appium

前端 未结 2 1834
借酒劲吻你
借酒劲吻你 2020-12-20 01:21

Since I\'m new to mobile automation, I\'ve been trying to run simple activities using appium maven and eclipse. But When I try to run Calculator app opens but the elements a

2条回答
  •  情深已故
    2020-12-20 02:21

    By.name("text") is removed from Appium v1.5.0 onwards.

    Also just to add cssSelector strategy + methods like getAttribute("color/background") present in Selenium are not supported in Appium for native apps as these are not supported by underlying unit testing framework of Android i.e. UIAutomator.

    You can use below options for clicking digits of calculator

    driver.findElement(By.id(“com.android.calculator2:id/digit5”)).click();
    driver.findElement(By.xpath(“//android.widget.Button[contains(@resource-id,'digit5') and @text='5']”)).click();
    driver.findElementByAccessibilityId(“plus”).click();
    driver.findElement(By.xpath(“//android.widget.Button[@text='5']”)).click();
    

提交回复
热议问题