Given a string variable contain a full name (last name,
first name), using vbscripting, how can you extract first
and last name and save them into two different variables.

Answer Posted / uday

Use split method.

Here is the ex:

str="Uday,Anem" 'where Uday is first name and Anem is last
name
arr=split(str,",")
firstname=arr(0)
lastname=arr(1)

msgbox(firstname+" "+lastname)

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Discuss the QTP Environment?

611


which type of testing process are you following in ur company? how to recognize a qtp page?

1393


Explain the concept of object repository and how quicktest professional (qtp) recognises objects?

595


Hi I'm a beginner in QTP. So far I'm ok with Descriptive but stuck while implementing Hybrid Frame work. 1. I have created a Keyword file with .vbs ext set home=description.create home("title").value="Welcome to feests" set reglink=description.create reglink("name").value="register yourrestaurant / take away" set fbusname=description.create fbusname("name").value="business_name" set dispname=description.create dispname("name").value="display_name" set restchkbox=description.create restchkbox("name").value="restaurant" set cuiscate=description.create cuiscate("name").value="cuisine_categery1" set addline1=description.create addline1("name").value="address_line1" set pstcode=description.create pstcode("name").value="address_postcode" set cntry=description.create cntry("name").value="address_country" set mlandno=description.create mlandno("name").value="landline_no" set emailadd=description.create emailadd("name").value="email" 2. I have created an Function Library file as follows Function launch() bro="C:\Program Files\Internet Explorer\iexplore.exe" url="http://www.feests.com/" invokeapplication bro&" "&url Browser(home).page(home).Link(reglink).click End Function Function restregistration(karthik, teja, Ameerpet, UK) Browser(home).page(home).WebEdit(fbusname).set "karthik" Browser(home).page(home).WebEdit(dispname).set "teja" Browser(home).page(home).WebCheckBox(restchkbox).set "ON" Browser(home).page(home).WebList(cuiscate).Select "Indian" Browser(home).page(home).WebEdit(addline1).set "Ameerpet" Browser(home).page(home).WebEdit(pstcode).set "UK" Browser(home).page(home).WebList(cntry).select "United Kingdom" Browser(home).page(home).WebEdit(mlandno).set "023775347" Browser(home).page(home).WebEdit(emailadd).set "email@gmail.com" End Function 3. This is how I have called the keywords and Functions in QTP executefile"C:\Documents and Settings\karthik\Desktop\keywords.vbs" executefile"C:\Documents and Settings\karthik\Desktop\functions.vbs" launch restregistration karthik, teja, Ameerpet, UK, "email@gmail.com" Now the issue is, I'm trying to enter the email ID in WebEdit field. But I dont know what is the mistake I did, if I run the script in QTP it is showing following error Error: Expected identifier Line (2): "executefile"C:\Documents and Settings\karthik\Desktop\functions.vbs"". Can someone help me fix this, please!!?

4959


before launching qtp, we need to close all the open browsers u dont know what are all the browsers either it might be ie,mozilla etc and u dont know how many brosers are open.... u need to close all these before launching qtp.. can anyone plz temme d solution...

7195






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

1368


I want to do Certification course in QTP. For this I request you to suggest the best Tutorial in PDF format, if possible, kinldy mail PDF file to my mail-ID: ramakrishna908@gmail.com Regards, krishna.

1452


By using QTP can we record any log files written by the application which is in execution?

1458


How to execute the WR Script through QTP? I have WinRunner script with initialization script, common scripts, GUI AND functions. I connected WR through QTP with "call to WinRunner" option but I am getting problem after connecting to WinRunner i.e. showing "Do you want to quit now" with 'yes' and 'No' message box

1813


What are the features of quick test pro(qtp)?

519


I created 3 actions in test suppose I want to run action 1 in single time, action 2 is 4 time what I do?

581


hi all can anyone explain how to write the code for finding the mandatory columns in table which are having (red*) (red Astrik)

1386


Connect to QC using AOM.

1221


I am having major problems with some DB Table Checkpoints I add to my script. I 35 web based applications recorded and each has DB Table Checkpoints insert but only 1 script isn't recognizing the DB Table Checkpoints for some reason. I've checked the DB connections and the info in the Library Functions and still only this one script out of 35 doesn't recognize the DB Table Checkpoints. Can someone please help me figure out why only this one script out of 35 that's hitting the same database is having a problem.

1726


What is text check point and text area check point?

592