unexpected delay from user code (data driven test)

Ask general questions here.
c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

unexpected delay from user code (data driven test)

Post by c676228 » Thu May 07, 2015 1:04 am

try {
Validate.NotExists(repo.ItemInfo);
}
catch {
//do some cleanup
return;
}

//repo.Container.Element is displayed within less than a second, however, the data is not entered until about //1.5 or 2 min later
Report.Log(ReportLevel.Info, "Wait", "Waiting 10s for item 'repo.Container.Element' to exist.", repo.Container.Element, new ActionTimeout(10000));
Container.Element.WaitForExists(10000); //or ensurevisible()
//enter data from excel sheet to repo.Container.Element delayed about 2 min.
Any idea?

Thanks,
Betty

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

Re: unexpected delay from user code (data driven test)

Post by odklizec » Thu May 07, 2015 7:04 am

Hi,

It's hard to say what's wrong without more details about your SUT (Ranorex Snapshot), xpath behind the delayed element, exact code you are using to enter the data to repo element, Ranorex version, etc. Could you please provide these details?

There was a problem in 5.3.0 and 5.3.1 with slowdown while entering data to HTML elements. This has been fixed in 5.3.2. Another reason could be too general xpath with a lot of optional (?) elements or searching through all descendants (//). Again, it's hard to say without more details.
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

c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Re: unexpected delay from user code (data driven test)

Post by c676228 » Thu May 07, 2015 8:15 pm

Hi odklizec,

I take a closer look. It seems that it is not xpath related.
When using Firefox or Chrome
At the right hand corner of the progression window, the searching for repo.ItemInfo ... text displayed
for statement Validate.NotExists(repo.ItemInfo) is not executed until about 2 min later. There is no delay or wait for action in the recording module before calling this usercodemethod. So this is very odd. IE just frequently stalls here.

public void usercodemthed()
{
try {
// unexpected delay before execute this statement, it just display wait for 200ms in the progress window, actual wait time is about 2 //min.
Validate.NotExists(repo.ItemInfo);
}
...

}

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

Re: unexpected delay from user code (data driven test)

Post by krstcs » Thu May 07, 2015 8:46 pm

Something to understand about the 'Validate.NotExists()' method: Ranorex will try to find the item for the full 'effective' timeout of the item before it returns from that function. If your item's effective timeout is 2 min, for example, then Ranorex will try to find the element for the full 2 min before it returns.

If the element IS NOT FOUND in that time-frame, then the method PASSES.

If the element IS FOUND, then the method returns immediately and FAILS.


In your case though, it should still show the timer-bar, so this may not be the issue.


If you want to check if something exists but want a shorter time-out, you can use the Exists(Duration) method in an if() block and pass the desired timeout duration.
Shortcuts usually aren't...

c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Re: unexpected delay from user code (data driven test)

Post by c676228 » Fri May 08, 2015 8:21 pm

Hi krstcs,

Now I am using the following method, the timing seems a bit more controllable
Validate.NotExists(emailDuplicateError.AbsolutePath, new Duration(15000))

The method seems to be called at the expected time. There is no more 1.5-2 min delay before this method call.
This seems to be a side benefit for using this method. I don't know why.