how to generate numbers in between to numbers suppose
numbers in between 500 to 1000 in sequencies using vbscript



how to generate numbers in between to numbers suppose numbers in between 500 to 1000 in sequencies..

Answer / amarendra kothuru

Using loops in vb Script, you can generate numbers between
specified range

E.g:
For i= 501 to 1000
Reporter.ReportEvent micPass, "Value: " & i, "Number
between 500 to 1000"
Next
'gives the output as 501,502, 503, etc...

If you want generate random number between 500 to 1000, use
the function "RandomNumber(inbuilt function of QTP, but not
VB Sscript function)
E.g: var_Num = RandomNumber(500,1000)

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More QTP Interview Questions

How can I open a EXCEL file from QTP Resultviewer with reporter.ReportEvent function call. Example: Test files for details click "here". And clicking "Here" in the resultviewer will open a local EXCEL FILE.

0 Answers   ING,


i need to learn the descriptive programming very well so for that what to do am reading the qtp user mannual but it is not so any materials or links with examples i want please help me

2 Answers  


When ‘option explicit’ keyword is used in qtp?

0 Answers  


w is configaration management

3 Answers   TCS,


How to handle the errors without using recovery scenery?

3 Answers  






Hoe we can export TEST RESUALT IN to XL-sheet?

1 Answers   IBM,


If u r using descriptive programming to identify the object where do u write the script for those objects? do u write it in the expertview? plz do answer its urgent thanks advance.

3 Answers  


what all are the coverages , explain ?

2 Answers  


By using QTP, How do you test a frame in a web page?

4 Answers   TCS,


VM1 = "Invalid username or password. Please try again. " VM2 = "Email id is required.Password is required. " VM3 = "Email id is an invalid e-mail address.Password is required. " VM4 = "Password is required. " VM5 = "Email id is required. " VM6 = "Email id is an invalid e-mail address. " 'Rowcount of the Local sheet Rowcount = DataTable.GetSheet("Invalid login transactions").GetRowCount 'Valid emailid and Password Emailid = "test@iteamic.com" Password = "Password0" 'For i = 1 to Rowcount 'Parameterised Email_id Browser("Browser").Page ("Page").WebEdit("emailAddress").Set DataTable("Email_id", dtLocalSheet) EID = Browser("Browser").Page ("Page").WebEdit("emailAddress").GetRoProperty("value") 'Parameterised Password Browser("Browser").Page ("Page").WebEdit("password").Set DataTable("Password", dtLocalSheet) PWD = Browser("Browser").Page ("Page").WebEdit("password").GetROProperty("Value") If EID = Emailid And PWD = Password Then Reporter.ReportEvent micPass, "EID & PWD check", "Email id and Password is correct, One iteration of Invalid login attempts is not being executed" Else Browser("Browser").Page("Page").WebButton ("Sign-In").Click 'Output value exported to the local sheet Browser("Browser").Page ("Page_2").Output CheckPoint("Home page_Sign in") 'Storing the output value in a variable(OUTPUT OUTPUT = Datatable.GetSheet ("Invalid login transactions").Getparameter ("Validation_message_signin").value 'comparing the Variable Output and the Validation message for a given input If OUTPUT = VM1 Then Reporter.ReportEvent micPass, "VM1", "Invalid username or password. Please try again. " else if OUTPUT = VM2 Then Reporter.ReportEvent micPass, "VM2", "Email id is required.Password is required. " else if OUTPUT = VM3 Then Reporter.ReportEvent micPass, "VM3", "Email id is an invalid e-mail address.Password is required. " else if OUTPUT = VM4 Then Reporter.ReportEvent micPass, "VM4", "Password is required. " else if OUTPUT = VM5 Then Reporter.ReportEvent micPass, "VM5", "Email id is required. " else if OUTPUT = VM6 Then Reporter.ReportEvent micPass, "VM6", "Email id is an invalid e-mail address. " else Reporter.ReportEvent micFail, "EID & PWD check_FAIL", "Validation message checkpoint failed. The captured v msg is not required" End if End if I am getting syntax error saying "Expected 'End If'" at the last line, Why is this? Kindly explain...

1 Answers  


Explain about the Test Fusion Report of QTP?

1 Answers   Crea,


Name the properties you would use for identifying a browser and page when using descriptive programming?

0 Answers  


Categories