Forum Discussion

TestQA1's avatar
TestQA1
Frequent Contributor
3 years ago

Comparing Examples parameters with bdd normal parameters

Hi folks,

 

I have something like this in my bdd scenario and trying to compare the Examples parameter 'i' with a scenario parameter 'rows' in the if condition.

The script seems to compare but as soon as the comparison reaches the value 2, the script jumps to i = 10. My idea is that there is some data type difference between these parameters or row which has a value 12 when reaches i = 2, it fails as the first digit 1 in 12 is only being compared not the whole 12.

 

Given some statement
 When I enter "<name>" , "<i>" with "12"
 Examples:
  | name |  i   |
  | Joe1 | 1   |

  | abc   |   2  |

  | xyz| 3  |

.

.

.

.

....|11|

 

In my script function (name,i,row)

{.... code

if(i<row) {

do something...

}

 

Can anyone help me with this please.

Thank you.

  • Issue has been resolved my removing " " from 12 in the scenario as it now a int type not string and can be compared with j in Examples.

  • TestQA1's avatar
    TestQA1
    Frequent Contributor

    Issue has been resolved my removing " " from 12 in the scenario as it now a int type not string and can be compared with j in Examples.