========================
//checking a transaction pass or fail based on text check
web_reg_find("Text=Trainer Regions List", "SaveCount=Text_Count",
LAST);
if(atoi(lr_eval_string("{Text_Count}"))>0){
lr_end_transaction("3DR_SXX_T0X_LaunchPage",LR_PASS);
}
else
{
lr_end_transaction("3DR_SXX_T0X_LaunchPage",LR_FAIL);
}
===========================================================================================================
Removing char from string
========================
#include
void remchar(char *s, char chr){
int i, j = 0; for ( i = 0; s[i] != '\0'; i++ ) /* 'i' moves through all of original 's' */
{
if ( s[i] != chr )
{
s[j++] = s[i]; /* 'j' only moves after we write a non-'chr' */
}
}
s[j] = '\0'; /* re-null-terminate */
}
int main(){
char text[] = "The quick brown fox jumps over the lazy dog.";
printf("before : %s\n", text);
remchar(text, 'o');
printf("after : %s\n", text);
return 0;
}
/* my output
before : The quick brown fox jumps over the lazy dog.
after : The quick brwn fx jumps ver the lazy dg.*/
===========================================================================================================
PuTTY
=====
First, let's clarify the terminology for you.
1) putty is not a command, it is a standalone terminal client.
2) putty does not have commands. The 'commands' depend on what server you are connected to is using as a shell. In this case, it SOUNDS like you are connecting to BASH. A quick google of 'Bash commands' will tell you what commands are available. Putty can also connect to winblows servers or servers that run entirely different command sets, and even old school dialup BBS systems.
3) Downloading files in a BASH session will NOT store them on your computer but on the server you are connected to - there really is no practical way to move files from a remote bash session to your local system unless your local system is set up as an FTP server. You want to grab files from your remote system, that's what FTP is for. If your FTP login doesn't have access to the same directories as BASH or whatever shell you are logged into, copy the file to a directory you DO have FTP access to.
4) This has nothing to do with programming
===========================================================================================================
Do-while
========
web_save_timestamp_param("p_Starttime",LAST);
web_save_timestamp_param("p_tStamp",LAST);
lr_output_message("StartTime= %s ",lr_eval_string("{p_Starttime}"));
//---------------------------------------------------------------------------
do
{
web_submit_data("checkDeploymentStatus.jsp",
"Action=http://{p_URL}/URIxxx/checkDeploymentStatus.jsp?dummy={p_tStamp}",
"Method=POST",
"RecContentType=text/html",
"Referer=http://{p_URL/URIxxx/ShowDeployedFiles.jsp",
"Mode=HTML",
ITEMDATA,
"Name=jobID", "Value={c_JobID}", ENDITEM,
LAST);
lr_output_message("Iteration No:%i",i);
i=i+1;
}while(i<=55);
web_save_timestamp_param("p_Endtime",LAST);
lr_output_message("End Time= %s ",lr_eval_string("{p_Endtime}"));
//-----------------------------------------------------------------------------
===========================================================================================================
global section
---------------
const int tt=5;
int n=1;
char OfficeList[100], FAList[100];
int g1;
char strOfficeFAXml[9999];
--------------
Action
----------------
web_reg_save_param("OfficeList", "LB=\\u003cFa\\u003e", "RB=\\u003c/Fa", "Ord=All", "NotFound=Warning", LAST);
web_reg_save_param("FAList", "LB=\\u003cFa\\u003e", "RB=\\u003c/Fa", "Ord=All", "NotFound=Warning", LAST);
strcpy(strOfficeFAXml, "");
for (g1=1; g1<=atoi(lr_eval_string("{OfficeList_count}")); g1++)
{
strcat(strOfficeFAXml, "
strcat(strOfficeFAXml, lr_paramarr_idx("OfficeList", g1));
strcat(strOfficeFAXml, "
strcat(strOfficeFAXml, lr_paramarr_idx("FAList", g1));
strcat(strOfficeFAXml, "
}
lr_save_string(strOfficeFAXml, "OfficeFAListXml");
lr_message("OfficeFAListXml :%s", lr_eval_string("{OfficeFAListXml}"));
===========================================================================================================
set this function in inint web_set_sockets_option("SSL_VERSION","TLS");
Enable Integrated Authetication to yesfrom preferences.
Set proxy to enable firewall unblocking
When loadrunner is unable to record in that case add hosts entry in host file under below path to make loadrunner record events
Go to C:\WINDOWS\system32\drivers\etc\hosts file
or type drivers in run dialog box
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost
IP benefitaccess-qa.morganstanley.com
#xx.xx.xxx.xxx domainname upto .com
=============================================================================
Why ping throws request timed out message.
A ping is an ICMP packet. For comparison, web traffic or HTTP, is generally a TCP packet on port 80. A given server may be providing responses for the purpose of web traffic, but block ICMP (or be behind a firewall that blocks ICMP) and therefore you can:
|