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

Can we use same virtual objects in many number of tests?

1 Answers   TCS,


wht type of User defined functions or Java Releated functions do we write in VB scripting

0 Answers   Wipro,


Give me an example where you have used a COM interface in your QTP project?

1 Answers  


What are the key elements available in test result window?

0 Answers  


what are the functions availabla in QTP? what are the data types in QTP?

2 Answers   Spry Technologies,






In QTP, Which are the concepts are needed to do Functional testing and Regression testing?

3 Answers   IBM,


wht is Driver in Integration testing. Anubody can answers it

7 Answers   CTS,


Explain hybrid framework with advantages and disadvantages?

0 Answers  


Is it possible to merge two object repository files in qtp?

0 Answers  


what is the criteria for choosing test cases for automation? Ex: if you have some 300 test cases, then how many you choose for automation. what is criteria of selecting?

3 Answers   Aricent, Delhi University, TCS,


how can we handle errors other than using recovery scenerios in qtp

0 Answers  


After executing the script in qtp suppose i found some script execute successfully and found some error.So how to report the status for both (i.e pass and fail report)in test director. For "fail" We use "defect tab" in testdirector. But for "pass" how to report it to TL.what is the process plz anybody ans

0 Answers   TCS,


Categories