cancel
Showing results for 
Search instead for 
Did you mean: 

click method is very slow

SOLVED
Contributor

click method is very slow

Hi guys,

Click method is very slow, if I debug code line stay at method click about 20 seconds.

Specially when I must click object in order to exit from a drop down menu.

The time recognitionof the object is good...

Here my function:

Property ='idStr'

Value = '<nameid>'

function Button_Click(Property,Value)
{
try
{
var btt = Sys.Browser(VarBrowser).FindChild(Property, Value, 20)
if (!btt.exists)
Log.Error("Button" + Property +" doesn't exists " + e.message)
else
btt.Click ();
Sys.Browser(VarBrowser).Page("*").Wait();
}
catch(e)
{
Log.Error("Button " + Property + " Value: " + Value + " doesn't exists " + e.message)
}
finally
{
return true
}
}

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: click method is very slow

To check the fact that the "Click" method takes a long time, please post two timestamps to the log (before and after "Click"). You can find a sample code below.

 

...

Log.Message(aqDateTime.Now());

btt.Click ();

Log.Message(aqDateTime.Now());

...

 

If the time difference is 20 seconds indeed, you can create a support case. Most probably, we will need to reproduce this slowness in our test lab for investigation. So, please be ready to provide us with access to your website.

 

Thank you! 

Regards,
Yuriy Peshekhonov
Customer Care Engineer

View solution in original post

5 REPLIES 5
Highlighted
Community Hero

Re: click method is very slow

My guess it that what you are clicking is very far down the object tree and it's taking a while to search for it on execution. Is there a reason you aren't using the name mapping feature to have a more direct path to your object?


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
Highlighted
Contributor

Re: click method is very slow

Hi cunderw,

Is not the search slow but the click method, I try to map the object with namemapping but the result still the same

Highlighted

Re: click method is very slow

To check the fact that the "Click" method takes a long time, please post two timestamps to the log (before and after "Click"). You can find a sample code below.

 

...

Log.Message(aqDateTime.Now());

btt.Click ();

Log.Message(aqDateTime.Now());

...

 

If the time difference is 20 seconds indeed, you can create a support case. Most probably, we will need to reproduce this slowness in our test lab for investigation. So, please be ready to provide us with access to your website.

 

Thank you! 

Regards,
Yuriy Peshekhonov
Customer Care Engineer

View solution in original post

Highlighted
Contributor

Re: click method is very slow

Hi Yuri,

I'll try to catch time before and after.

Unluky I couldn't give you the access of the website.

Highlighted
Contributor

Re: click method is very slow

Hi Yuri,

I put in test click method, catching the time before and after the click method.

Click method is not slow, it seemed slow because in debug mode the cursor stayed a long time in click row.

But i figured out with object spy that the object wasn't visible, but it was in the tree, so I suppose that both find child and namemapping take a long time to recognize it.