appium: Appium ionic app raise an error when trying to use move_by_offset method
The problem
I am automating an ionic application, the action which I am trying to perform is drag and drop of a range knob: ionic range knob The action which I am trying to perform does working correctly on the android app but it does not on the iOS app, for no real reason.
Environment
- Appium version (or git revision) that exhibits the issue: 1.21.0
- Last Appium version that did not exhibit the issue (if applicable): No
- Desktop OS/version used to run Appium: Mac OS 11.5.2
- Node.js version (unless using Appium.app|exe): v12.9.1
- Npm or Yarn package manager: 7.20.5
- Mobile platform/version under test: iOS
- Real device or emulator/simulator: Real Device
- Appium CLI or Appium.app|exe: cli
Details
When trying to perform on a slider WebElement the following action:
range_knob = node.find_element_by_class_name('range-knob')
action_chains = ActionChains(self.driver_)
action_chains.click_and_hold(range_knob).move_by_offset(xoffset, yoffset).release().perform()
An exception is being raised with the following message:
Message: The element identified by "5010" is either not present or it has expired from the internal cache. Try to find it again
Link to Appium logs
https://github.com/bwomsm1/AppiumLogs/blob/master/range_knob.log
Code To Reproduce Issue [ Good To Have ]
range_knob = node.find_element_by_class_name('range-knob')
action_chains = ActionChains(self.driver_)
action_chains.click_and_hold(range_knob).move_by_offset(xoffset, yoffset).release().perform()
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (4 by maintainers)
You could call ActionChains api with x/y coordinate (instead of an element) after switching the context with “NATIVE_APP”