How to set response time limit

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
zator
Posts: 53
Joined: Wed Jul 04, 2012 1:44 pm
Location: Kraków, POLAND

How to set response time limit

Post by zator » Tue Aug 21, 2012 12:13 pm

Hi,

While running my tests, just after i make them data-driven, during random iterations i get exception:

Code: Select all

Action 'close' failed on element '{Form:FormSearchFTS}'.
Failed to get response from control within 2000 milliseconds
My question is do i have any influence to this time limit, can i change it???

Paweł

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to set response time limit

Post by Support Team » Tue Aug 21, 2012 2:48 pm

Hi Pawel,

You can try to increase the search timeout of the specific repository item.

Regards,
Markus
Ranorex Support Team

zator
Posts: 53
Joined: Wed Jul 04, 2012 1:44 pm
Location: Kraków, POLAND

Re: How to set response time limit

Post by zator » Tue Aug 21, 2012 3:54 pm

Hello Markus,

There is fragment of my code:

Code: Select all

Element grid = Host.Local.FindSingle(xPath, 6000);

...

while (grid.As<Form>() == null)
{
       grid = grid.Parent;
}
grid.As<Form>().Close(); // <- here i sometimes get the exception

Where can i increase search timeout??

Paweł

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to set response time limit

Post by Support Team » Wed Aug 22, 2012 8:12 am

Hi,

as you can see in the API documentation of the method FindSingle the parameter "timeout" allows you to set the search timeout for the element you are searching for. In your code, the search timeout is set to 6000 milliseconds.

Regards,
Tobias
Ranorex Team

zator
Posts: 53
Joined: Wed Jul 04, 2012 1:44 pm
Location: Kraków, POLAND

Re: How to set response time limit

Post by zator » Wed Aug 22, 2012 9:46 am

Hello Tobias,

Yes i know that i set search timeout to 6000 ms, but why in the exception i get the information that timeout was set to 2000??

Paweł

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to set response time limit

Post by Support Team » Wed Aug 22, 2012 11:04 am

Hi,

as I can see from the exceptions text, it looks like there is an modal dialog opened (e.g. save dialog) which prevents your code to invoke the close action.
If so, you have to make sure, that the given dialog will be closed.

Regards,
Tobias
Ranorex Team

zator
Posts: 53
Joined: Wed Jul 04, 2012 1:44 pm
Location: Kraków, POLAND

Re: How to set response time limit

Post by zator » Wed Aug 22, 2012 3:41 pm

Hi,

Thanks, i manage to solve this problem. However i still do not get it why this exception is thorwn with time 2000 not 6000 8)

Paweł

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to set response time limit

Post by Support Team » Thu Aug 23, 2012 6:46 am

Hi,

as I can see, this is the timeout of the invoked close method.

Regards,
Tobias
Ranorex Team

zator
Posts: 53
Joined: Wed Jul 04, 2012 1:44 pm
Location: Kraków, POLAND

Re: How to set response time limit

Post by zator » Thu Aug 23, 2012 11:48 am

Hello,

So we finally, is it possible to change timeout of invoke method? :D

Paweł

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to set response time limit

Post by Support Team » Thu Aug 23, 2012 12:28 pm

zator wrote:So we finally, is it possible to change timeout of invoke method? :D
No, I'm sorry, that's not possible.

Regards,
Tobias
Ranorex Team

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to set response time limit

Post by Support Team » Thu Aug 30, 2012 8:56 am

Hi again,

turns out that there is a possibility to set the timeout for the invoke method yet, if you are invoking the method directly on the winforms control:
var c = new Control(grid);
c.InvokeMethod(System.Reflection.BindingFlags.Default, "Close", null, 20000);
Regards,
Tobias
Ranorex Team