Web page layout is moving up when Ranorex script executed

Best practices, code snippets for common functionality, examples, and guidelines.
sureshkondapally
Posts: 6
Joined: Tue Apr 23, 2019 5:59 am

Web page layout is moving up when Ranorex script executed

Post by sureshkondapally » Tue Apr 23, 2019 7:14 am

I am using Ranorex 9 for my web application automation. It is a responsive web app developed using React. Everything is working fine when it is executed manually or even with Selenium, But when I execute my Ranorex script, the web page along with all its elements is getting moved up within the browser. Not sure why it is happening only with Ranorex execution.

Can someone please help me to understand why it is happening? Curious to know the execution process of Ranorex, like any java script is injected during execution or something else.

Thanks,
Suresh.

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

Re: Web page layout is moving up when Ranorex script executed

Post by odklizec » Tue Apr 23, 2019 7:51 am

Hi,

Unfortunately, without seeing your web page, or, at very lest, Ranorex snapshot (NOT screenshot) of the page, and xpath of the element at which action the page goes 'up', it's impossible to tell what's wrong. But my best bet is that the behavior you are describing is caused by Ensure Visible event, which is by default enabled for each recorded repo element. If you know the element, which is causing the problem, you can disable its Use Ensure Visible property in repository:
EnsureVisible.png
You do not have the required permissions to view the files attached to this post.
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

sureshkondapally
Posts: 6
Joined: Tue Apr 23, 2019 5:59 am

Re: Web page layout is moving up when Ranorex script executed

Post by sureshkondapally » Tue Apr 23, 2019 8:11 am

Hi odklizec,

Thanks for the response. Yes your solution worked for me.

Also I found another solution to this problem, I have used PerformClick () instead Click() and it worked perfect without disturbing the layout.

So the learning here is better to use PerformClick() or make EnsureVisible to False for Responsive containers/designs.

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

Re: Web page layout is moving up when Ranorex script executed

Post by odklizec » Tue Apr 23, 2019 8:31 am

Hi,

By careful about using PerformClick action! This action does not trigger mouse events, which is especially a problem for web-based apps. And generally speaking, PerformClick is not exactly user-like action. So use it with caution and only if you know for sure, it does not have any side effects ;)
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

sureshkondapally
Posts: 6
Joined: Tue Apr 23, 2019 5:59 am

Re: Web page layout is moving up when Ranorex script executed

Post by sureshkondapally » Tue Apr 23, 2019 8:47 am

Okay, got you.

Also, Is there any global setting available for all elements of all repositories to make Ensure Visible to False. I got many elements and it would be difficult to do that for each individual element.

Thanks,
Suresh.

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

Re: Web page layout is moving up when Ranorex script executed

Post by odklizec » Tue Apr 23, 2019 9:01 am

Hi,

Yes, there is such option in Ranorex Settings.
EnableCaching.png
You just have to make sure that all repository folders has Use cache parameter set to Default (default setting) and not explicitly set True of False. Default means, that Ranorex uses global configuration from Settings. So if unchecked in Settings, all repo folders will have Use Cache disabled.
You do not have the required permissions to view the files attached to this post.
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

sureshkondapally
Posts: 6
Joined: Tue Apr 23, 2019 5:59 am

Re: Web page layout is moving up when Ranorex script executed

Post by sureshkondapally » Wed Apr 24, 2019 7:09 am

Okay, Thank you.