Ask a Question

Region Checkpoints in Data Driven loops

SOLVED
Lee_M
Community Hero

Region Checkpoints in Data Driven loops

I have a region checkpoint that works as expected.

 

I  want to include this checkpoint in a Data Driven Loop but the operation (to check "CAD") would be a dynamic variable in the look and have an associated stored region with the same title.

 

e.g.

ScreenName (var) Region (FileName)
CAA CAA.png
CAB CAB.png
CAC CAC.png
CAD  CAD.png

 

Keyword test design

Lee_M_0-1617887108422.png

 

 

Does anyone know how the change the Keyword test region operation into a dynamic var

 

failing this, how could this be accomplished in script ?

6 REPLIES 6
jr348
Contributor

I've used the javascript "eval" function for this  in the past to run random keyword tests from our suite.

Lee_M
Community Hero

in Keyword or script ?

 

how did you do this ?

eval(var = project.regions.var)

ebarbera
Staff

@Lee_M 

 

You will first have to set up 2 Project level variables. 

ebarbera_0-1617907075241.png

The spreadsheet variable should contain a column with the names of the images from the regions section of TestComplete.

ebarbera_1-1617907164975.png 

ebarbera_2-1617907185358.png

 

Next you will have to add the following steps to your keyword test - inside the datadriven loop:

ebarbera_3-1617907261366.png

Set Variable Value:

ebarbera_4-1617907316890.pngebarbera_5-1617907337513.png

Code Snippet : Regions.Items(Project.Variables.Var1).Check(Aliases.browser.pageEvaluateFunctionTestcomplete.panel)

 

Hopefully this helps - let me know if you have any additional questions.

 

 

 

Thanks for the suggestion and the quick reply,

 

I will test this later tomorrow but this appears a well explained suggestion that will hopefully work.

 

 

Side note:

It would be nice to see a future version of TestComplete with the region Checkpoint able to accept variables by clicking of the elispsis like other TC functions

 

Lee_M_0-1617916172479.png

 

 

Operation Parameters dialog

Lee_M_1-1617916329591.png

 

 

Marsha_R
Champion Level 2

I have more errors now but they are beyond this question and more about checkpoints not matching 

 

Your answer was a great and does what I needed

 

Going one step further, elimating the second variable (Var1) and referencing directly within the loop:

Code Snippet : Regions.Items(Project.Variables.Var2.value("RegionName")).Check(Aliases.browser.pageEvaluateFunctionTestcomplete.panel)

 

 

cancel
Showing results for 
Search instead for 
Did you mean: