How to set the time out for Validate Enabled=True?
Posted: Thu Jan 29, 2015 1:41 am
Our application does a number of initialization tasks on startup. Depending on the machine and more importantly the number of sensors visible on the network the initialization can range from 10 seconds to 3 minutes.
The event that signals to the user (and one would hope Ranorex) that initialization is complete is that the main menu bar transitions from disabled to enabled.
So the first two steps of any test recording with our Explorer as the application under test are:
1) start the application
2) wait for the main menu bar to become enabled
Ranorex does not seem to be polling the application (e.g. with exponential back off) in order to wait for the control to achieve the expectation of the call to Validate.Attribute(). In this case that would be Enabled = True. Search time out for the repo item seems to only control the state transition from not exists to does exist. What property on the repo item or on the line line within the recording must be set so that the recording will have the following behavior:
1) Wait until the menu bar is enabled or wait 4 minutes which ever duration is shorter.
2) proceed to the next test step or report a failure.
Here is an excerpt of the generated code:
I want a duration parameter for Validate.Attribute() as there is for Validate.Exists(). A resulting code snippet would be similar to:
I.E. Wait until the Enabled attribute of the main menu bar acquires a value of TRUE, but wait no longer the 4 minutes for this state transition within the attribute. If, after 4 minutes, the Enabled attribute has not become TRUE, then report this as a failure
I have looked through the documentation on Validate at:
http://www.ranorex.com/Documentation/Ra ... lidate.htm
and don't see how such an elementary synchronization with an application under test can be done.
What am I missing here?
The event that signals to the user (and one would hope Ranorex) that initialization is complete is that the main menu bar transitions from disabled to enabled.
So the first two steps of any test recording with our Explorer as the application under test are:
1) start the application
2) wait for the main menu bar to become enabled
Ranorex does not seem to be polling the application (e.g. with exponential back off) in order to wait for the control to achieve the expectation of the call to Validate.Attribute(). In this case that would be Enabled = True. Search time out for the repo item seems to only control the state transition from not exists to does exist. What property on the repo item or on the line line within the recording must be set so that the recording will have the following behavior:
1) Wait until the menu bar is enabled or wait 4 minutes which ever duration is shorter.
2) proceed to the next test step or report a failure.
Here is an excerpt of the generated code:
Code: Select all
Report.Log(ReportLevel.Info, "Application", "Run application 'C:\\Program Files (x86)\\Cognex\\In-Sight\\In-Sight Explorer 5.1.0\\In-Sight Explorer.exe' with arguments '' in normal mode.", new RecordItemIndex(0));
Host.Local.RunApplication("C:\\Program Files (x86)\\Cognex\\In-Sight\\In-Sight Explorer 5.1.0\\In-Sight Explorer.exe", "", "C:\\Program Files (x86)\\Cognex\\In-Sight\\In-Sight Explorer 5.1.0", false);
Delay.Milliseconds(100);
Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Enabled='True') on item 'ExplorerForm.MainMenuBar'.", repo.ExplorerForm.MainMenuBarInfo, new RecordItemIndex(1));
Validate.Attribute(repo.ExplorerForm.MainMenuBarInfo, "Enabled", "True");
Delay.Milliseconds(100);
Code: Select all
Validate.Attribute(repo.ExplorerForm.MainMenuBarInfo, "Enabled", "True", new Duration(new TimeSpan(0,4,0)));
I have looked through the documentation on Validate at:
http://www.ranorex.com/Documentation/Ra ... lidate.htm
and don't see how such an elementary synchronization with an application under test can be done.
What am I missing here?