cancel
Showing results for 
Search instead for 
Did you mean: 

Call Checkpoints dynamically

SOLVED
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? 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: Call Checkpoints dynamically

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 Expert Group]
____
[Community Expert Group] members 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. Postings made by [Community Expert Group] members
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.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================

View solution in original post

5 REPLIES 5
Community Leader

Re: Call Checkpoints dynamically

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

Occasional Contributor

Re: Call Checkpoints dynamically

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)

Community Hero

Re: Call Checkpoints dynamically

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 Expert Group]
____
[Community Expert Group] members 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. Postings made by [Community Expert Group] members
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.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================

View solution in original post

Community Manager

Re: Call Checkpoints dynamically

Thanks for the help, AlexKaras, LinoTadros!

 

@vikassardesai, was the issue resolved?

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Highlighted
Occasional Contributor

Re: Call Checkpoints dynamically

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