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 is exacltly TIERS ?

0 Answers  


Plz explain about InTERNAl Environment variable, External environment variable,builtin environment variables with examples?

1 Answers   TCS,


what is meant by descriptive programming?

2 Answers   Wipro,


What is Object Spy?

8 Answers  


Write a script to customize the test results in PDF and HTML format.

0 Answers   DuPont,


Tell about automation object model(Aom) in qtp?

6 Answers   GE,


What is test automation framework?which framework does QTP follow?Need some practical explanation as to how u will start ur testing process following a particular framework?

2 Answers   IBM, Sony,


How to remove associated function library?

0 Answers  


Reverse a string keeping the words in the string as it is. E.G. "Quick Test Professional" O/P "Professional Test Quick"

5 Answers   Cap Gemini,


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)

5 Answers  


when we apply the daily build each and every day,the property may change in the application.so that the created script is not reusable in winrunner and qtp.for ex for date field it is taken dtpicker.at another time it is taken some other name.how can i solve it.

0 Answers  


difference between waitProperty & Checkproperty

4 Answers   AON,


Categories