cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Personas - Use of variable in IF statement

Former Member
0 Kudos

Hope someone can assist with this script

I am storing a value from a dropdown box in a variable so this can be used latter when I am in a different screen within same script.

But the problem I am facing is if i perform a if statment against a variable , it does not work

What I do in test script

1) copy value from drop down into varable

2) paste value to textbox to test value

3) if check is equal for value (N506) in variable "site"

4) if true, put "tested ok" in text box.

if perofrm the test on the dropdown box directly...  it works

if perform the test on the textbox i copied variable to... it works.

if perform test on variable directly...it fails...

Doing the test in the first two cases, will not work , as the textbox and dropdown box will not be on screen , when i need to perofm the if statement.

I am suspecting the if statement is interpurting the word site, as a text rather then a varaible name, so how can  read a variable and use it in a if statement, without using a box on the screen itself.

Any help is appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

use args.site in the IF statement

Former Member
0 Kudos

thanks Tamas....   i knew it was something simple...  code works great now.

.

Answers (0)