cancel
Showing results for 
Search instead for 
Did you mean: 

Mercury Loadrunner - Type mismatch problem - help

Former Member
0 Kudos

Hello friends,

    I am writing a script in loadrunner where a part of code must loop untill a parameter gets the value X.

I am able to get the value into parameter through function sapgui_get_text(" ","txt[34,17]","param2",LAST).

Here, txt[34,17] is teh scren field from where value is retireved and param2 is teh parameter into which value is placed.

but when i check for do{...}while( param3 == "X"), it gives type mismatch error.

Can you please help me out in sorting out the condition problem.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

You should use strcmp() function to compare "X" and the value that is populated into the parameter "param2", as they are of string type but not char type.

if ( strcmp("X", lr_eval_string("")) == 0 ) will solve your problem.

Regards

Madhu

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

The variables in LoadRunner should be used with the "{" and "}" so as to use them later (i.e., after their first usage). These are the default used in LR and could be changed using Tools->General Options.

In your case the param2 is used without the curly braces and hence the type mismatch error. Hence it should be as following:

while ( == "X" )

Thanks and Regards

Madhu