amarendra


{ City } pune
< Country > india
* Profession *
User No # 17210
Total Questions Posted # 0
Total Answers Posted # 54

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 241
Users Marked my Answers as Wrong # 83
Answers / { amarendra }

Question { Livetek, 7764 }

QTP identifying the child tabs in a maintab like
tab_1,tab_2,tab_3,tab_4
while using a for loop for these tabs.its not proceeding
from _1 to _2.
How can i use "for loop "


Answer

For example, If the Tabs are recogized in QTP as
Webelements, and the Tab name starts with "Tab_" and the
number changes then, the following loop may helpful for you.

for var_i = 1 to 4
Browsr("BrowserName").Page("Page").WebElement
("innertext:=tab_" & var_i).Click)
Wait 10
Next

I think so... This logic may help you....

Is This Answer Correct ?    1 Yes 2 No

Question { 3400 }

what version of test director supports the QTP? does
testdirector supports the QTP9.0?


Answer

Quality Center 8.2 and upper versions will support QTP so
that you can Upload/Modify/delete/execute scripts to QC
through QTP.

Is This Answer Correct ?    1 Yes 0 No


Question { Microsoft, 21859 }

how can you select random value for every iteration from a
weblist


Answer

First get the Items count from the List and Use the
RandomNumber() function to get the random Index value. The
below code will work

ItemsCount = Browser("Browsername").Page("PageTile").WebList
("WebListName").GetROProperty("items count")
Browser("Browsername").Page("PageTile").WebList
("WebListName").Select ("#" & RandomNumber(0,ItemsCount))

Is This Answer Correct ?    7 Yes 7 No

Question { CSS, 4867 }

can we create recorset with out using database connection in
vbscript?


Answer

You can create recordset object without using database
connection but not able to access data from Database.
If youn want to access data from database, then you should
create db connection. Using connectionstring only, you can
execute SQl query and able to save the results into
recordset.

Even if you create recordset object without db connection,
you might unnecessarily increase you code. Nothing will be
happen.

Is This Answer Correct ?    2 Yes 1 No

Question { Symantic Space, 5913 }


This is Ajay i have few douts if anybody know pls give me
reply.

1. i have opend 2 gmails i am working with 1 gmail i want
to close other gmail by usig script.

2.i have 10 links in a page all of them have same
properties& names i want to click on 5link by using script.

3.i have one combobox in that i want to see all the
citynames in the combobox and i have to check weather
hyderabad is present or not.

4. size of objectrepository.
5.what r problems we get during writing the script.
6.is it possible to compare to excel sheets in qtp if
possible wht is the script.
7.example for lowlevelrecording


Answer

1) i have opend 2 gmails i am working with 1 gmail i want
to close other gmail by usig script.
Ans: Use index property to uniquely indentify the Browser.
In QTP, for any object, Index starts from Zero. If only one
browser opened, Index value is Zero. For the second
browser, index value will be 1 and so on.
The below code will close the second Gmail brower if it two
or more Gmail Pages are opened. Otherwise It won't close.
If (Browser("title:=Gmail: Email from
Google","index:=1").Exist) Then
Browser("index:=1").Close
End If
If u want to close any broswer, use only index property in
Browser object




2) i have 10 links in a page all of them have same
properties& names i want to click on 5link by using script.
Ans: Use index property in descriptive programming so that
u can perform click action on 5th link.
i.e
For example, ABCD is the name of the link and page contains
10 links with the same name ABCD and you want to click on
5th, this case the below code work. Index starts from Zero.
So fifth link contains the index value 4.

Browser("title:=Gmail: Email from Google").Page
("name:=Gmail: Email from Google").Link
("name:=ABCD", "index:=4").Click



3).i have one combobox in that i want to see all the
citynames in the combobox and i have to check weather
hyderabad is present or not.
Ans: The below code that will verify whether the Item exist
in the combobox or not. i.e. the given city Hyderabad exist
in the CityList combobox or not.

CityName = "Hyderabad"
Result = 0
all_items = Browser("Cities").Page("Cities").WebList
("CityList").GetROProperty("all items")
For Each aitem In all_items
If aitem = CityName Then
Reporter.ReportEvent micPass "City is Found
in the List", "Passed"
Result = 1
Exit For
End If
Next
If Result = 0 Then
Reporter.ReportEvent micPass "City is Found in the
List", "Passed"
End If



4) size of objectrepository
Ans: The Size of the Object Repository might be the size of
the .tsr file in your script.


5) what r problems we get during writing the script
Ans: In general, you can get the following probles while
preparing the script
1. Sometimes you may not able to find/recognize the unique
property value of the object.
2. Synchromnization: this is one of the major issue while
preparing and executing the script.
3. If you have good Automation framework, then only it is
easier to prepare the scripts
4. It depends on your logic where you are going to
implement in the script




6) is it possible to compare to excel sheets in qtp if
possible wht is the script.
Ans: It is possible to verify two Excel sheets in QTP.
I can explain the Steps to prepare the script.
Step1: Import the first Excel sheet to Gloalsheet, Second
excel sheet into Local sheet
Step2: Get the rowcount of two Globalsheet and localsheet
Step3: Compare the rowcounts and columncounts of two sheets
if those are equal, verify each value of the cell.
If any one combination failed(verifying cell value,
Mention that two excel sheets are different
else
Two excel sheets are equal.
Else
Mention that two excel sheets are different




7) example for lowlevelrecording
Ans: I didnot work on Lowlevel recording, so I don't have
an idea.

Is This Answer Correct ?    4 Yes 2 No

Question { Symantic Space, 5913 }


This is Ajay i have few douts if anybody know pls give me
reply.

1. i have opend 2 gmails i am working with 1 gmail i want
to close other gmail by usig script.

2.i have 10 links in a page all of them have same
properties& names i want to click on 5link by using script.

3.i have one combobox in that i want to see all the
citynames in the combobox and i have to check weather
hyderabad is present or not.

4. size of objectrepository.
5.what r problems we get during writing the script.
6.is it possible to compare to excel sheets in qtp if
possible wht is the script.
7.example for lowlevelrecording


Answer

Small change in Answer for third question

3).i have one combobox in that i want to see all the
citynames in the combobox and i have to check weather
hyderabad is present or not.
Ans: The below code that will verify whether the Item exist
in the combobox or not. i.e. the given city Hyderabad exist
in the CityList combobox or not.

CityName = "Hyderabad"
Result = 0
all_items = Browser("Cities").Page("Cities").WebList
("CityList").GetROProperty("all items")
For Each aitem In all_items
If aitem = CityName Then
Reporter.ReportEvent micPass, "City is
Found
in the List", "Passed"
Result = 1
Exit For
End If
Next
If Result = 0 Then
Reporter.ReportEvent micFail, "City is not Found in
the
List", "Failed"
End If

Is This Answer Correct ?    0 Yes 0 No

Question { TCS, 5367 }

How can we encrypt the username using recording mode in
login window? There is 2 encrypted types what are it


Answer

Methods for Encryption in QTP are as follows

1)SetSecure method -used only for TextBox object like
WinEdit/WebEdit etc...
E.g:Browser("test").Page("test").WebEdit
("test1").SetSecure "1HG76BHGJ89sd8Jkl9hjs988dsnjsk" 'encryp
tedtext


2)Crypt.Encrypt(valueToBeEncripted)
E.g: var_Value = Crypt.Encrypt("Tester")


Methods usage in Test Script
E.g:
pwd = "GetPasswordfromSomewhere"
e_pwd = Crypt.Encrypt(pwd)
Browser("dfgd").Dialog("pass").WinEdit("pwd").SetSecure
e_pwd

Is This Answer Correct ?    1 Yes 1 No

Question { 3647 }

Is there anyone can tell me where I can download free or
trial QTP? I tried HP website, it was not there anymore. If
someone know, pls send me URL. Tks...


Answer

You can download QTP from Download Center - BTO Software,
HP WebSite. To download, You should be a registered User.
Register your self and download the Trial version of QTP
and its Add-ins(like .Net etc..)
The URL for registration is

https://h10078.www1.hp.com/cda/hpdc/display/main/register.js
p?TYPE=33554433&REALMOID=06-00060790-bec3-16ef-9bed-
a14d91447abd&GUID=&SMAUTHREASON=0&METHOD=GET&SMAGENTNAME=$SM
$2Cq3HoFq8XtwZhO79hEXbjYx2lTNB4tj4RuxdLVG%
2bxxniuwPsc6o3JIRR6zMUadd&TARGET=$SM$HTTPS%3a%2f%2fh10078%
2ewww1%2ehp%2ecom%2fcda%2fhpdc%2fdisplay%2fmain%2fsecure%
2fdownload_bin%2ejsp%3fzn%3dbto%26cp%3d54_4012_100__


If the URL doesnot work, try Download Center - BTO Software
in HP Website and try QTP download.

Is This Answer Correct ?    1 Yes 0 No

Question { HCL, 6161 }

What is TD plugin? For what purpose they are used . Ineed
to connect QC9.2 with QTP 9.2 . Need to run some scripts IN
QTP having the QC connectivity.

Pls explain in detailed step

Thanks in advnece


Answer

Steps to upload the test scripts into QC.

1)Open the test script to uploaded in QTP
2)Goto file menu, click on "Qualtiy Center Connection"
3)Enter the valid QC URL
4)Enter valid Username/password and DomainName/Project
5)Click on Connect
6)Goto File menu, Click on Save As button.
7)Click on Save to Quality Center button
8)in the wizard, Select the QC folder, where the scripts
will be uploaded.
9)Click on Save button

Script can be uploaded successfully

Is This Answer Correct ?    0 Yes 0 No

Question { 6955 }

Which property do you use to retrieve or assign data into a
cell in a Data Table object?


Answer

Retrieve data from Datatable cell.
E.g:
var_Value = DataTable(columnname/column number,
sheetname/sheet number)

Set value to DataTable cell
E.g:
DataTable(columnname/column number, sheetname/sheet
number).Value = "value"

Is This Answer Correct ?    2 Yes 1 No

Question { 3965 }

How do you create a library file


Answer

Open notepad,
write your code
Save the text file with the extension .vbs

E.g: test1.vbs

Is This Answer Correct ?    1 Yes 0 No

Question { 7463 }

How to call a function in QTP?


Answer

Syntax to declare a function
Function functionname(parameter1, parameter2, etc...)
'statements....
End Function

E.g: Function Myfunc(a,b,c)

Calling the function in test script:

E.g:
1)Call Myfunc(a,b,c)
2)Myfunc a,b,c

Is This Answer Correct ?    4 Yes 0 No

Question { 4550 }

What is descriptive.create () in QTP?


Answer

It creates dynamic logical name of the object. Using this
you can set property values to the dynamic object.

Is This Answer Correct ?    0 Yes 1 No

Question { 3153 }

What does VBS file contain?


Answer

VBS file may contain

user defined Functions
general variables(global scope)
Enviroonment varaibles(global scope)
Constants
Comments

These are all depend on the user who creates VBS file.

Is This Answer Correct ?    3 Yes 0 No

Question { 22883 }

How do u write a regular expression for date (dd/mm/yyyy)
field?


Answer

The above regular expression(Ans:1) will fail as it allows
day between 31 to 40 as well.

The following regular expression takes care of all cases
and validate the format (dd/mm/yyyy)

(0[1-9]|[12][0-9]|3[01])/(0[1-9]|1[012])/\d{4}

Is This Answer Correct ?    22 Yes 15 No

Prev    1    [2]   3   4    Next