question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Appium ionic app raise an error when trying to use move_by_offset method

See original GitHub issue

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()

15_31_43_before_teardown

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
KazuCocoacommented, Sep 13, 2021

You could call ActionChains api with x/y coordinate (instead of an element) after switching the context with “NATIVE_APP”

0reactions
jlippscommented, Sep 14, 2021

If you want to perform native touch actions on web elements, you will also need to map the web coordinate space to the native coordinate space, as they are not the same. You can do this by getting the rect of the WebView element and using it to relative the web coordinates reported inside the webview.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Actions - perform() method not working in iOS ionic app on ...
Hi All, I'm trying to enter data in text fields(username and password) using actions method in ionic app. The below code is used....
Read more >
java - perform() method not working in iOS ionic app on textfields
I'm trying to enter data in text fields(username and password). I tried 2 approaches, 1. sendkeys(),. Issue: it didn't entered ...
Read more >
How to Fix Common Errors with Appium Testing Framework
In this blog series, we will disclose to you the possible errors one might encounter using Appium. Let's begin. Error #1. Could not...
Read more >
Conflict between ionic serve and appium · Issue #6956 - GitHub
The problem Selenium Webdriver fails at createSession if ionic serve is running. ... Node.js version (unless using Appium.app|exe): 4.4.5 ...
Read more >
Simulating Mouse movement and dragging in a UWP ...
I am trying to write some highly customized UI testing code for windows UWP apps. I am using Appium and so far I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found