Ask a Question

Call Checkpoints dynamically

SOLVED
vikassardesai
Occasional Contributor

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? 

5 REPLIES 5
LinoTadros
Community Hero

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.

Cheers

Lino

vikassardesai
Occasional Contributor

Hi,

  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)

AlexKaras
Champion Level 3

Hi,

 

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)

eval(strCmd);

 

Regards,
  /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.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
TanyaYatskovska
SmartBear Alumni (Retired)

Thanks for the help, AlexKaras, LinoTadros!

 

@vikassardesai, was the issue resolved?

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



vikassardesai
Occasional Contributor

Yes, it's working using EVal(). Thanks. 

cancel
Showing results for 
Search instead for 
Did you mean: