Call Checkpoints dynamically
I want to define Installation screens checkpoints (Region and Object) for each version say version 4.1, 4.2, 4.3 4.4 etc. And for each version some contents of the installation screen are different.
Can the checkpoints be called dynamically?
Solved! Go to Solution.
Yes you can
Based on the version number, create an if or switch statement to do the following:
Regions.Add(...) --> to add an image to the store dynamically
Regions.AddPicture(...) or addthe picture of an object on the screen to the store
Regions.Compare(...) to compare the live object on the screen to what you stored using one of the previous 2 methods.
At the end of the test, you can delete the stored images dynamically as well.
You can do the same with all other checkpoints as well.
My requirement is If I store multiple checkpoints according to version then I would like to call the checkpoint in a single line - This line should handle the version itself --> Instead of version looping (Using If..else or CASE)
Yes, this is possible.
Use eval() or evaluate() function provided by scripting language you are using.
For example, considering that your checkpoints are named like Screen1_v4_1, Screen2_v4_1, ..., Screen1_v4_2, ... with the current version in proper format stored in the strVersion variable and screen number stored in the strScreenNo variable, consider this code snippet:
strCmd := 'Regions.Screen' + strScreenNo + '_v' + strVersion + '.Check()'; // the value of strCmd should be like 'Regions.Screen1_v4_1.Check()' (without quotes)
/Alex [Community Champion]
[Community Champions] 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 Champions]
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 Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
Thanks for the help, AlexKaras, LinoTadros!
@vikassardesai, was the issue resolved?
SmartBear Community and Education Manager