User:Saalu jr/sandbox

/***************************************************************************************

Script Name 		: CRM21_Attach_File_V1 Created By		: Email				:   Employee Id		: Employer			:  Date				: 13th June 2011 Modified Date		: Reviwed By		: -- * Recording Options Used -- Protocol			: WEB/HTTP (Initially recorded in multi protocol - Siebel web) Recording			: HTML Based script. (Do not record non-HTML generated elements.) Recording Engine	: 9.52 Advanced			: Uncheck 'Reset context for each action', check 'Support char set UTF8' Correlation		: Enabled - Siebel (Import 'WebSiebel77Correlation.cor' file from 'C:\Program Files\HP\Virtual User Generator\dat\webrulesdefaultsettings' and 					 Place ssdtcorr.dll file in 'C:\Program Files\HP\Virtual User Generator\bin') ---

* Business Process (Actions listed) --- 1. Login to application 2. Click on Househols screen tab 3. Click Query button in the Household's applet 4. Enter Household Name in the household name field in the Household's applet and click Go button 5. Click on Household Name link which you searched 6. Go to Attachments applet view and click on NewFile button 7. Attch the Email file(.msg format). 8. Save the record. 9. Logoff --- * Transactions for CRM08_Build_Relationship --- 1. CRM_Launch 2. CRM_Login 3. CRM21_Attach_File_T01_ClickHousehold 4. CRM21_Attach_File_T02_ClickQuery 5. CRM21_Attach_File_T03_SearchByHouseholdName 6. CRM21_Attach_File_T04_ClickOnHouseholdName 7. CRM21_Attach_File_T05_ClickOnClients_Contancts 8. CRM21_Attach_File_T06_ClickOnNewButton 9. CRM21_Attach_File_T07_Attach_File 10.CRM21_Attach_File_T08_Save_Record 11.CRM_Logoff

vuser_init {

web_cleanup_cookies;

web_cache_cleanup;

/*Launch*/

web_set_user("DM0001.INFO53.COM\\{Param_Tid}", 		lr_decrypt(lr_eval_string("{Param_Tid_Pwd}")),		"auth.info53.com:443");

web_set_max_html_param_len("2000");

web_reg_find("Text=GotoUrl('start.swe?SWECmd=Start');", "SaveCount=count1", "Search=ALL", LAST);

lr_start_transaction("CRM_Launch");

web_url("fins_enu", 		"URL={Param_CRM_URL}", 		"TargetFrame=", 		"Resource=0", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t1.inf", 		"Mode=HTML", 		LAST);

if(atoi(lr_eval_string("{count1}"))>0){ lr_stop_transaction("CRM_Launch"); }	else{ lr_end_transaction("CRM_Launch",LR_FAIL); lr_error_message("CRM Launch failed for : %s",lr_eval_string("Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }	/* Registering parameter(s) from source task id 24 // {Siebel_sn_cookie3} = "WVGHR3aQyU21SJcFvoB3Pf9SNpa.hKTNNC-03O-s0TrIyCqjm9QGpB5H751JZDs3" // */

web_reg_save_param("Siebel_sn_cookie3", 		"LB/IC=_sn=", 		"RB/IC=;", 		"Ord=1", 		"Search=headers", 		"RelFrameId=1", 		LAST);

web_reg_find("Text=User ID:", "SaveCount=count2", "Search=ALL", LAST);

lr_resume_transaction("CRM_Launch");

web_url("start.swe", 		"URL={Param_CRM_URL}/start.swe?SWECmd=Start&SWEHo=wsst103.info53.com", 		"TargetFrame=", 		"Resource=0", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t2.inf", 		"Mode=HTML", 		LAST);

if(atoi(lr_eval_string("{count2}"))>0){ lr_end_transaction("CRM_Launch",LR_PASS); }	else{ lr_end_transaction("CRM_Launch",LR_FAIL); lr_error_message("CRM Launch failed for : %s",lr_eval_string("Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

/*Login to the application*/

Siebel_SWECount_var = 0;

lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");

lr_think_time(5);

web_reg_find("Text=this.location.replace (\"/fins_enu/start.swe?SWECmd=Login", "SaveCount=count3", "Search=ALL", LAST);

web_save_timestamp_param("SiebelTimeStamp",LAST);

lr_start_transaction("CRM_Login");

web_submit_data("start.swe_2", 		"Action={Param_CRM_URL}/start.swe", 		"Method=POST", 		"RecContentType=text/html", 		"Referer={Param_CRM_URL}/start.swe?SWECmd=Start&SWEHo=wsst103.info53.com", 		"Snapshot=t3.inf", 		"Mode=HTML", 		ITEMDATA, 		"Name=SWEUserName", "Value={Param_LoginName}", ENDITEM, //TESTIAMGR3		"Name=SWEPassword", "Value={Param_LoginPwd}", ENDITEM, 		"Name=SWEFo", "Value=SWEEntryForm", ENDITEM, 		"Name=SWENeedContext", "Value=false", ENDITEM, 		"Name=SWENoHttpRedir", "Value=false", ENDITEM, 		"Name=SWECmd", "Value=ExecuteLogin", ENDITEM, 		"Name=W", "Value=t", ENDITEM, 		"Name=SWESPNR", "Value=", ENDITEM, 		"Name=SWESPNH", "Value=", ENDITEM, 		"Name=SWEH", "Value=", ENDITEM, 		"Name=_sn", "Value={Siebel_sn_cookie3}", ENDITEM, 		"Name=SWEC", "Value={Siebel_SWECount}", ENDITEM, 		"Name=SWEW", "Value=", ENDITEM, 		"Name=SWEBID", "Value=-1", ENDITEM, 		"Name=SWETS", "Value={SiebelTimeStamp}", ENDITEM, "Name=SWEWN", "Value=", ENDITEM, LAST);

if(atoi(lr_eval_string("{count3}"))>0){ lr_stop_transaction("CRM_Login"); }	else{ lr_end_transaction("CRM_Login",LR_FAIL); lr_error_message("CRM Login failed for : %s",lr_eval_string("User: {Param_LoginName}, Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

/* Registering parameter(s) from source task id 53 // {Siebel_SWEACn9} = "26692" // */

web_reg_save_param("Siebel_SWEACn9", 		"LB=SWEACn=", 		"RB=&", 		"Ord=1", 		"Search=Body", 		"RelFrameId=1", 		LAST);

/* Registering parameter(s) from source task id 75 // {Siebel_SWEVLC} = "1-5VB-3026_Siebel+Financial+Services_43%7c1305415851%7c1306873735_1_21219_000_L" // */

web_reg_save_param("Siebel_SWEVLC", 		"LB/IC=`cks`", 		"RB/IC=`", 		"Ord=1", 		"Search=Body", 		"RelFrameId=1.2.1", 		LAST);

web_reg_find("Text=this.ConfirmDeleteMessage ='Are you sure you want to delete this record?'", "SaveCount=count4", "Search=ALL", LAST);

web_save_timestamp_param("SiebelTimeStamp",LAST);

lr_resume_transaction("CRM_Login");

web_url("start.swe_3", 		"URL={Param_CRM_URL}/start.swe?SWECmd=Login&SWEPL=1&SWETS={SiebelTimeStamp}", 		"TargetFrame=", 		"Resource=0", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t4.inf", 		"Mode=HTML", 		LAST);

if(atoi(lr_eval_string("{count4}"))>0){ lr_stop_transaction("CRM_Login"); }	else{ lr_end_transaction("CRM_Login",LR_FAIL); lr_error_message("CRM Login failed for : %s",lr_eval_string("User: {Param_LoginName}, Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

Siebel_SWECount_var += 3;

lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");

web_reg_find("Text=", "SaveCount=count5", "Search=ALL", LAST);

lr_resume_transaction("CRM_Login");

web_url("start.swe_4", 		"URL={Param_CRM_URL}/start.swe?SWECmd=GotoPostedAction&SWEACn={Siebel_SWEACn9}&SWEDIC=true&SWEC={Siebel_SWECount}&SWEFrame=top._sweclient&SWECS=true", 		"TargetFrame=", 		"Resource=0", 		"RecContentType=text/html", 		"Referer={Param_CRM_URL}/start.swe?SWECmd=GetCachedFrame&SWEACn={Siebel_SWEACn9}&SWEC={Siebel_SWECount}&SWEFrame=top._swe", 		"Snapshot=t5.inf", 		"Mode=HTML", 		LAST);

if(atoi(lr_eval_string("{count5}"))>0){ lr_stop_transaction("CRM_Login"); }	else{ lr_end_transaction("CRM_Login",LR_FAIL); lr_error_message("CRM Login failed for : %s",lr_eval_string("User: {Param_LoginName}, Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

web_reg_find("Text=g_bInitialized = true;", "SaveCount=count6", "Search=ALL", LAST);

web_save_timestamp_param("SiebelTimeStamp", LAST);

lr_resume_transaction("CRM_Login");

web_url("start.swe_5", 		"URL={Param_CRM_URL}/start.swe?SWECmd=GetCachedFrame&SWEACn={Siebel_SWEACn9}&SWERT=5&SWEC={Siebel_SWECount}&SWEFrame=top._sweclient", 		"TargetFrame=", 		"Resource=0", 		"RecContentType=text/html", 		"Referer={Param_CRM_URL}/start.swe?SWECmd=Login&SWEPL=1&SWETS={SiebelTimeStamp}", 		"Snapshot=t6.inf", 		"Mode=HTML", 		LAST);

if(atoi(lr_eval_string("{count6}"))>0){ lr_stop_transaction("CRM_Login"); }	else{ lr_end_transaction("CRM_Login",LR_FAIL); lr_error_message("CRM Login failed for : %s",lr_eval_string("User: {Param_LoginName}, Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

Siebel_SWECount_var -= 3;

lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");

web_reg_find("Text=`Status`OK`", "SaveCount=count7", "Search=ALL", LAST);

lr_resume_transaction("CRM_Login");

web_submit_data("start.swe_6", 		"Action={Param_CRM_URL}/start.swe", 		"Method=POST", 		"TargetFrame=", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t7.inf", 		"Mode=HTML", 		ITEMDATA, 		"Name=SWEC", "Value={Siebel_SWECount}", ENDITEM, 		"Name=SWERPC", "Value=1", ENDITEM, 		"Name=SWEBHWND", "Value=132216", ENDITEM, 		"Name=SWEDIC", "Value=true", ENDITEM, 		LAST);

if(atoi(lr_eval_string("{count7}"))>0){ lr_stop_transaction("CRM_Login"); }	else{ lr_end_transaction("CRM_Login",LR_FAIL); lr_error_message("CRM Login failed for : %s",lr_eval_string("User: {Param_LoginName}, Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

Siebel_SWECount_var += 3;

lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");

web_reg_find("Text=^Target^top._sweclient._swecontent._sweview^", "SaveCount=count8", "Search=ALL", LAST);

lr_resume_transaction("CRM_Login");

web_submit_data("start.swe_7", 		"Action={Param_CRM_URL}/start.swe", 		"Method=POST", 		"TargetFrame=", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t8.inf", 		"Mode=HTML", 		ITEMDATA, 		"Name=SWEC", "Value={Siebel_SWECount}", ENDITEM, 		"Name=SWERPC", "Value=1", ENDITEM, 		"Name=SWEView", "Value=FINS Home Page View", ENDITEM, 		"Name=SWECmd", "Value=GotoView", ENDITEM, 		"Name=SWEKeepContext", "Value=1", ENDITEM, 		LAST);

if(atoi(lr_eval_string("{count8}"))>0){ lr_stop_transaction("CRM_Login"); }	else{ lr_end_transaction("CRM_Login",LR_FAIL); lr_error_message("CRM Login failed for : %s",lr_eval_string("User: {Param_LoginName}, Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

//Owner: SWEWriteObjectTag(this,'Welcome Back Steve TESTIAMGR3. web_reg_save_param("userName",					  "LB/IC=Welcome Back ",					   "RB/IC=.  ",					   "NotFound=Warning",					   "Ord=1",					   "Search=ALL",					   LAST);

web_convert_param("Siebel_SWEVLC_URL", 		"SourceString={Siebel_SWEVLC}", 		"SourceEncoding=HTML", 		"TargetEncoding=URL", 		LAST);

web_reg_find("Text=Welcome Back ", "SaveCount=count9", "Search=ALL", LAST);

lr_resume_transaction("CRM_Login");

web_url("start.swe_8", 		"URL={Param_CRM_URL}/start.swe?SWECmd=GetViewLayout&SWEView=FINS%20Home%20Page%20View&SWEVI=&SWEVLC={Siebel_SWEVLC_URL}", 		"TargetFrame=", 		"Resource=0", 		"RecContentType=text/html", 		"Referer={Param_CRM_URL}/start.swe?SWENeedContext=false&SWECmd=GetCachedFrame&SWEACn={Siebel_SWEACn9}&SWEC={Siebel_SWECount}&SWEFrame=top._sweclient._swecontent._sweview&SWEBID=-1&SWETS=", 		"Snapshot=t9.inf", 		"Mode=HTML", 		LAST);

if(atoi(lr_eval_string("{count9}"))>0){ lr_stop_transaction("CRM_Login"); }	else{ lr_end_transaction("CRM_Login",LR_FAIL); lr_error_message("CRM Login failed for : %s",lr_eval_string("User: {Param_LoginName}, Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

Siebel_SWECount_var += 1;

lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");

web_reg_find("Text=`Status`OK`Result`", "SaveCount=count10", "Search=ALL", LAST);

lr_resume_transaction("CRM_Login");

web_submit_data("start.swe_10", 		"Action={Param_CRM_URL}/start.swe", 		"Method=POST", 		"TargetFrame=", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t11.inf", 		"Mode=HTML", 		"EncodeAtSign=YES", 		ITEMDATA, 		"Name=SWEC", "Value={Siebel_SWECount}", ENDITEM, 		"Name=SWEMethod", "Value=GetProfileAttr", ENDITEM, 		"Name=SWERPC", "Value=1", ENDITEM, 		"Name=SWECmd", "Value=InvokeMethod", ENDITEM, 		"Name=SWEIPS", "Value=@0*0*1*0*14*GetProfileAttr3*0*8*attrName20*FirstTimeRefreshDone", ENDITEM, 		LAST);

if(atoi(lr_eval_string("{count10}"))>0){ lr_stop_transaction("CRM_Login"); }	else{ lr_end_transaction("CRM_Login",LR_FAIL); lr_error_message("CRM Login failed for : %s",lr_eval_string("User: {Param_LoginName}, Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

Siebel_SWECount_var += 1;

lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");

web_reg_find("Text=`Status`OK`Result`", "SaveCount=count11", "Search=ALL", LAST);

lr_resume_transaction("CRM_Login");

web_submit_data("start.swe_11", 		"Action={Param_CRM_URL}/start.swe", 		"Method=POST", 		"TargetFrame=", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t12.inf", 		"Mode=HTML", 		"EncodeAtSign=YES", 		ITEMDATA, 		"Name=SWEC", "Value={Siebel_SWECount}", ENDITEM, 		"Name=SWEMethod", "Value=SetProfileAttr", ENDITEM, 		"Name=SWERPC", "Value=1", ENDITEM, 		"Name=SWECmd", "Value=InvokeMethod", ENDITEM, 		"Name=SWEIPS", "Value=@0*0*2*0*14*SetProfileAttr3*0*5*value1*Y8*attrName20*FirstTimeRefreshDone", ENDITEM, 		LAST);

if(atoi(lr_eval_string("{count11}"))>0){ lr_stop_transaction("CRM_Login"); }	else{ lr_end_transaction("CRM_Login",LR_FAIL); lr_error_message("CRM Login failed for : %s",lr_eval_string("User: {Param_LoginName}, Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

Siebel_SWECount_var += 1;

lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");

web_reg_find("Text=`Status`Completed`", "SaveCount=count12", "Search=ALL", LAST);

web_save_timestamp_param("SiebelTimeStamp", LAST);

lr_save_int(time(NULL), "CancelID");

lr_resume_transaction("CRM_Login");

web_submit_data("start.swe_12", 		"Action={Param_CRM_URL}/start.swe", 		"Method=POST", 		"TargetFrame=", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t13.inf", 		"Mode=HTML", 		ITEMDATA, 		"Name=SWEVI", "Value=", ENDITEM, 		"Name=SWERowId", "Value=", ENDITEM, 		"Name=SWEC", "Value={Siebel_SWECount}", ENDITEM, 		"Name=crpc", "Value=1", ENDITEM, 		"Name=SWEMethod", "Value=ExecuteQuery", ENDITEM, 		"Name=SWEReqRowId", "Value=0", ENDITEM, 		"Name=SWERPC", "Value=1", ENDITEM, 		"Name=SWEApplet", "Value=FITB To Be Reviewed Pre Call Plans (WCC Home)", ENDITEM, 		"Name=SWEView", "Value=FINS Home Page View", ENDITEM, 		"Name=SWECmd", "Value=InvokeMethod", ENDITEM, 		"Name=SWETS", "Value={SiebelTimeStamp}", ENDITEM, 		"Name=SWEP", "Value=", ENDITEM, 		"Name=SWSECancelID", "Value={CancelID}", ENDITEM, //1307680541		"Name=SWERowIds", "Value=", ENDITEM, 		LAST);

if(atoi(lr_eval_string("{count12}"))>0){ lr_stop_transaction("CRM_Login"); }	else{ lr_end_transaction("CRM_Login",LR_FAIL); lr_error_message("CRM Login failed for : %s",lr_eval_string("User: {Param_LoginName}, Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

lr_save_datetime("Tomorrow is %", DATE_NOW + ONE_DAY, "next");

web_reg_find("Text=^Status^Completed^", "SaveCount=count13", "Search=ALL", LAST);

web_save_timestamp_param("SiebelTimeStamp", LAST);

web_save_timestamp_param("SelectedDateTimeStamp", LAST);

lr_resume_transaction("CRM_Login");

web_submit_data("start.swe_13", 		"Action={Param_CRM_URL}/start.swe", 		"Method=POST", 		"TargetFrame=", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t14.inf", 		"Mode=HTML", 		ITEMDATA, 		"Name=EndDate", "Value={Param_EndDate}", ENDITEM, 		"Name=StretchCell", "Value=N", ENDITEM, 		"Name=SWEVI", "Value=", ENDITEM, 		"Name=SWERowId", "Value=", ENDITEM, 		"Name=SWEC", "Value={Siebel_SWECount}", ENDITEM, 		"Name=SWEMethod", "Value=GetCalendarData", ENDITEM, 		"Name=ViewMode", "Value=0", ENDITEM, 		"Name=SWEReqRowId", "Value=0", ENDITEM, 		"Name=SWERPC", "Value=1", ENDITEM, 		"Name=CurrentDate", "Value={Param_CurrentDate}", ENDITEM, //06/10/2011		"Name=SelectedUser", "Value={Param_LoginName}", ENDITEM, 		"Name=StartDate", "Value={Param_CurrentDate}", ENDITEM, //06/10/2011		"Name=SWEApplet", "Value=Activity HI Outlook Calendar Applet", ENDITEM, 		"Name=SWEView", "Value=FINS Home Page View", ENDITEM, "Name=ClippingCount", "Value=-1.#IND", ENDITEM, "Name=SWECmd", "Value=InvokeMethod", ENDITEM, "Name={OwnerId}", "Value={userName}", ENDITEM, //s_2_1_5_0 //Steve TESTIAMGR3 "Name=SelectedDate", "Value={SelectedDateTimeStamp}", ENDITEM, //1307680541112 "Name=SWETS", "Value={SiebelTimeStamp}", ENDITEM, "Name=SelectedTimeZone", "Value=(GMT-05:00) Eastern Time (US & Canada)", ENDITEM, "Name=SWEP", "Value=", ENDITEM, "Name=SWERowIds", "Value=", ENDITEM, LAST);

if(atoi(lr_eval_string("{count13}"))>0){ lr_stop_transaction("CRM_Login"); }	else{ lr_end_transaction("CRM_Login",LR_FAIL); lr_error_message("CRM Login failed for : %s",lr_eval_string("User: {Param_LoginName}, Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

Siebel_SWECount_var -= 3;

lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");

web_reg_find("Text=`Status`OK`", "SaveCount=count14", "Search=ALL", LAST);

lr_resume_transaction("CRM_Login");

web_submit_data("start.swe_14", 		"Action={Param_CRM_URL}/start.swe", 		"Method=POST", 		"TargetFrame=", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t15.inf", 		"Mode=HTML", 		"EncodeAtSign=YES", 		ITEMDATA, 		"Name=SWEC", "Value={Siebel_SWECount}", ENDITEM, 		"Name=SWEMethod", "Value=GetAlarms", ENDITEM, 		"Name=SWERPC", "Value=1", ENDITEM, 		"Name=SWEActiveApplet", "Value=Layout Controls Applet", ENDITEM, 		"Name=SWECmd", "Value=InvokeMethod", ENDITEM, 		"Name=SWEIPS", "Value=@0*0*5*0*0*3*0*8*interval4*150013*packUIStrings4*true9*alarmDate10*{Param_CurrentDate}5*SWEJI5*false3*now8*{Param_CurrentTime}", ENDITEM, 		"Name=SWEActiveView", "Value=FINS Home Page View", ENDITEM, 		"Name=SWEService", "Value=Alarm Manager", ENDITEM, 		LAST);

if(atoi(lr_eval_string("{count14}"))>0){ lr_stop_transaction("CRM_Login"); }	else{ lr_end_transaction("CRM_Login",LR_FAIL); lr_error_message("CRM Login failed for : %s",lr_eval_string("User: {Param_LoginName}, Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

Siebel_SWECount_var += 5;

lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");

web_reg_find("Text=`Status`OK`", "SaveCount=count15", "Search=ALL", LAST);

lr_resume_transaction("CRM_Login");

web_submit_data("start.swe_15", 		"Action={Param_CRM_URL}/start.swe", 		"Method=POST", 		"TargetFrame=", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t16.inf", 		"Mode=HTML", 		"EncodeAtSign=YES", 		ITEMDATA, 		"Name=SWEC", "Value={Siebel_SWECount}", ENDITEM, 		"Name=SWEMethod", "Value=UpdatePrefMsg", ENDITEM, 		"Name=SWERPC", "Value=1", ENDITEM, 		"Name=SWECmd", "Value=InvokeMethod", ENDITEM, 		"Name=SWEIPS", "Value=@0*0*2*0*0*3*0*11*IsInitiated5*FALSE5*SWEBS1*1", ENDITEM, 		"Name=SWEBS", "Value=1", ENDITEM, 		"Name=SWEService", "Value=Message Bar", ENDITEM, 		LAST);

if(atoi(lr_eval_string("{count15}"))>0){ lr_end_transaction("CRM_Login",LR_PASS); }	else{ lr_end_transaction("CRM_Login",LR_FAIL); lr_error_message("CRM Login failed for : %s",lr_eval_string("User: {Param_LoginName}, Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

return 0; } /***********************************/

//Function to count the specific character int CountCharacter(char *input, char c){ int mainCount=0,offset=0; char *CmpSID; while(1) { CmpSID = (char *) strrchr(input,c); if(CmpSID != NULL){ mainCount++; offset = (int)( (CmpSID - input)); input[offset] = '\0'; }		else{ break; }	}	return mainCount; }

CRM21_Attach_File {	int TotalFieldsCount=0, i=0, j=0,ColumnCount, rowsCount=0, rowIDValue=0,WaveCounter; int FieldCount=0,FieldCounter=0, offset=0,FieldEvaluate, idxCounter; char *token,*string,*FieldString, cixString[500]="`cix`",*AppendZeroToMe, stringImp[500],*CmpSID, *ComparingString,*buffer;

char filename[1024], command[1024];

char new_dir[] = "C:\\Performance";

/*Click on Household screen tab*/

web_reg_save_param("Siebel_Parse_Web_Page55", 		"LB/IC=", 		"RB/IC=", 		"Ord=1", 		"Search=Body", 		"RelFrameId=1", 		"AutoCorrelationFunction=flCorrelationCallbackParseWebPage", 		"AutoCorrelationDll=LrwiSiebelCorrelationWrapper", 		LAST);

web_reg_save_param("CompCounter", "LB=`v`","RB=`i`","ORD=ALL","NotFound=Warning", LAST);

web_reg_save_param("Fields_Order", "LB=`pf`VER_1", "RB=`", "ORD=ALL", "NotFound=Warning", LAST);

web_reg_save_param("Field_ID", "LB=`sp`", "RB/ALNUMIC=`c^`","ORD=ALL", "NotFound=Warning",LAST);

web_reg_save_param("QueryId",					  "LB=`SWEField`",					   "RB=`SWENeedContext`true`SWER`0`SWESP`false`SWEMethod`NewQuery`SWECmd`InvokeMethod`SWEDIC`false`SWEReqRowId`0`SWEView`My Households View`",					   "NotFound=Warning",					   "Search=ALL",					   "Ord=1",					   LAST);

web_reg_save_param("GoQueryId",					  "LB=`SWEField`",					   "RB=SWENeedContext`true`SWER`0`SWESP`false`SWEMethod`ExecuteQuery`SWECmd`InvokeMethod`SWEDIC`false`SWEReqRowId`0`SWEView`My Households View`",					   "NotFound=Warning",					   "Ord=1",					   "Search=ALL",					   LAST);

web_reg_find("Text=`My Households: ", "SaveCount=count16", "Search=ALL", LAST);

lr_start_transaction("CRM21_Attach_File_T01_ClickHousehold");

web_submit_data("start.swe_16", 		"Action={Param_CRM_URL}/start.swe", 		"Method=POST", 		"TargetFrame=", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t17.inf", 		"Mode=HTML", 		ITEMDATA, 		"Name=SWEC", "Value={Siebel_SWECount}", ENDITEM, 		"Name=SWERPC", "Value=1", ENDITEM, 		"Name=SWEActiveApplet", "Value=Layout Controls Applet", ENDITEM, 		"Name=SWECmd", "Value=GotoPageTab", ENDITEM, 		"Name=SWEScreen", "Value=Household Screen", ENDITEM, 		"Name=SWEActiveView", "Value=FINS Home Page View", ENDITEM, 		LAST);

if(atoi(lr_eval_string("{count16}"))>0){ lr_end_transaction("CRM21_Attach_File_T01_ClickHousehold",LR_PASS); }	else{ lr_end_transaction("CRM21_Attach_File_T01_ClickHousehold",LR_FAIL); lr_error_message("Clicking on Household screen tab failed for : %s",lr_eval_string("Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

/****************************************************************************************************************/

// Checking weather there are rows for the company/ If there are no rows then please exit the vuser. if(atoi(lr_eval_string("{Fields_Order_count}"))>0 && atoi(lr_eval_string("{Field_ID_count}"))>0){ string = lr_eval_string("{Fields_Order_1}"); TotalFieldsCount = CountCharacter(string,'~'); // Finding Column count in the Company Columns string = lr_eval_string("{CompCounter_1}"); ColumnCount = CountCharacter(string,'*'); if(ColumnCount<=9){ lr_save_int(ColumnCount,"AppendZeroToMe"); AppendZeroToMe = lr_eval_string("{AppendZeroToMe}"); string =lr_eval_string("0{AppendZeroToMe}"); lr_save_string(string,"ColumnCountValue"); }		else{ lr_save_int(ColumnCount,"ColumnCountValue"); string = lr_eval_string("{ColumnCountValue}"); lr_save_string(string,"ColumnCountValue"); }		// End

// Finding Field ID Name = Siebel_Parse_Web_Page46_S_BC3_S47_R05_FID sprintf(string,"{Siebel_Parse_Web_Page55_S_BC3_S%s_R01_FID}",lr_eval_string("{ColumnCountValue}")); lr_save_string(lr_eval_string(string),"First_Row_ID"); //End // Calculating the first Custom request format. Row_ID_For_Field lr_save_string(			lr_eval_string("SWER=0&SWEVI=&SWEMethod=NewQuery&SWEReqRowId=1&SWERPC=1&SWENeedContext=true" "&SWEApplet=Households%20List%20Applet&SWEActiveApplet=Households%20List%20Applet" "&SWEView=My%20Households%20View&SWEActiveView=My%20Households%20View&SWECmd=InvokeMethod" "&SWESP=false&SWEBID=-1&SWEDIC=false&SWEP=&SWEField={QueryId}&SWERowId={First_Row_ID}"),			 "ClickQueryCustReqBody");

//ExecQueryCustReqBody lr_save_string(			lr_eval_string("SWER=0&SWEVI=&SWEMethod=ExecuteQuery&SWEReqRowId=1&SWERPC=1&SWENeedContext=true" "&SWEApplet=Households%20List%20Applet&SWEActiveApplet=Households%20List%20Applet" "&SWEView=My%20Households%20View&SWEActiveView=My%20Households%20View&SWECmd=InvokeMethod&crpc=1" "&SWESP=false&SWEBID=-1&SWEDIC=false&SWEP=&SWEField={GoQueryId}&SWERowId={First_Row_ID}"),			 "ExecQueryCustReqBody");

// Picking up the values for FieldID = Field ID value in Siebel_Parse_Web_Page46_S_BC3_S**_R**_F** format FieldCounter =0; WaveCounter = -1; idxCounter = 1; FieldCount = atoi(lr_eval_string("{Field_ID_count}"));

token = (char *) strtok(lr_eval_string("{Fields_Order_1}"),"~"); for (j=1;j<=TotalFieldsCount;j++) {

if(j!=1){ strtok(NULL,"~"); }			cixString[0] = '`';cixString[1]='c';cixString[2]='i';cixString[3]='x';cixString[4]='`';cixString[5]='\0'; offset =1; token = (char *) strtok(NULL,"|"); ComparingString = "0"; if(strcmp(token,ComparingString)==0){ WaveCounter++; FieldCounter++; lr_save_int(WaveCounter,"Name_Field"); lr_save_string(lr_eval_string("{Name_Field}"),"Name_Field");

FieldString = lr_eval_string("{Name_Field}"); strcat(cixString,FieldString); strcat(cixString,"`"); for(i=idxCounter;i<=FieldCount;i++){ FieldString = lr_paramarr_idx("Field_ID",i); CmpSID = (char *) strstr(FieldString,cixString);

if(CmpSID != NULL){ offset = 0; CmpSID = (char *) strstr(FieldString,"`"); offset = (int)( (CmpSID - FieldString)); FieldString[offset] = '\0';

idxCounter = i+1;

lr_save_string(FieldString,"FieldName"); FieldEvaluate = FieldCounter; if(FieldEvaluate<=9){ lr_save_int(FieldEvaluate,"AppendZeroToMe"); AppendZeroToMe = lr_eval_string("{AppendZeroToMe}"); string =lr_eval_string("0{AppendZeroToMe}"); lr_save_string(string,"Rows_FieldValue"); }						else{ lr_save_int(FieldEvaluate,"Rows_FieldValue"); string = lr_eval_string("{Rows_FieldValue}"); lr_save_string(string,"Rows_FieldValue"); }						sprintf(string, "{Siebel_Parse_Web_Page55_S_BC3_S%s_R01_F%s}",								lr_eval_string("{ColumnCountValue}"),lr_eval_string("{Rows_FieldValue}"));

lr_save_string(lr_eval_string(string),"Buffer");

lr_save_string(lr_eval_string("{ClickQueryCustReqBody}&{FieldName}0={Buffer}"),"ClickQueryCustReqBody");

token = (char *) strtok(NULL, "|");

if(strcmp(token,"Household Name")==0){ lr_save_string(lr_eval_string("{ExecQueryCustReqBody}&{FieldName}0={Param_HouseholdName}"),"ExecQueryCustReqBody"); lr_save_string(lr_eval_string("{FieldName}0"),"HouseId"); }						else{ lr_save_string(lr_eval_string("{ExecQueryCustReqBody}&{FieldName}0="),"ExecQueryCustReqBody"); }                       break; }					else{ continue; }				}// End of i for loop }			else{ continue; }		}//End of j loop }	else{ lr_error_message("There are no rows in the Households section. %s", lr_eval_string(" Iteration: {Iteration}, VuserId: {VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); //CRM_Logoff; lr_exit(LR_EXIT_VUSER,LR_FAIL); }

/***********************************************************************************************************************************/

/*Click on Query button*/

Siebel_SWECount_var += 1;

lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");

web_reg_find("Text=`Status`Completed`", "SaveCount=count17", "Search=ALL", LAST);

web_save_timestamp_param("SiebelTimeStamp", LAST);

lr_save_string(lr_eval_string("{ClickQueryCustReqBody}&SWEC={Siebel_SWECount}&SWETS={SiebelTimeStamp}"),"ClickQueryCustReqBody");

lr_start_transaction("CRM21_Attach_File_T02_ClickQuery");

web_custom_request("start.swe_17", 		"URL={Param_CRM_URL}/start.swe", 		"Method=POST", 		"TargetFrame=", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t18.inf", 		"Mode=HTML",		"Body={ClickQueryCustReqBody}",		LAST);

if(atoi(lr_eval_string("{count17}"))>0){ lr_stop_transaction("CRM21_Attach_File_T02_ClickQuery"); }	else{ lr_end_transaction("CRM21_Attach_File_T02_ClickQuery",LR_FAIL); lr_error_message("Clicking on Query button failed for : %s",lr_eval_string("Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

Siebel_SWECount_var += 1;

lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");

lr_think_time(5);

web_reg_find("Text=`Status`OK`", "SaveCount=count18", "Search=ALL", LAST);

lr_resume_transaction("CRM21_Attach_File_T02_ClickQuery");

web_submit_data("start.swe_18", 		"Action={Param_CRM_URL}/start.swe", 		"Method=POST", 		"TargetFrame=", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t19.inf", 		"Mode=HTML", 		"EncodeAtSign=YES", 		ITEMDATA, 		"Name=SWEC", "Value={Siebel_SWECount}", ENDITEM, 		"Name=SWEMethod", "Value=UpdatePrefMsg", ENDITEM, 		"Name=SWERPC", "Value=1", ENDITEM, 		"Name=SWECmd", "Value=InvokeMethod", ENDITEM, 		"Name=SWEIPS", "Value=@0*0*1*0*0*3*0*5*SWEBS1*1", ENDITEM, 		"Name=SWEBS", "Value=1", ENDITEM, 		"Name=SWEService", "Value=Message Bar", ENDITEM, 		LAST);

if(atoi(lr_eval_string("{count18}"))>0){ lr_end_transaction("CRM21_Attach_File_T02_ClickQuery",LR_PASS); }	else{ lr_end_transaction("CRM21_Attach_File_T02_ClickQuery",LR_FAIL); lr_error_message("Clicking on Query button failed for : %s",lr_eval_string("Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

/*Enter Household Name and click on Go button*/

web_reg_save_param("Siebel_Parse_Web_Page76", 		"LB/IC=", 		"RB/IC=", 		"Ord=1", 		"Search=Body", 		"RelFrameId=1", 		"AutoCorrelationFunction=flCorrelationCallbackParseWebPage", 		"AutoCorrelationDll=LrwiSiebelCorrelationWrapper", 		LAST);

//`bc`S_BC3`1`0`FieldValues`0`ValueArray` web_reg_save_param("CompCounter", "LB/ALNUMIC=`bc`S_BC3`^`^`FieldValues`^`ValueArray`","RB=`","ORD=ALL","NotFound=Warning", LAST);

web_reg_find("Text=~LIKE \"", "SaveCount=count19", "Search=ALL", LAST);

web_save_timestamp_param("SiebelTimeStamp", LAST);

lr_save_int(time(NULL),"CancelID");

lr_save_string(lr_eval_string("{ExecQueryCustReqBody}&SWSECancelID={CancelID}&SWEC={Siebel_SWECount}&SWETS={SiebelTimeStamp}"),"ExecQueryCustReqBody");

lr_start_transaction("CRM21_Attach_File_T03_SearchByHouseholdName");

web_custom_request("start.swe_19", 		"URL={Param_CRM_URL}/start.swe", 		"Method=POST", 		"TargetFrame=", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t20.inf", 		"Mode=HTML",		"Body={ExecQueryCustReqBody}", 		LAST);

if(atoi(lr_eval_string("{count19}"))>0){ lr_end_transaction("CRM21_Attach_File_T03_SearchByHouseholdName",LR_PASS); }	else{ lr_end_transaction("CRM21_Attach_File_T03_SearchByHouseholdName",LR_FAIL); lr_error_message("Searching by Household name failed for : %s",lr_eval_string("Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

/****************************************************************************************************************/

// Checking weather there are rows for the company/ If there are no rows then please exit the vuser. if(atoi(lr_eval_string("{Fields_Order_count}"))>0 && atoi(lr_eval_string("{Field_ID_count}"))>0){ string = lr_eval_string("{Fields_Order_1}"); TotalFieldsCount = CountCharacter(string,'~'); // Finding Column count in the Company Columns string = lr_eval_string("{CompCounter_1}"); ColumnCount = CountCharacter(string,'*'); if(ColumnCount<=9){ lr_save_int(ColumnCount,"AppendZeroToMe"); AppendZeroToMe = lr_eval_string("{AppendZeroToMe}"); string =lr_eval_string("0{AppendZeroToMe}"); lr_save_string(string,"ColumnCountValue"); }		else{ lr_save_int(ColumnCount,"ColumnCountValue"); string = lr_eval_string("{ColumnCountValue}"); lr_save_string(string,"ColumnCountValue"); }		// End

//ExecQueryCustReqBody lr_save_string(			lr_eval_string("SWER=0&SWEVI=&SWEMethod=Drilldown&SWEReqRowId=1&SWERPC=1&SWECmd=InvokeMethod&SWEP=" "&SWEApplet=Households%20List%20Applet&SWEActiveApplet=Households%20List%20Applet" "&SWEView=My%20Households%20View&SWEActiveView=My%20Households%20View&SWEField={HouseId}"),			 "ClickHouseNameCustReqBody");

// Picking up the values for FieldID = Field ID value in Siebel_Parse_Web_Page46_S_BC3_S**_R**_F** format FieldCounter =0; WaveCounter = -1; idxCounter = 1; FieldCount = atoi(lr_eval_string("{Field_ID_count}"));

token = (char *) strtok(lr_eval_string("{Fields_Order_1}"),"~"); for (j=1;j<=TotalFieldsCount;j++) {

if(j!=1){ strtok(NULL,"~"); }			cixString[0] = '`';cixString[1]='c';cixString[2]='i';cixString[3]='x';cixString[4]='`';cixString[5]='\0'; offset =1; token = (char *) strtok(NULL,"|"); ComparingString = "0"; if(strcmp(token,ComparingString)==0){ WaveCounter++; FieldCounter++; lr_save_int(WaveCounter,"Name_Field"); lr_save_string(lr_eval_string("{Name_Field}"),"Name_Field");

FieldString = lr_eval_string("{Name_Field}"); strcat(cixString,FieldString); strcat(cixString,"`"); for(i=idxCounter;i<=FieldCount;i++){ FieldString = lr_paramarr_idx("Field_ID",i); CmpSID = (char *) strstr(FieldString,cixString);

if(CmpSID != NULL){ offset = 0; CmpSID = (char *) strstr(FieldString,"`"); offset = (int)( (CmpSID - FieldString)); FieldString[offset] = '\0';

idxCounter = i+1;

lr_save_string(FieldString,"FieldName"); FieldEvaluate = FieldCounter; if(FieldEvaluate<=9){ lr_save_int(FieldEvaluate,"AppendZeroToMe"); AppendZeroToMe = lr_eval_string("{AppendZeroToMe}"); string =lr_eval_string("0{AppendZeroToMe}"); lr_save_string(string,"Rows_FieldValue"); }						else{ lr_save_int(FieldEvaluate,"Rows_FieldValue"); string = lr_eval_string("{Rows_FieldValue}"); lr_save_string(string,"Rows_FieldValue"); }						sprintf(string, "{Siebel_Parse_Web_Page76_S_BC3_S%s_R01_F%s}",								lr_eval_string("{ColumnCountValue}"),lr_eval_string("{Rows_FieldValue}"));

lr_save_string(lr_eval_string(string),"Buffer");

token = (char *) strtok(NULL, "|");

if(strcmp(token,"HH Row Id") == 0){ lr_save_string(lr_eval_string("{ClickHouseNameCustReqBody}&SWERowId={Buffer}"),"ClickHouseNameCustReqBody"); lr_save_string(lr_eval_string("{Buffer}"),"HouseRowId"); lr_output_message("Household ID; %s", token); }						else{ lr_save_string(lr_eval_string("{ClickHouseNameCustReqBody}&{FieldName}0={Buffer}"),"ClickHouseNameCustReqBody"); }

break; }					else{ continue; }				}// End of i for loop }			else{ continue; }		}//End of j loop }	else{ lr_error_message("There are no rows in the Households section. %s", lr_eval_string(" Iteration: {Iteration}, VuserId: {VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); //CRM_Logoff; lr_exit(LR_EXIT_VUSER,LR_FAIL); }

/***********************************************************************************************************************************/

/*Click on Household Name 'Manss' link*/

Siebel_SWECount_var += 1;

lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");

lr_think_time(5);

//To capture values of existing attachment details web_reg_save_param("Fields_OrderString", "LB=`pf`VER_1", "RB=``bci`S_BC16`", "ORD=ALL", "NotFound=Warning", LAST);

web_reg_save_param("Field_ID", "LB=`sp`", "RB/ALNUMIC=`c^`","ORD=ALL", "NotFound=Warning",LAST);

web_reg_find("Text=`Target`top._sweclient._swecontent._sweview`", "SaveCount=count20", "Search=ALL", LAST);

web_save_timestamp_param("SiebelTimeStamp", LAST);

lr_save_string(lr_eval_string("{ClickHouseNameCustReqBody}&SWEC={Siebel_SWECount}&SWETS={SiebelTimeStamp}"),"ClickHouseNameCustReqBody");

lr_start_transaction("CRM21_Attach_File_T04_ClickOnHouseholdName");

web_custom_request("start.swe_20", 		"URL={Param_CRM_URL}/start.swe", 		"Method=POST", 		"TargetFrame=", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t21.inf", 		"Mode=HTML",	   "Body={ClickHouseNameCustReqBody}",		LAST);

if(atoi(lr_eval_string("{count20}"))>0){ lr_stop_transaction("CRM21_Attach_File_T04_ClickOnHouseholdName"); }	else{ lr_end_transaction("CRM21_Attach_File_T04_ClickOnHouseholdName",LR_FAIL); lr_error_message("Clicking on Household name link is failed for : %s",lr_eval_string("Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

if(atoi(lr_eval_string("{Fields_OrderString_count}")) >0){ string = (char*)strtok(lr_eval_string("{Fields_OrderString_1}"),"`");

lr_save_string(string,"Fields_Order"); }

Siebel_SWECount_var += 1;

lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");

lr_think_time(5);

web_reg_find("Text=`Status`OK`", "SaveCount=count21", "Search=ALL", LAST);

lr_resume_transaction("CRM21_Attach_File_T04_ClickOnHouseholdName");

web_submit_data("start.swe_21", 		"Action={Param_CRM_URL}/start.swe", 		"Method=POST", 		"TargetFrame=", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t22.inf", 		"Mode=HTML", 		"EncodeAtSign=YES", 		ITEMDATA, 		"Name=SWEC", "Value={Siebel_SWECount}", ENDITEM, 		"Name=SWEMethod", "Value=UpdatePrefMsg", ENDITEM, 		"Name=SWERPC", "Value=1", ENDITEM, 		"Name=SWECmd", "Value=InvokeMethod", ENDITEM, 		"Name=SWEIPS", "Value=@0*0*1*0*0*3*0*5*SWEBS1*1", ENDITEM, 		"Name=SWEBS", "Value=1", ENDITEM, 		"Name=SWEService", "Value=Message Bar", ENDITEM, 		LAST);

if(atoi(lr_eval_string("{count21}"))>0){ lr_end_transaction("CRM21_Attach_File_T04_ClickOnHouseholdName",LR_PASS); }	else{ lr_end_transaction("CRM21_Attach_File_T04_ClickOnHouseholdName",LR_FAIL); lr_error_message("Clicking on Household name link is failed for : %s",lr_eval_string("Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

/*Click on Clients/Contacts view tab*/

web_reg_save_param("Siebel_Parse_Web_Page92", 		"LB/IC=", 		"RB/IC=", 		"Ord=1", 		"Search=Body", 		"RelFrameId=1", 		"AutoCorrelationFunction=flCorrelationCallbackParseWebPage", 		"AutoCorrelationDll=LrwiSiebelCorrelationWrapper", 		LAST);

web_reg_save_param("CompCounter", "LB=`v`", "RB/ALNUMIC=`^`^`tr`^`v``^`^`nbc`^`^`^`bci`^`S_BC10`","ORD=ALL","NotFound=Warning", LAST);

web_reg_find("Text=`SWEApplet`Contact Attachment Applet`", "SaveCount=count22", "Search=ALL", LAST);

lr_start_transaction("CRM21_Attach_File_T05_ClickOnClients_Contancts");

web_submit_data("start.swe_22", 		"Action={Param_CRM_URL}/start.swe", 		"Method=POST", 		"TargetFrame=", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t23.inf", 		"Mode=HTML", 		ITEMDATA, 		"Name=SWEC", "Value={Siebel_SWECount}", ENDITEM, 		"Name=SWEScrollTop", "Value=3*253", ENDITEM, 		"Name=SWERPC", "Value=1", ENDITEM, 		"Name=SWENeedContext", "Value=false", ENDITEM, 		"Name=SWEActiveApplet", "Value=Household Contact List Applet", ENDITEM, 		"Name=SWEView", "Value=FITB Households Client Detail View", ENDITEM, 		"Name=SWECmd", "Value=GotoView", ENDITEM, 		"Name=SWEScrollId", "Value=s_vctrl_div", ENDITEM, 		"Name=SWEKeepContext", "Value=1", ENDITEM, 		"Name=SWEActiveView", "Value=FITB Households Client Detail View", ENDITEM, 		LAST);

if(atoi(lr_eval_string("{count22}"))>0){ lr_end_transaction("CRM21_Attach_File_T05_ClickOnClients_Contancts",LR_PASS); }	else{ lr_end_transaction("CRM21_Attach_File_T05_ClickOnClients_Contancts",LR_FAIL); lr_error_message("Clicking on Clients/Contacts failed for : %s",lr_eval_string("Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

// Finding Column count in the Company Columns string = lr_eval_string("{CompCounter_1}"); ColumnCount = CountCharacter(string,'*'); if(ColumnCount<=9){ lr_save_int(ColumnCount,"AppendZeroToMe"); AppendZeroToMe = lr_eval_string("{AppendZeroToMe}"); string =lr_eval_string("0{AppendZeroToMe}"); lr_save_string(string,"ColumnCountValue"); }		else{ lr_save_int(ColumnCount,"ColumnCountValue"); string = lr_eval_string("{ColumnCountValue}"); lr_save_string(string,"ColumnCountValue"); }

sprintf(string,"{Siebel_Parse_Web_Page92_S_BC12_S%s_R01_FID}",lr_eval_string("{ColumnCountValue}")); lr_save_string(lr_eval_string(string),"Client_Row_ID"); //End

/*Go to Attachments section and click on New button*/

Siebel_SWECount_var += 1;

lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");

lr_think_time(5);

web_reg_find("Text=`Status`OK`", "SaveCount=count23", "Search=ALL", LAST);

lr_start_transaction("CRM21_Attach_File_T06_ClickOnNewButton");

web_submit_data("start.swe_23", 		"Action={Param_CRM_URL}/start.swe", 		"Method=POST", 		"TargetFrame=", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t24.inf", 		"Mode=HTML", 		"EncodeAtSign=YES", 		ITEMDATA, 		"Name=SWEC", "Value={Siebel_SWECount}", ENDITEM, 		"Name=SWEMethod", "Value=UpdatePrefMsg", ENDITEM, 		"Name=SWERPC", "Value=1", ENDITEM, 		"Name=SWECmd", "Value=InvokeMethod", ENDITEM, 		"Name=SWEIPS", "Value=@0*0*1*0*0*3*0*5*SWEBS1*1", ENDITEM, 		"Name=SWEBS", "Value=1", ENDITEM, 		"Name=SWEService", "Value=Message Bar", ENDITEM, 		LAST);

if(atoi(lr_eval_string("{count23}"))>0){ lr_end_transaction("CRM21_Attach_File_T06_ClickOnNewButton",LR_PASS); }	else{ lr_end_transaction("CRM21_Attach_File_T06_ClickOnNewButton",LR_FAIL); lr_error_message("Clicking on New button in Attachment applet failed for : %s",lr_eval_string("Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); 		lr_exit(LR_EXIT_VUSER,LR_FAIL); }

/*Select the txt file and Click on Open button*/

Siebel_SWECount_var -= 13;

lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");

web_save_timestamp_param("SiebelTimeStamp", LAST);

lr_save_int(Siebel_SWECount_var + 3, "Siebel_SWECount_1");

web_reg_save_param("Siebel_Parse_Web_Page104", 		"LB/IC=", 		"RB/IC=", 		"Ord=1", 		"Search=Body", 		"RelFrameId=1", 		"AutoCorrelationFunction=flCorrelationCallbackParseWebPage", 		"AutoCorrelationDll=LrwiSiebelCorrelationWrapper", 		LAST);

web_save_timestamp_param("TimeStamp",LAST);

sprintf(filename, "%s\\%s", new_dir, lr_eval_string("Perf{TimeStamp}.txt"));

sprintf(command, "dir %s > %s /w", new_dir, filename );

lr_save_string(filename,"FileName"); system(command);

lr_think_time(5);

//`bc`S_BC16`1`0`FieldValues`0`ValueArray`11*PerfTesting2*953*txt9*Team Only19*06/10/2011 00:43:041*Y1*N1*Y0*8*1-7YK9B5` web_reg_save_param("CompCounter", "LB/ALNUMIC=`bc`S_BC16`^`^`FieldValues`^`ValueArray`","RB=`","ORD=ALL","NotFound=Warning", LAST);

web_reg_find("Text=`Status`Completed`", "SaveCount=count24", "Search=ALL", LAST);

lr_start_transaction("CRM21_Attach_File_T07_Attach_File");

web_submit_data("start.swe_24", 		"Action={Param_CRM_URL}/start.swe", 		"Method=POST", 		"EncType=multipart/form-data", 		"TargetFrame=", 		"RecContentType=text/html", 		"Referer={Param_CRM_URL}/start.swe?SWECmd=GetCachedFrame&SWEACn={Siebel_SWEACn9}&SWEC={Siebel_SWECount_1}&SWEFrame=top._swe._sweattachment", 		"Snapshot=t25.inf", 		"Mode=HTML", 		ITEMDATA, 		"Name=SWEC", "Value={Siebel_SWECount}", ENDITEM, 		"Name=SWENeedContext", "Value=false", ENDITEM, 		"Name=SWETS", "Value={SiebelTimeStamp}", ENDITEM, 		"Name=SWEBID", "Value=-1", ENDITEM, 		"Name=SWECmd", "Value=InvokeMethod", ENDITEM, 		"Name=SWEMethod", "Value=NewFileAttachment", ENDITEM, 		"Name=SWEVI", "Value=", ENDITEM, 		"Name=SWEView", "Value=FITB Households Client Detail View", ENDITEM, 		"Name=SWEApplet", "Value=Contact Attachment Applet", ENDITEM, 		"Name=SWEP", "Value=", ENDITEM, 		"Name=SWEField", "Value=", ENDITEM, "Name=SWERowId", "Value=", ENDITEM, "Name=SWERowIds", "Value=SWERowId0={HouseRowId},SWERowId1={Client_Row_ID}", ENDITEM, //Siebel_Parse_Web_Page92_S_BC14_S21_R01_FID  //Siebel_Parse_Web_Page92_S_BC12_S29_R01_FID "Name=SWEReqRowId", "Value=0", ENDITEM, "Name=s_SweFileName", "Value={FileName}", "File=Yes", ENDITEM, //U:\\PerfTesting.txt LAST);

if(atoi(lr_eval_string("{count24}"))>0){ lr_end_transaction("CRM21_Attach_File_T07_Attach_File",LR_PASS); }	else{ lr_end_transaction("CRM21_Attach_File_T07_Attach_File",LR_FAIL); lr_error_message("Failed to attach file for : %s",lr_eval_string("Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); 		lr_exit(LR_EXIT_VUSER,LR_FAIL); }

/****************************************************************************************************************/

// Checking weather there are rows for the company/ If there are no rows then please exit the vuser. if(atoi(lr_eval_string("{Fields_OrderString_count}"))>0 && atoi(lr_eval_string("{Field_ID_count}"))>0){ string = lr_eval_string("{Fields_Order}"); TotalFieldsCount = CountCharacter(string,'~'); // Finding Column count in the Company Columns string = lr_eval_string("{CompCounter_1}"); ColumnCount = CountCharacter(string,'*'); if(ColumnCount<=9){ lr_save_int(ColumnCount,"AppendZeroToMe"); AppendZeroToMe = lr_eval_string("{AppendZeroToMe}"); string =lr_eval_string("0{AppendZeroToMe}"); lr_save_string(string,"ColumnCountValue"); }		else{ lr_save_int(ColumnCount,"ColumnCountValue"); string = lr_eval_string("{ColumnCountValue}"); lr_save_string(string,"ColumnCountValue"); }		// End

sprintf(string, "{Siebel_Parse_Web_Page104_S_BC16_S%s_R01_F%s}",								lr_eval_string("{ColumnCountValue}"),lr_eval_string("{ColumnCountValue}"));

lr_save_string(lr_eval_string(string),"NewFileRowId");

//ExecQueryCustReqBody lr_save_string(			lr_eval_string("SWEVI=&SWEMethod=WriteRecord&SWEReqRowId=1&SWERPC=1&SWEApplet=Contact%20Attachment%20Applet" "&SWEActiveApplet=Contact%20Attachment%20Applet&SWEView=FITB%20Households%20Client%20Detail%20View" "&SWEActiveView=FITB%20Households%20Client%20Detail%20View&SWECmd=InvokeMethod" "&SWEIPS=@0*0*2*0*0*3*0*15*Method Argument0*7*Command135*@0*0*6*0*0*3*0*6*Target14*Browser Applet15*Method Argument0*6*Method11*WriteRecord2*dx0*6*Applet25*Contact Attachment Applet7*Service0*&SWESP=false&SWEP="),			 "SaveRecordCustReqBody");

// Picking up the values for FieldID = Field ID value in Siebel_Parse_Web_Page46_S_BC3_S**_R**_F** format FieldCounter =0; WaveCounter = -1; idxCounter = 1; FieldCount = atoi(lr_eval_string("{Field_ID_count}"));

token = (char *) strtok(lr_eval_string("{Fields_Order}"),"~"); for (j=1;j<=TotalFieldsCount;j++) {

if(j!=1){ strtok(NULL,"~"); }			cixString[0] = '`';cixString[1]='c';cixString[2]='i';cixString[3]='x';cixString[4]='`';cixString[5]='\0'; offset =1; token = (char *) strtok(NULL,"|"); ComparingString = "0"; if(strcmp(token,ComparingString)==0){ WaveCounter++; FieldCounter++; lr_save_int(WaveCounter,"Name_Field"); lr_save_string(lr_eval_string("{Name_Field}"),"Name_Field");

FieldString = lr_eval_string("{Name_Field}"); strcat(cixString,FieldString); strcat(cixString,"`"); for(i=idxCounter;i<=FieldCount;i++){ FieldString = lr_paramarr_idx("Field_ID",i); CmpSID = (char *) strstr(FieldString,cixString);

if(CmpSID != NULL){ offset = 0; CmpSID = (char *) strstr(FieldString,"`"); offset = (int)( (CmpSID - FieldString)); FieldString[offset] = '\0';

idxCounter = i+1;

lr_save_string(FieldString,"FieldName"); FieldEvaluate = FieldCounter; if(FieldEvaluate<=9){ lr_save_int(FieldEvaluate,"AppendZeroToMe"); AppendZeroToMe = lr_eval_string("{AppendZeroToMe}"); string =lr_eval_string("0{AppendZeroToMe}"); lr_save_string(string,"Rows_FieldValue"); }						else{ lr_save_int(FieldEvaluate,"Rows_FieldValue"); string = lr_eval_string("{Rows_FieldValue}"); lr_save_string(string,"Rows_FieldValue"); }						sprintf(string, "{Siebel_Parse_Web_Page104_S_BC16_S%s_R01_F%s}",								lr_eval_string("{ColumnCountValue}"),lr_eval_string("{Rows_FieldValue}"));

lr_save_string(lr_eval_string(string),"Buffer");

token = (char *) strtok(NULL, "|");

lr_save_string(lr_eval_string("{SaveRecordCustReqBody}&{FieldName}0={Buffer}"),"SaveRecordCustReqBody");

break; }					else{ continue; }				}// End of i for loop }			else{ continue; }		}//End of j loop }	else{ lr_error_message("There are no rows in the Attachments section. %s", lr_eval_string(" Iteration: {Iteration}, VuserId: {VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); //CRM_Logoff; lr_exit(LR_EXIT_VUSER,LR_FAIL); }

/***********************************************************************************************************************************/

/*Save the record*/

Siebel_SWECount_var += 14;

lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");

web_reg_find("Text=`Status`Completed`", "SaveCount=count25", "Search=ALL", LAST);

lr_think_time(5);

web_save_timestamp_param("SiebelTimeStamp", LAST);

lr_save_string(lr_eval_string("{SaveRecordCustReqBody}&SWERowId={NewFileRowId}&SWEC={Siebel_SWECount}&SWETS={SiebelTimeStamp}" "&SWERowIds=SWERowId0={HouseRowId},SWERowId1={Client_Row_ID}"),"SaveRecordCustReqBody");

lr_start_transaction("CRM21_Attach_File_T08_Save_Record");

web_custom_request("start.swe_25", 		"URL={Param_CRM_URL}/start.swe", 		"Method=POST", 		"TargetFrame=", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t26.inf", 		"Mode=HTML", 		"Body={SaveRecordCustReqBody}",LAST);

if(atoi(lr_eval_string("{count25}"))>0){ lr_end_transaction("CRM21_Attach_File_T08_Save_Record",LR_PASS); if(remove(filename)!=0){ lr_error_message("Unable to remove the created file"); }	}	else{ lr_end_transaction("CRM21_Attach_File_T08_Save_Record",LR_FAIL); lr_error_message("Failed to save after attaching the file for : %s",lr_eval_string("Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); 		lr_exit(LR_EXIT_VUSER,LR_FAIL); }

return 0; }

/************************************/

vuser_end {

/*Logout*/

Siebel_SWECount_var += 1;

lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");

web_reg_find("Text=User ID:", "SaveCount=count26", "Search=ALL", LAST);

lr_start_transaction("CRM_Logoff");

web_url("start.swe_27", 		"URL={Param_CRM_URL}/start.swe?SWECmd=Logoff&SWETS={SiebelTimeStamp}&SWEPreLd=1&SWEClearLC=1", 		"TargetFrame=", 		"Resource=0", 		"RecContentType=text/html", 		"Referer=", 		"Snapshot=t28.inf", 		"Mode=HTML", 		LAST);

if(atoi(lr_eval_string("{count26}"))>0){ lr_end_transaction("CRM_Logoff",LR_PASS); }	else{ lr_end_transaction("CRM_Logoff",LR_FAIL); lr_error_message("Failed to Logoff for : %s",lr_eval_string("Iteration: {Iteration}, VuserId:{VuserId}, Time: {Param_CurrentDate} {Param_CurrentTime}")); lr_exit(LR_EXIT_VUSER,LR_FAIL); }

return 0; }

1. Basic - 2. HR 3. Conveyence 4. Flexi benefits - lta, food coupon, medical, sodexho, telephone 5. Adhoc Allowance: A full time employee will get the portion of CTC as adhoc (balance amount after all prevailing component classifications) The full time employee has the flexibility to decide the amount of adhoc component of the CTC The adhoc allowance is fully taxable 6. Assured Pay: Assured pay is applicable for Senior Engineer, Team Leader and Project leader level in business unit. Assured Pay is calculated as 8% of CTC Assured pay is payable bianually - March and September An employee will forfeit AP for those days in the pay period when he or she is on leave without pay and the assured pay will be pro-rated accordingly. 7. Niche Skill Incentive: A special skill set incentive as part of the CTC