Ask a Question

Measure the time it takes for a button to become enabled

SOLVED
nedbacan
Contributor

Measure the time it takes for a button to become enabled

Can someone instruct me how I would measure the time it takes for a button to become enabled on the screen.  Should I use aqPerformance.Start()  or will it be better to use aqDateTime.Now() as a stopwatch when the option is selected and then get the time again once the button is enabled.  

 

If you can provide a sample it would be helpful to understand,  I read the usage of the methods but not too clear where I can place it in a script.  There are areas where I place the wait/pause method to slow down the script but will that affect the time the button from disable to enable state, and how will I present the time in the log file. 

 

Use Case scanario

1) User select an image

2) Right-click on the image - a menu appears

3) Select the option to enable "MA" - a dialog appears showing a disabled button.

4) User waits (approx 30 seconds) until the button becomes enabled.  - the current dialog shows the button enabled.

5) If the button takes longer than 30 seconds - the test case fails because it took longer than the requirement.

 

//Right Click on image
Aliases.browser.pageImagenet.vgSvgslice0.ClickR(347, 138);
//Click the option to turn on the button
Aliases.browser.pageImagenet.textnodeProcessingmovingaverage.Click(25, 13);
//Runs a script routine to pause until the button is enabled.
WaitForButton();
//Checks whether the 'contentText' property of the NameMapping.Sys.browser.pageExam.panelResult.panel object equals 'ON'
aqObject.CheckProperty(NameMapping.Sys.browser.pageExam.panelResult.panel, "contentText", cmpEqual, "MA\nClose\nON\n0");
//Run the next keyword test.

 

Thank you for your support.

13 REPLIES 13

Hi,

 

If you are using JavaScript, then try

aqPerformance.Value()

(see code example in documentation)

Does it help?

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

yes, i just forgot the () ..

Un sourire et ça repart

yes, i just forgot the () ..

Parenthesis are required for JavaScript only and until now JavaScript was not mentioned in any way... 😉

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

Problem solved with aqPerformance.Value().

 

@AlexKaras and @BenoitBMy thanks to both of you and appreciation for your time.

cancel
Showing results for 
Search instead for 
Did you mean: