How do I store the location of an element in mobile apps
This example demonstrates how to store an element's location.
The solution shown below will show you how to store the element location in HICC using the storeElementLocation command.
This command returns the location of the target element in the form of X and Y coordinates in pixels.
Solution:
# | Command | Target | Value |
---|---|---|---|
Store the element location for drop area | |||
1 | storeElementLocation | id=com.eureqa.eureqaprod:id/dropArea | elementLocation |
2 | echo | ${elementLocation} |
Tips, Tricks, Gotchas & Best Practices:
- You can reuse the value of the stored variable to perform further actions like dragAndDrop, swipe, etc., and also verify the element’s new location with assertElementLocation, verifyElementLocation and waitForElementLocation commands.