Forum Discussion

SunilKumarR's avatar
SunilKumarR
New Contributor
2 years ago
Solved

Facing issue with while working strings which if statement

problem question: KeywordTest

1) does if statement works with strings?

2) while running a data-driven test, how to skip one of the iteration ?

3) how to read empty excel cell?

 

Please try to explain the above question?

  • 1)Yes, you can have an if statement with strings, like 

    if myteststring = 'abc' then

     

    2)To skip an iteration, you would have to keep track of the iteration number and check for it each time

    if myiteration <> 10

       do some stuff

    else 

       don't do anything

     

    3) I have never had luck reading an empty excel cell. We ended up putting a character in the field that didn't mean anything and using that as if it was empty.

     

    if myexcelcolumn <> ')" then

        do some stuff

    else 

        don't do anything

1 Reply

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    1)Yes, you can have an if statement with strings, like 

    if myteststring = 'abc' then

     

    2)To skip an iteration, you would have to keep track of the iteration number and check for it each time

    if myiteration <> 10

       do some stuff

    else 

       don't do anything

     

    3) I have never had luck reading an empty excel cell. We ended up putting a character in the field that didn't mean anything and using that as if it was empty.

     

    if myexcelcolumn <> ')" then

        do some stuff

    else 

        don't do anything