Execution gets slow over time

Ranorex Spy, Recorder, and Studio.
colutti
Posts: 18
Joined: Wed Nov 21, 2012 2:42 pm

Execution gets slow over time

Post by colutti » Tue Mar 19, 2013 10:50 pm

We have almost 300 Ranorex test cases.

When I run all of them, the tests gets slower and slower over time. The first N tests execute at normal speed, but the (300 - N) test are executed very, very slow.

I tried different machines and the issue occurs on all of them.

Even on my machine, during the day, it gets slower after some tests executed. I have set this code to try to speed the tests up:

Mouse.DefaultMoveTime = 0;
Keyboard.DefaultKeyPressTime = 0;
Delay.SpeedFactor = 0.0;
Mouse.DefaultClickTime = 0;

When it gets slow, the mouse moves slow, the clicks take a long time to perform and so on.

Do you guys have any idea what can be happening?

Using the latest Ranorex version.
All my tests cases open Firefox, test some stuff and close Firefox (but I have tested with chrome and the same thing occurs)
If I reset the machine, all my tests run at the speed they should have. But after some time, the issue occurs again and I have to restart the machine.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Execution gets slow over time

Post by Support Team » Wed Mar 20, 2013 5:16 pm

Hello,

Could you please verify if the memory usage is getting higher during your test?
Could you please verify if the CPU usage is getting higher?
Does it happen at the same test case every time?

Is it possible to get a sample application in order to analyze this issue?

Regards,
Markus (T)
.
Image

colutti
Posts: 18
Joined: Wed Nov 21, 2012 2:42 pm

Re: Execution gets slow over time

Post by colutti » Wed Mar 20, 2013 7:34 pm

I just figure out what was the problem. When running my tests in debug mode it gets slow over time. Running without debugging it does not happen (ctrl + f5). Some question:

1 - Why does this happen?
2 - Is there a fix for it?
3 - Is it possible to always run without debug not having to use CTRL + F5? Maybe there is an way to set it pragmatically.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Execution gets slow over time

Post by Support Team » Thu Mar 21, 2013 2:06 pm

Hello,

Could you please provide us more information?
Which Ranorex version do you use?
Do you have Visual Studio installed on the same machine where Ranorex Studio is installed?

You could simply start your test with the EXE file of your test.
We would really need your test to reproduce your issue.
You could send it to [email protected].

Regards,
Markus (T)
.
Image

fimo420
Posts: 55
Joined: Wed Jun 20, 2012 9:49 am

Re: Execution gets slow over time

Post by fimo420 » Fri Jul 12, 2013 12:02 pm

Hi,

Borrowing the thread since i've noticed the same issue.
I have like 700 iterations of one testcase and the test that took 20 s takes 40-50 s after 200 iterations.
I havent tried without debug yet, i'll get back to you when the test is done and then rerun without debug.

Is that the solution? to run without debug or from exe?

Info:
Ranorex latest 4.05
have visual studio installed
webb test on firefox browser version 22

colutti
Posts: 18
Joined: Wed Nov 21, 2012 2:42 pm

Re: Execution gets slow over time

Post by colutti » Fri Jul 12, 2013 12:41 pm

Well. I tried many things and nothing have worked. Besides, I am having a lot of issues with ranorex regarding page load and script load. It seems that ranorex is not able to wait until the page finishes loading and I have tried a lot of things. Because of that I gave up and I am going back to selenium.

I am sorry, but i cant help you.

fimo420
Posts: 55
Joined: Wed Jun 20, 2012 9:49 am

Re: Execution gets slow over time

Post by fimo420 » Fri Jul 12, 2013 1:30 pm

colutti wrote:Well. I tried many things and nothing have worked. Besides, I am having a lot of issues with ranorex regarding page load and script load. It seems that ranorex is not able to wait until the page finishes loading and I have tried a lot of things. Because of that I gave up and I am going back to selenium.

I am sorry, but i cant help you.
Thats sad, havent the support team given any solution?
About your pageload issue, maybe you have tried, but for me it works fine with waituntil something arrives?

colutti
Posts: 18
Joined: Wed Nov 21, 2012 2:42 pm

Re: Execution gets slow over time

Post by colutti » Fri Jul 12, 2013 1:33 pm

Well, the support team tried to help me but nothing worked.

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

Re: Execution gets slow over time

Post by krstcs » Fri Jul 12, 2013 1:38 pm

I currently have a module in my tests that is named "WAIT_FOR_PAGE_RELOAD" that looks like:

1. 1s Delay
2. Wait For Not Exist -> WebDocumentLoading(/dom[@domain='mydomain' and @state!='complete'])
3. 0.5s Delay
4. Wait For Not Exist -> WebDocumentLoading(/dom[@domain='mydomain' and @state!='complete'])
5. Validate.Exists -> WebDocumentComplete(/dom[@domain='mydomain' and @state='complete'])

I check twice because our pages sometimes complete and then load again very quickly. This will catch that most of the time. Also, I have two /dom items in the repository so it is easier to manipulate each state separately.

Just put that in any test case right after you have a module that causes the page to reload. Or you can just copy the steps into your test modules where you need them.

Of course I keep my test modules VERY small, so a single click action on a button, for example, is a module for me. So all my actions that would cause a reload are in separate modules. I do that so non-programmer testers can drag and drop modules into test cases as if they were steps in a manual test.
Shortcuts usually aren't...

colutti
Posts: 18
Joined: Wed Nov 21, 2012 2:42 pm

Re: Execution gets slow over time

Post by colutti » Fri Jul 12, 2013 3:28 pm

That seems to be a good solution, thanks.

But my question is: Why don't the Ranorex programmers do that automatically for us? Why should I have to code simple things and spend a lot of work with something that could be avoided by them?
In Selenium all those issues simple do not exist. They handle every little detail like that for us, so we don't have to.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Execution gets slow over time

Post by Support Team » Tue Jul 16, 2013 3:23 pm

Hi,

You can do this without the need of "user code". You just need to add the specific "state" attribute to the corresponding repository item and after you added it you just need to drag it to your recording (action table) and select Validate.Exists.
Another easy way would be validating if a specific web element exists as explained in the following forum post.

This forum thread is about "Execution gets slow over time" so it would help other users to attend to the discussion if we would discuss this topic in a more proper thread, like in the following one: FEATURE REQUEST: WebDocument.WaitForComplete() :).

Regards,
Markus
.
Image