Not able to click on object as it is under fixed header

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
vivek.guvva
Posts: 31
Joined: Mon Feb 22, 2016 7:21 pm

Not able to click on object as it is under fixed header

Post by vivek.guvva » Tue Mar 08, 2016 8:42 pm

Hi,

I have a problem on clicking the object as it is under a fixed header. Some times, when I scroll after clicking on one object, the next object is going under a fixed header. Spy is recognizing the object but not able to click on that one as it is under a fixed header. Is there any way that we can move the element to down side below the fixed header so that we can click on the object. Attached snapshot for reference. Immediate help is appreciated.

Thanks
Vivek
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Not able to click on object as it is under fixed header

Post by odklizec » Wed Mar 09, 2016 8:31 am

Hi,

Usually, I would suggest to try EnsureVisible, which should bring the element in question to the visible area of screen. But this will most probably not help in this particular case, because the problematic element is actually set as 'visible' ;) Another thing you should try is to hide the header before clicking items. Is there a way to hide the header?

If the header cannot be hidden, then the only reasonable thing you can do is to use PerformClick method instead of mouse Click. The difference between these two actions is that the PerformClick invokes click action on given element without using mouse. However, it's recommended to use this method only if there is really no way to use Mouse click, because it's not exactly 'user-invoked' action and it may not invoke some behind-the-scene events (like 'on mouse click'). So you should be really careful about using this method!

Anyway, I think your problem is caused by a bad design of the app under test. The header should not cover clickable elements and if it does, the elements under header should be set as invisible and there should be a way to make them accessible (i.e. scroll them to view). Looking at the snapshot, it seems that if the header is visible, there are always some 'covered' items, which cannot be mouse-clicked? And this is definitely wrong GUI design or implementation.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

brgibb
Posts: 39
Joined: Wed Jun 05, 2013 2:15 pm

Re: Not able to click on object as it is under fixed header

Post by brgibb » Mon Sep 05, 2016 10:41 am

I have this exact same problem with a Website developed using Metronic (Keenthemes).

The header is "fixed" in the .css and it causes all sorts of issues for Ranorex when trying to click elements.

The problem for me more often than not is that even though the element to be clicked is in view right in front of you, the Click() often scrolls before actually clicking. This pushes the element under the header and thus out of reach.

Until now I have had to set Adapter.DefaultUseEnsureVisible = false; and then back to true again afterwards, but now as the number of tests has increased the data in the system this "solution" is unsustainable.

I am now going to get Dev to alter the .css but the apparent random need for scroll prior to Click() by Ranorex is an issue....

asdf
Posts: 174
Joined: Mon Mar 21, 2016 3:16 pm

Re: Not able to click on object as it is under fixed header

Post by asdf » Fri Sep 09, 2016 12:33 pm

Hi all,

Could you try if a PerformClick works on these elements?
Therefore, just add a new Invoke-action and choose PerformClick() in the dropdown.

Hope this helps.

Kind regards,
asdf

brgibb
Posts: 39
Joined: Wed Jun 05, 2013 2:15 pm

Re: Not able to click on object as it is under fixed header

Post by brgibb » Thu Sep 15, 2016 1:30 pm

As Pavel states above it is not really mimicking correct user actions to use PerformClick();

For me this is actually a bug in Ranorex rather than any discrepancy in the development.

Ranorex seems to scroll the interface when it doesn't need to during Click(); operations....simple. The usedefaultensurevisible setting is on the face of it "too clever".

I have countless examples of where an element is visible, right in the middle of the screen and all Ranorex needs to do is move the mouse and click yet the interface scrolls about just prior to the click, moving the position of the element unnessarily.

Note: I am using Ranorex 5.03.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Not able to click on object as it is under fixed header

Post by krstcs » Thu Sep 15, 2016 2:04 pm

First and foremost, the last version of Ranorex 5 was 5.4.6. The currently supported versions are 6.0.2 and 6.1.0. Please updated to a supported version (or at least 5.4.6) as many improvements and bug fixes have been made.

Also, note how the version number is formatted, there is no 5.03, but there is a 5.0.3 and a 5.3.0. Without the correct and full version number it is hard to know exactly which version you are using and, therefore, which bugs you might be encountering and which ones are fixed in later versions.

Finally, this is not purely a Ranorex issue. There are certain limitations that Ranorex must work within. Some of these are OS-related, some are AUT-related. Sometimes there's just nothing Ranorex can do. In this case however, there WERE issues with how EnsureVisible worked in some early versions of 5.X, but, as noted above, they have been fixed to a great degree by later versions. So, again, please update before bringing up issues, otherwise much of our help may not actually do any good because it may not be applicable to older versions.
Shortcuts usually aren't...

brgibb
Posts: 39
Joined: Wed Jun 05, 2013 2:15 pm

Re: Not able to click on object as it is under fixed header

Post by brgibb » Mon Sep 19, 2016 12:02 pm

krstcs,

Apologies for my formatting error: 5.0.3.18203 is the version I meant to write and I appreciate that it is quite old. And thank you for your somewhat short reply.

If there are updates to this functionality that will ease my pain, then I'm very keen to hear about them.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Not able to click on object as it is under fixed header

Post by krstcs » Mon Sep 19, 2016 1:32 pm

My suggestion would be to update to 6.0.2 or 6.1.0 and see if it fixes the issue. Other than that, we are not going to be much help.


NOTE: Ranorex 6.X will update the project files to a format that is no longer supported by previous Ranorex versions (5.4.6 or earlier), so make sure that you are using a software version control system (you should be doing this already anyway!!), or make a backup copy of the project first.
Shortcuts usually aren't...

User avatar
Aracknid
Posts: 388
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Not able to click on object as it is under fixed header

Post by Aracknid » Wed Sep 21, 2016 3:24 pm

Hi,

I started using Ranorex back in version 2 or 3 (can't remember anymore), and this 'problem' with fixed DIV 'headers' on web-pages was always causing me problems. I bit the bullet a long time ago and wrote my own code to 'make my items visible' by checking its top and bottom values and doing the math to calculate the area of visibility, and scrolling it into view myself. This allowed me to use click(). This code ended up being reusable (after modifications) for other places, specifically in our custom tables, which also had column headers that were fixed divs, and the scrollbars within the tables often overlapped the visible area too. (Note that different browsers handled this differently too, so I had to add logic for this as well).

I wish there was some way Ranorex could figure out the actual visible area that we see with our eyes, and do this for us. But so far, they have not to my knowledge. I brought this up years ago....
http://www.ranorex.com/forum/prevent-sc ... t2555.html

Since I have my own way of dealing with this, I never bothered to check if it has been changed in newer versions (but I doubt it). If you have the time and the skill, I'd suggest you look into doing this yourself.

Aracknid.

dkmpbrt
Posts: 33
Joined: Thu Jan 25, 2018 9:00 am
Location: Antwerp
Contact:

Re: Not able to click on object as it is under fixed header

Post by dkmpbrt » Fri Aug 03, 2018 9:03 am

I have the same problem, i'm using Ranorex version 7.2.1.

I've tried adding the PerformClick() invoke action trough the userinterface but it won't let me choose it. I've then chosen EnsureVisible() and changed it manually to PerformClick(), however , the log said it clicked on it, but it did nothing...

asdf
Posts: 174
Joined: Mon Mar 21, 2016 3:16 pm

Re: Not able to click on object as it is under fixed header

Post by asdf » Thu Aug 09, 2018 3:30 pm

I have the same issue and I think the only thing you can do here is to scroll every time the navigation bar is blocking an element. The other option would be to create a new test environment where you disable this fixed header.