write a script for get the following result:
username
password
frm the
string1="A=username"
string2="B=password"

Answers were Sorted based on User's Feedback



write a script for get the following result: username password frm the string1="A=username..

Answer / sandeep guttikonda

The Above Posted answer is the very correct one.

Here I would like to show one more option but, not as good
as above one ( Just to tell the other option)

String1 = "A=username"
String2 = "B=password"

We are having 3 good buildin functions in VBscript to work
upon the test messages.

1) Left()
2) Mid()
3) Right()

Here in this case we can use Right() Function to retrieve
the required text.
We can use this function to get a specified number of
characters from the right side of a string.

Syntax: Right(String,Length)

To get username:
Code:
Username = Right(String1,8)
Msgbox Username

As length of us username is 8 I am using 8 in the function.

To get Password:
Code:
Password = Right(String2,8)
Msgbox Password

As length of us Password is 8 I am using 8 in the function.

Is This Answer Correct ?    5 Yes 1 No

write a script for get the following result: username password frm the string1="A=username..

Answer / litan

string1="A=username"
string2="B=password"


Username=Split(string1,"=")(1)
PAssword=Split(string2,"=")(1)

Is This Answer Correct ?    4 Yes 2 No

write a script for get the following result: username password frm the string1="A=username..

Answer / giriyappa badagar

string1="A=username"
string2="B=password"

UName=Split(string1,"=")
PWord=Split(string2,"=")

msgbox UName(1)
msgbox PWord(1)

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More QTP Interview Questions

What we are looking for is to load properties of object dynamically as for our application the global repository will pretty huge. It will be really helpful to us if something similar to following functions of Winrunner is available in QTP. #Define descriptor auto strDesc; #set property in the descriptor Gui_desc_set_attr(strDesc,?Class?,?Edit?); --- put other properties #Add Edit box to GUI Map Gui_add(? ?,strWindowName,strEditboxName,strDesc);

0 Answers  


how can i add an action(external action) programmatically?

3 Answers   Ordain Solutions,


What ate the Technologies supported by QTP?

0 Answers  


How can we disable popup blocker? (I think it means when we get a pop up messge(its error) how we wil disable that one with out interrupting normal process)

6 Answers  


Is it mandatory to know abt regular expression in descriptive programming

2 Answers  






what is qtp automation framework, what is the purpose of the framework and which folders included in this framework pls tell me with brief description

2 Answers   PSI Data Systems,


What are the disadvantages of recording test cases in qtp?

0 Answers  


What are the factors on which script execution time is dependent?

0 Answers  


i've installed qtp9.2 on Windows 7. Recording and everything no problem. But when i am saving the test, it is not happening. it says 'general error while saving'. But teh test is getting saved but as a folder with lock icon. When i wanted to open it, it is jst showing as a locked folder but not as a test. Somebody help me out plz

1 Answers  


Explain about merging of two repositories?

3 Answers  


what is KEYWORD DRIVEN TESTING ? I M NOT ASKIN WHAT IS KEY WORD VIEW PLZ ANS FOR ONLY WHAT IS KEYWORD DRIVEN TESTING EXACTLY THANX

3 Answers  


in a database table there are 3 columns (name , marks,grade) , in application after retrieving data from db to fields name, marks click ok button then grade should displayed ---for this how to write vb script prgm

3 Answers   IBM,


Categories