Forum Discussion

st-pat's avatar
st-pat
Occasional Contributor
6 years ago

get datasource property value and run teststeps accordingly

Hi community,

in my desperate try to mix serveral groovy solutions togehter I surley have forgotten something or done completely wrong.

 

I have a datasourceloop and according to several values (or sometimes even lack theereof) (see for example the attached screenshot in the third line you will see that the column "optional service" is filled with data sp in this case the script should trigger the step "brianSisAddService". But my script is wrong (it fails) so could you help me to get it correctly ?

 

Thnx

 

def tempVar = context.expand( '${#DataSource#optional service}' )

if tempVar = true gotoStepByName("brianSisAddService")
else gotoStepByName("brianSisVtInvoiceWrite")

 

2 Replies

  • Lucian's avatar
    Lucian
    Community Hero
    I don't fully understand your scenario but one thing is surely wrong there namely 'if tempVar = true'. tempVar is expanding a datasource property and properties are always strings so it should be something like 'if tempVar.equals("true")'...

    (from my mobile - will help you further today if needed...)
    • st-pat's avatar
      st-pat
      Occasional Contributor
      Thnx for your help. My thing is that I have a list as a data source and according to some values (like on the jpg attached in my question where in one column the first three lines are empty) I would need to skip a certain teststep. That's from my example script, it should mean if the column is not empty then go there if it is empty go elsewhere