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
Questions / { amarendra }
Questions Answers Category Views Company eMail




Answers / { amarendra }

Question { 14298 }

how to retrieve the column headers in database using
vbscript statement in QTP


Answer

VB Script Code to retrieve all column names

var_ConnectionString = "" 'specify the connection string
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open var_ConnectionString
Set objRecordSet = CreateObject("ADODB.RecordSet")
strSqlQuery = "select * from employee"
'Execute query and Store the results into Record set
objRecordSet.Open strSqlQuery, objConnection
For var_Loop = 0 To objRecordSet.Fields.Count - 1
colname = objRecordSet.Fields(var_Loop).Name 'column name
msgbox colname
Next

Is This Answer Correct ?    8 Yes 3 No

Question { Ordain Solutions, 6506 }

Hi PLZ explain User Defined Functions in QTP with eample?


Answer

Functions - two types
1)Buitin - Prepared by QTP
2)User Defined - Prepared by programmer/tester

Syntan to creat User defined function in QTP

Function FunctionName(Parameter1, Param2,.....)
Statement1
Statement2
.....
.....
End Function

Example:

Function Bigger(value1, value2)
If value1 > value2 Then
Bigger = value1
Else
Bigger = value2
End If
End Function

Calling the function in the script

Result = Bigger(20,21)
Msgbox Result 'gives 21

Is This Answer Correct ?    2 Yes 0 No


Question { TCS, 8034 }

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


Answer

Biult in Environment variables - These variabvles are
created in QTP so that these variables have global scope in
any QTP script.

Internal Environment variables - These are user defined
environment variables and scope is applicable within the
script which they are created in it. You can't access these
variables in other scripts

External Environment variables - These are created in one
script and accessed in different scripts. Whenever you
associate these external variables seperately in you script
then only you can able to access it. You can associate
these variables in Test Settings.

Is This Answer Correct ?    8 Yes 12 No

Question { Wipro, 6452 }

why don’t use real time they r not using check points


Answer

Check points is a concept of record & play Back model in
QTP. In real time, Everyone use discriptive programming so
that no object repository is maintained in the script. To
use checkpoints, we should need objects in Object
repository.
Maintaining Object repository is a huge task and is very
difficult and script execution become slow. If atleast one
object miss from the repository, script execution cannot
proceed further.

This is only the reason,in real time, the professionals do
not use Check points in thier scripts.

Is This Answer Correct ?    9 Yes 0 No

Question { 7471 }

hi
what is the use of "dim" in automation objective model or
any where what is the use of "dim" plz tell me


Answer

Dim keyword is used to declare a variable in VB Script. QTP
uses VB Script so that we use dim to declare a variable in
QTP.

Is This Answer Correct ?    8 Yes 0 No

Question { 3308 }

how to identify the user defind varibles? plz tell me


Answer

in QTP script, Specify the line "Option Explicit" as first
statement of your script and execute it. If you do not
declare the variables it gives the errors so that you can
easily find the user defined variables in your script.

Is This Answer Correct ?    0 Yes 0 No

Question { IncRev, 8672 }

Can u Reduce the size of Object repository? What are the
problems u have faced in Qtp tool?


Answer

Using Descriptive Programming we can reduce the size of
Object Repository. No need to Maintain object Reposity if u
use descriptive Programming Concepts. QTP recognize each
object with some unique Property values. So you no need to
add object to object repository if you use descriptive
programming. Descriptive programming reduces the time of
QTP to recognize the object uniquely. If you use Object
Ropository, first QTP retrieves all objects from it and
verify each property values of the object and it is time
taken process. If the number of objects in Object
Repository are huge, QTP takes so much time to recognize
the object you specified in the Script.

The following Properties can be used to recognize the
objects uniquely by QTP.
Object Name Properties to recognize the object
Browser Name
Page Title
WebEdit Name
WebEelemt InnerText/Html id
WebList Name
WebButton Name
Link Name
WebTable Html id/Name

Is This Answer Correct ?    5 Yes 0 No

Question { HP, 3728 }

Browser("Las Vegas Hotels - Las").Page("Vegas Hotels -
Hotels").Link("Luxor") ......here Luxor is a hotel and this
is recognised as a link. I have many hotels like Luxor,
Palms etc which are all displayed as link...How do I
parametrize this by using webtable functions??? ASAP


Answer

If you want to recognize, no of links like Luxor, then the
following code explain you how to perameterize it.

This is the query you are using to recognize Luxor.
Browser("Las Vegas Hotels - Las").Page("Vegas Hotels -
Hotels").Link("Luxor")

Using Descriptive programming and data Driven approach you
can Perameterize it

Create a column in Globalsheet as CityName and enter the
Citie names in it.


Code:
ExcelSheetRoiwCount = DataTable.GetSheet
("Global").GetRowCount
For var_i = 1 to ExcelSheetRoiwCount
DataTable.SetCurrentRow(var_i)
CityName = DataTable("CityName","Globalsheet")
Result = Browser("Las Vegas Hotels - Las").Page("Vegas
Hotels - Hotels").Link("name:=&CityName).Exist(1)
If Result = True Then
Reporter.ReportEvent micPass, "City name " & CityName
& "found", "Passed"
Else
Reporter.ReportEvent micFail, "City name " & CityName
& "not found", "Failed"
End If
Next


It above code verifies the city names you have specified in
Excel Globalsheet exist in the application as Links or not.

Is This Answer Correct ?    3 Yes 0 No

Question { BSL, 7616 }

please write a script to find the text in a application.
Note: i dont know the location of that text where it is
located. just like negative testing.


Answer

In general, In the web application, The text can be
recogized by QTP as WebElement. If you on what page it
should be displayed, Then it is easier to verify that text.

For Example

Text = "Welcome to Yahoo"
Result = Browser("name:=Yahoo").Page
("title:=Yahoo").WebElement("inntertext:=& Text).Exist(0)
If Result = True Then
Reporter.ReportEvent MicPass, "Text found", "Passed"
Else
Reporter.ReportEvent MicFail, "Text not found", "Failed"
End If

If you want to verify ur application, Pass the exact Object
Property values as per the Hirarchy

Is This Answer Correct ?    0 Yes 3 No

Question { Wipro, 4581 }

if my application shows 100 records and in my database
having 200 records how i can validate using QTP tool?plz
exp. in detail?


Answer

It entirely depends on your application. If the developers
use Webtables to display these records, then the solution
depends on the Page size and no of Pages available for the
Web table.
I.e. For example If the page size is 50, it means, web
table page contains 50 records. If the total records
available in Database is 200 records, then The no of pages
of the web table should be four.

Total records = Page size * No of Pages in the web table.

So that you can verify the total number of records in your
application & in your database.

Is This Answer Correct ?    0 Yes 1 No

Question { 15913 }

How to compare the two strings?


Answer

using strcomp(str1,str2,booleanvalue), we can compare two
strings
e.g: strcomp("abcd","ABCD",0) results 0 - avoids case
sensitive
strcomp("abcd","ABCD",1) results -1 follows case sensitive

Is This Answer Correct ?    9 Yes 6 No

Question { 3286 }

when do we write a script in qtp?(plz give me more then 2
reasons)


Answer

If we want to test the same functionality more than 13times
manually, we will go for Automation testing.
And also if the build is stable for testing then only we
can go for Autonlation testing.

Is This Answer Correct ?    1 Yes 0 No

Question { Synechron, 4733 }

actually how many hours per one day we will work on
automation (qtp) in real time


Answer

That totally depends on your Project timelines and your
skillset. In general people allot the same time ratio to
all three Phases.
There are three Phases for any Coding,i.e.
1)Prepare 2)debugging 3)Execute

Is This Answer Correct ?    4 Yes 1 No

Question { 3419 }

what testing activities u may want to automate?


Answer

Regression Testing
Functional Testing
User Interface Testing
Retesting

Is This Answer Correct ?    1 Yes 0 No

Question { 14541 }

What is the difference between property and method?


Answer

Property is nothing like a variable and Method is like a
function.

You cannot pass parameters to a property and you can
directly assign value to it.

for a Method, set of lines of code and when it is called
that executes set of lines written in it and generates the
results. you can pass parameters to the method and you can
retirve the result from the method. You cannot directly
assign any value to it but you can pass it by
Parameterizing it.

Ex: Reporter.Filter - Here Filter is a property
Reporter.ReportEvent - Here ReoprtEvent is a mothod.

Reporter.Filter = 0 'this enable the results for the test
results. Here you can directly assig value to it
Reporter.ReportEvent micPass, "Msg1","Msg2". Here we are
passing three parameters to the methos ReportEvent that
send the results to Test Results.

Reporter is either a prepdefined Abstract class/interface
in QTP that has so many Properties and Moethods

Is This Answer Correct ?    31 Yes 6 No

 [1]   2   3   4    Next