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.

[Question] Is there a way to identify if an element is intractable?

See original GitHub issue

I can use IntersectionObserver (elementHandle.scrollIntoViewIfNeeded()) to understand if the element is in viewport but it doesn’t help if the element is behind an overlay/dialog. Is there some function that I can use to confirm if the element that I am going to perform an action upon is actually present in the view.

Something like: page.isInView(selector/xpath) and return the element.boundingBox.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
VikramTiwaricommented, Feb 10, 2020

Ah! I understand the confusion. It would be great to have a function which could tell the state of the element. Right now we have waitForSelector but it triggers even when the element is not in view. It would be very useful to

  • have a function which tells the state of an element, or
  • a set of functions which wait for an element to get into a state

These states could be:

  • in the DOM tree: already present
  • in the viewport: already present
  • visible to the user: element is not behind a sticky header, or not hidden behind a dialog box etc
  • user can interact: element is not disabled, or hidden behind a translucent overlay etc

I think they will be very helpful because they would give the exact state of an element and thus allow better understanding. Even better if I could attach a listener on the page for a specific selector and it would trigger these different events as an element cycles through them.

As for a specific use cases:

  • I was trying to click on element-2 which appeared in view after clicking on element-1 + an uncertain amount of animation time.
  • I was trying to click on a text which was hidden behind a sticky header
0reactions
VikramTiwaricommented, Feb 27, 2020

Click free from sticky headers is fantastic. Thanks! 😃

Regarding event listener addition, what are the inefficient ways? haha I was unable to find anything at all in this case. For example: getEventListeners(domElement) was of no use.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Intractability - Algorithms, 4th Edition
We say that a problem is intractable if there is no polynomial-time algorithm ... While it is easy to check a proposed solution...
Read more >
Element Not Intractable error with Selenium and Java
Need to identify the actual cause. try the following way to debug : make sure you have the single element with the locator ......
Read more >
Intractable Problems
A problem is called intractable iff there is no efficient algorithm that solves it. ○ Intractable problems are common. We need to discuss...
Read more >
Selenium exception: element not intractable
The problem is, your radio button is clickable at some other point. So you need to clearly identify the clickable element in your...
Read more >
How do I resolve the ElementNotInteractableException in ...
If developer has developed website in a such way like element is not interact then find it's parent element and using xpath child...
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