Search code examples
androidappiumsaucelabs

Appium locators don't work with saucelabs Android


I have UI component:

<Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Fire Event"
            android:id="@+id/fireEvent"
            android:layout_below="@+id/buttonViewKruxWebPage"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_marginTop="43dp" />

And I want to find it using Appium ID locator: driver.findElement(By.id("fireEvent")). It works fine locally but Appium cannot find it on Saucelabs. Locally and Remotely on Sauselabs both cases I have Appium 1.4.0. Also i have tried variant of lacator:
driver.findElement(By.id("com.example.package:id/txtLogin"))


Solution

  • How long do you wait for element to appear in findElement method? It is possible that Saucelabs has bigger delays so I would suggest to increase time-outs and see what happens.