STRING TOKEN
How to split the string in load runner
Action()
{
char a,b,c;
char *value="040;350;07/05/2012";
char *temp;
lr_save_string(value,"TokenValue_1");
temp=(char *)strtok(lr_eval_string("{TokenValue_1}"),";");
lr_save_string(temp,"TokenValue1");
a=lr_output_message("%s",lr_eval_string("{TokenValue1}"));
lr_output_message("the string a = %s",lr_eval_string("{TokenValue1}"));
temp=(char *) strtok(NULL,";");
lr_save_string(temp,"TokenValue2");
b=lr_output_message("%s",lr_eval_string("{TokenValue2}"));
lr_output_message("the string b = %s",lr_eval_string("{TokenValue2}"));
temp=(char *) strtok(NULL,";");
lr_save_string(temp,"TokenValue3");
c=lr_output_message("%s",lr_eval_string("{TokenValue3}"));
lr_output_message("the string c = %s",lr_eval_string("{TokenValue3}"));
return 0;
}
How to split the string in load runner
Action()
{
char a,b,c;
char *value="040;350;07/05/2012";
char *temp;
lr_save_string(value,"TokenValue_1");
temp=(char *)strtok(lr_eval_string("{TokenValue_1}"),";");
lr_save_string(temp,"TokenValue1");
a=lr_output_message("%s",lr_eval_string("{TokenValue1}"));
lr_output_message("the string a = %s",lr_eval_string("{TokenValue1}"));
temp=(char *) strtok(NULL,";");
lr_save_string(temp,"TokenValue2");
b=lr_output_message("%s",lr_eval_string("{TokenValue2}"));
lr_output_message("the string b = %s",lr_eval_string("{TokenValue2}"));
temp=(char *) strtok(NULL,";");
lr_save_string(temp,"TokenValue3");
c=lr_output_message("%s",lr_eval_string("{TokenValue3}"));
lr_output_message("the string c = %s",lr_eval_string("{TokenValue3}"));
return 0;
}
The out put value is :
ReplyDeleteStarting iteration 1.
Starting action Action.
Action.c(14): 040
Action.c(15): the string a = 040
Action.c(23): 350
Action.c(24): the string b = 350
Action.c(31): 07/05/2012
Action.c(33): the string c = 07/05/2012
Ending action Action.
Ending iteration 1.
good stuff ....expecting few more articles from you
ReplyDeleteHi Shankar, The example is good but a have a question here......
ReplyDeleteFor example if we have the value[] ="test\12345#678.999#Solutions"; and with 3 delimiters(\#.) how can we pass them...It is not recognizing the delimiter \ .Are you able to help me on this..
Thanks,
Krishna
use "\\" instead of "\"
DeleteGreat Help.. Thank You.. :)
ReplyDeleteHi Shankra,
ReplyDeleteI am learning LOADRUNNER. Can you please help me to solve more issues in CORRELATION.
ie. How to handle dynamic boundary values ?
Hi Shankra,
ReplyDeleteI am learning LOADRUNNER. Can you please help me to solve more issues in CORRELATION.
ie. How to handle dynamic boundary values ?
The Best HP Load Runner Online & Corporate Training
ReplyDeleteLive Performance Testing Training Classes by Experts
WiseInfo Solutions offers performance testing consulting and training services for individuals and corporate as well as project support and resources to bring software testing expertise .Our testing services are designed and delivered by experienced professionals focused on Quality.
Wiseinfo Solutions provides an introduction to the complexities of software performance testing and delivers testing skills that participants can immediately apply back on the job.
Features ::
25 Member Real time Performance testing professionals
Live Job Oriented Training
Live Instructor Led Course
Real World Case Study
Batch Flexibility
Customized Course
Live Projects
Resume Preparation
Performance testing Tools
Performance Engineering & Tuning
Loadrunner
Jmeter
RPT
NeoLoad
WebLoad
Silk Performer
Mode of training::
Online & Offline
Fast Track & Regular
Weekend
Contact ::
Satish :: +919505376239
Mail:: satish.mandadi@outlook.com
https://wiseinfosolutions.wordpress.com/
I like the way you write about Load runner training in Noida. Awesome, keep it up.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHow would you break long junk strings like 12345ajsdadja.12323? can we use strtok ?
ReplyDeleteVery good example
ReplyDeleteCan you please share an example on VTS concept?
ReplyDelete
ReplyDeleteHello, Good Article you know your article it's useful me and Thanks for Sharing Information.
Load runner Training in Delhi
The Sites are filled with Full of Encouraging and Enhancing Stuffs...I am very Happy to see all the Articles...Thanks for this Kind work
ReplyDeleteJava training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery
What as up, I read your blogs like every week. Your writing style is awesome, keep up the good work!
ReplyDeleteOracle 11g rac training
Oracle Access Manager online training
Oracle Access Manager training
Oracle ADF online training
Oracle ADF training
Oracle Apps funcational online training
Oracle Apps funcational training
Oracle Apps technical online training
Oracle Apps technical training
Oracle BPM online training
Oracle BPM training