VB Script

Ques:- how to declare a variable in vbscript using vbscript
Recent Answer : Added by Admin On 2020-05-17 11:33:22:

Dim

Ques:- how to retrive the tooltip by using descriptive programming in qtp?
Recent Answer : Added by Admin On 2020-05-17 11:33:21:

Use the “title” property to get the tool tip of any button, hyperlink etc.

Ques:- Description.Create
Ques:- How to use Text file (Notepad) as ur data source in QTP? Can u please provide some function code for it?
Recent Answer : Added by Admin On 2020-05-17 11:33:22:

For this you need create File system object.
Below code is for reading from text file
Const ForRead=1
Dim objFSO, objFile, strText
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
‘Reading code
Set objFile=objFSO.OpenTextFile(“z:filetext.txt”, ForRead)
Do until objFile.AtEndOfStream
strText=objFile.ReadLine
msgbox strText
Loop
objFile.close
Set objFile = nothing
Set objFile1 = nothing
Set objFSO =nothing
“strText” variable will now contain data from text file.

Ques:- give me any information abou vb script books learn quckly
Ques:- hi, How will write a regular expression of date in VB scripting.
Recent Answer : Added by Admin On 2020-05-17 11:33:21:

.*12/2/2016.*

Ques:- can any body give the code to write the function for given suppose user login with usrer id and pwd to yahoomail.after cliking “sign in”if it is valid user id the next page will display userid’message box.( Note u have to use excel sheet to retrive the userid’s data)
Recent Answer : Added by Admin On 2020-05-17 11:33:20:

Hello Mr.Badri,
Script is good,
if anybody don’t know scripting they will feel difficult to understand your script, please reduce complexity while answering, here no need to use always reporter events you can display with msgbox or with print statements.
How do you think this is correct validation,
–> you get the user name from excel sheet and placed in user name field.
–> you get the text available in user name field again
–> validating these two values.
no test case will be fail if you do testing like this.
you forgot one more thing you have to click Sign In button with out doing this how could you conclude that the user is valid or not….!
Once you get Home page or mail box page then you can conclude that user name is valid
or
If you don’t get any error msg or popup after clicking on Login In then also you can ensure that the user is valid.
If anybody want me to give code, I will give.
above code also correct but some what complexity…!

Ques:- In QTP how to insert a data base check point for web based application and simultaneous link to code in expert veiw. hw to retrieve a data(single coulumn from server) that matches with inserted value manually or exported from excel sheet.
Recent Answer : Added by Admin On 2020-05-17 11:33:21:

Even i have stuck with this database check point have you
got the solution for this how to insert a data base check
point pleace could you mail to my id
shiva_uma2003@rediffmail.com thaks in advance

Ques:- Can we create Crystal Report object in QTP?If yes then what it is and what are its various properties?
Ques:- how to get date format from system locale..format means neither long nor shor… format from system locale. i need like your date is mm/dd/yyyy formate or mm-dd-yy or with time like that. how to get.
Recent Answer : Added by Admin On 2020-05-17 11:33:20:

i take cint that i will get mm/dd/yy format
first ofall i capture that value take help stepgenatator later
mm/dd/yyyy change into your format

Ques:- How to check the particular window is exist or not with out using check points
Recent Answer : Added by Admin On 2020-05-17 11:33:19:

If window(“Flight Reservation”).Exist<>0 Then
msgbox “window exists”
else
msgbox “window doesnot exists”
End If

Ques:- What is difference between Active screen and movie screen recorder in QTP 9.2?
Recent Answer : Added by Admin On 2020-05-17 11:33:19:

In active screen u can see the test objects i.e. the
application at the time of recording. but in movie screen
recorder u can see the screenshots of the application
during runtime.

Ques:- after medical test,when will be the police verification
Ques:- generic function for webedit box for web application
Recent Answer : Added by Admin On 2020-05-17 11:33:15:

if Browser(“name:=”abc”).Page(“title:= xyz”).WebEdit
(“name:=username”).Exist(2) Then
Browser(“name:=”abc”).Page(“title:= xyz”).WebEdit
(“name:=username”).Set “Chakri”
End if

Ques:- Write VB script to convert from feet to inches(hint 1feet=12 inches)
Recent Answer : Added by Admin On 2020-05-17 11:33:15:

function feet(x)
Inch=12
Res= x*Inch
msgbox x&”Feet”& “=”& Res & “Inches”
end function
call feet(2)
Just change instead of 2 any number it ll calu and give u in inches
Hope i answered your question

Ques:- How do I check that the names in a weblist are correct e.g in flight application the names of item are Denver, paris,London, etc. How do I ensure the correct item is displayed from the list after doing item count ?
Recent Answer : Added by Admin On 2020-05-17 11:33:14:

First save all item names in DataTable with column
name “FlyFrom” and follow the script:
Val1 = dataTable.Value(“FlyFrom”)
i = 0
itm = Window(“F.R.”).WincomboBox(“Fly From:”).GetItem(i)
If Val1 = itm then
reporter.reportevent 0,” “,”
else
reporter.reportevent 1,”“,”Fail”
EndIf
i = i+1

Ques:- Plz give the vb script for the following scenerio. In travel booking we have to select from delhi to mumbai from the combobox The prices will be display in another combo box .But i have to select the lowest price for it and submit it
Recent Answer : Added by Admin On 2020-05-17 11:33:12:

.WinComboBox(“From”).Select “Delhi”
.WinCombobox(“TO”).Select “Mumbai”
Itmscnt = .WinComboBox(“Price”).GetItemsCount
val = .WinComboBox(“Price”).GetItem(0)
For itm = 1 to Itmscnt-1
itmval = .WinComboBox
(“Price”).GetItem(itm)
If cint(Val) < cint(itmval) then msgbox "Val is less than itmval" else val = itmval end if Next msgbox "Lowest price is: "&val .WinComboBox(“Price”).Select val
.WinButton(“Submit”).Click

Ques:- I have attended Anovatek Software QTP interview. They will give us computer and one web based application with QTP. We have to automate some records (already updated records or new records) using QTP Data driven testing. But we should use for loop? Can any one know how to do data driven testing using For loop?
Ques:- how to set one column as primary key in QTP and fetch values accordingly
Ques:- We have an application which is built using multiple technologies and are using QTP as the tool for Automating the same. While we spy over a combo box in this application, we get the object name as a “Combo Control” and we are not able to perform any action over this object in either selecting or checking any method for the same like “Exist” etc. Hence we thought of a solution and the same can be found below
Ques:- i created script for login in QTP,i parametirized that using global sheet,problem i am facing is first i want to login with first values provided in excelsheet and want to perform some operation,second time if call same action it should login with second values in excelsheet
Recent Answer : Added by Admin On 2020-05-17 11:33:17:

hello we should change the settings for that
file-> settings->Run->run the row from 1 to 10 then we can
pass the all the parameter from the datatable.

Ques:- when you use For Loop, While..do, do..while? at what situations which loop will use.
Recent Answer : Added by Admin On 2020-05-17 11:33:16:

“For” loop can be used when the range of the iteration is
known. For ex: For i = 1 to 100….
“While..do” or “do..While” can be used when, the scenario
should satisfy the condition.
For Ex: While ()…

Ques:- How to return a value from function…? you should not tell msgbox, print.. etc.,
Recent Answer : Added by Admin On 2020-05-17 11:33:18:

Dim StrFunVal
StrFunVal = fn_MyFunction(7)
Function fn_MyFunction(Num)
fn_MyFunction=Num+8
End Function
During the execution the “StrFunVal” variable will contain
the value 15. If you don’t want to use ‘Msgbox’ or ‘Print’
then declaring a variable is prefered.
For your other question I haven’t come across returning
more than 1 value from functions. Probably we have to use a
ARRAY kind of stuff…but not sure. Need to work on it.
Cheers,
VGR

Ques:- a function that takes an integer array as an argument and returns the largest value in the array. Use the function in a program
Recent Answer : Added by Admin On 2020-05-17 11:33:16:

Ques:- what is used of Property……..End Property loop ? how to write the script for it?
Ques:- How to create pull down menu box using vb script
Ques:- The function template cocept is implemented in vb.net is ???
Ques:- How to insert snapshot during manual scripting in QTP?
Recent Answer : Added by Admin On 2020-05-17 11:33:11:

We can use capturebitmap for this two inputs are there one is filetype means need to give path and type of image like png or bmp (“Ex:Login.png”) and rest is true or false. true means if image is there with same name it will overwrite if not it creates the name which we have given..By default true is there.
Browser().page().capturebitmap(“G:Login.png”,true)

Ques:- VBscript for QTP,best tutorial?
Recent Answer : Added by Admin On 2020-05-17 11:33:09:

for VBScript in QTP orientation visit:
http://www.gcreddy.com
there you can get:
VBScript examples,
GUI Scripts,
Web Scripts,
Database scripts,
Excel scripts,
Flat files scripts etc..
It is a very useful site for QTP advanced learners.

Ques:- 1) How can we use VB script in testing the application? 2) What all are the things(Software application to be installed in PC) we need to learn VBscript?
Scroll to top