appium-inspector icon indicating copy to clipboard operation
appium-inspector copied to clipboard

Interactions are not available for this element

Open sebahart opened this issue 2 years ago • 1 comments

Appium Server GUI + Appium inspector.

The problem

I can´t access to any element on the page using appium inspector. Can´t find any element by xpath, class, id, etc, Can´t send keys, clicks, etc.

Screenshot of the issue: 1

Can anyone help me?

Environment

  • I am running Appium Server version, Appium-Server-GUI-windows-1.22.2.
  • I am on (pick one):
    • [ ] Mac
    • [x ] Windows
    • [ ] Linux

sebahart avatar Mar 29 '22 19:03 sebahart

Oftentimes this means we couldn't locate the element with precision, i.e., something about its path changed or didn't match what was in the source. A refresh might help. Or ensuring that the elements have identifiers.

jlipps avatar Mar 29 '22 22:03 jlipps

Is there an update on this problem?

bzhechkov avatar Nov 01 '22 15:11 bzhechkov

We're having the same issue on this. Is there any workarounds for the same?? Is there anything that our dev team can work upon to make this go away??

I can get Xpath but script is unable to locate this and eventually, fail. image

AtulKrSharma avatar Nov 13 '22 05:11 AtulKrSharma

I also have the same problem

YahyoMahmudov avatar Nov 24 '22 12:11 YahyoMahmudov

Does this still happen when you refresh the source and click on the element again? The point of this message is to ensure that the element you selected in the source is actually the same element that you intend.

Imagine a scenario like the following:

  1. You get the page source
  2. Behind the scenes, the app hierarchy changes
  3. You select an element in the page source
  4. Appium finds information about that element, but can't conclude with 100% certainty that it is the same element you selected, since the element now has a different path in the hierarchy given that the hierarchy changed

The root cause could be an app that doesn't have a stable hierarchy, i.e., it is always changing.

So far Appium has prioritized consistency and safety. I could remove this check, but it might mean that the element you are interacting with is not exactly the one you selected.

Unfortunately there's no easy way to prevent the race condition described above.

jlipps avatar Nov 28 '22 19:11 jlipps

I am also facing the same issue when I run Appium inspector in the iPhone on the other hand Android is working properly

cdk-rn avatar Apr 05 '23 10:04 cdk-rn

I also have the same issue, apparently it's something in the app that doesn't allow the elements to be interactive, but it only happens with iOS. With Android I don't have that problem. Has anyone been able to solve this problem?

bustahxc avatar May 03 '23 19:05 bustahxc

@eglitise @KazuCocoa what do you think? should we remove the stale element guard so users don't run into this "interactions are not available" message? or maybe just replace it with a warning but keep the buttons active? that would probably be my vote. something like: "Warning; could not verify that the selected element is still attached". If they click "tap" or whatever, a stale element exception might result. But that could be less confusing for the user I guess.

jlipps avatar May 03 '23 21:05 jlipps

Yea, showing an exception message would be better than blocking them completely. Actually, such an exception is by timing/product code side implementation related. In such case, maybe getting exact error message would help their test scenario writing

KazuCocoa avatar May 04 '23 05:05 KazuCocoa

Fully agree with @KazuCocoa, it may even unblock actions for some apps, and keeping the warning means the user would (or at least should) not be surprised if an exception is raised.

eglitise avatar May 04 '23 11:05 eglitise

OK, let's just remove the whole element interaction availability guardrails then

jlipps avatar May 05 '23 17:05 jlipps

I also have the same issue, apparently it's something in the app that doesn't allow the elements to be interactive, but it only happens with iOS. With Android I don't have that problem. Has anyone been able to solve this problem?

same on my side too, any ideas how to workaround on this

jaffarAvoMD avatar May 08 '23 10:05 jaffarAvoMD

I also have the same issue, apparently it's something in the app that doesn't allow the elements to be interactive, but it only happens with iOS. With Android I don't have that problem. Has anyone been able to solve this problem?

same on my side too, any ideas how to workaround on this

I migrated from appium 1 to 2 and was able to solve the problem. Check the documentation https://appium.io/docs/en/2.0/guides/migrating-1-to-2/

bustahxc avatar May 09 '23 20:05 bustahxc

Version 2023.5.2 includes changes that may help resolve this. Even if the warning is shown, the buttons will not be disabled anymore. This doesn't mean that interactions are guaranteed to work - you may still receive an error, but it will be coming from the driver, not the Inspector.

eglitise avatar May 30 '23 20:05 eglitise

try adding testid for it's parent components and test the targeted one

shaikhkhamroddin avatar Oct 23 '23 05:10 shaikhkhamroddin