GET WHETHER THE GIVE NUMBER VALID OR NOT IN BETWEEN THE
GIVEN RANGE?IN VB SCRIPT(QTP)

Answers were Sorted based on User's Feedback



GET WHETHER THE GIVE NUMBER VALID OR NOT IN BETWEEN THE GIVEN RANGE?IN VB SCRIPT(QTP)..

Answer / guest

Function ValidInteger(sNumber, iMin, iMax)
Dim iNumber
' Is it a number?
If IsNumeric(sNumber) Then
' Is it an integer?
If InStr(sNumber,".") = 0 Then
' Is it in the correct range?
If CLng(sNumber) >= iMin And CLng(sNumber) <= iMax Then
ValidInteger = "Valid Number Thank You"
Else
ValidInteger = "You must enter an integer between " & iMin &
" and " & iMax
End If
Else
ValidInteger = "You must enter a whole number"
End If
Else
ValidInteger = "You must enter a number"
End If
End Function
msgbox ValidInteger(9, 1, 10)

Is This Answer Correct ?    5 Yes 2 No

GET WHETHER THE GIVE NUMBER VALID OR NOT IN BETWEEN THE GIVEN RANGE?IN VB SCRIPT(QTP)..

Answer / arun

'the above code was not working fine so i modified that

Validinteger 20,1,100


Function ValidInteger(sNumber, iMin, iMax)
Dim iNumber
' Is it a number?
If IsNumeric(sNumber) Then
' Is it an integer?
If InStr(sNumber,".") = 0 Then
' Is it in the correct range?
If CLng(sNumber) >= iMin And CLng(sNumber) <= iMax Then
msgbox "Valid Number Thank You"
Else
msgbox "You must enter an integer between " & iMin &" and " & iMax
End If
Else
msgbox "You must enter a whole number"
End If
Else
msgbox "You must enter a number"
End If
End Function

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More QTP Interview Questions

What is the quicktest professional (qtp) testing process?

0 Answers  


What are the recording modes and executing modes avialble in QTP?

3 Answers   Polaris,


How software automation specialist enter steps in the Expert View?

0 Answers  


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

3 Answers   Symantic Space,


What are the disadvantages of Recovery Scenarios in QTP ?

3 Answers  






What are the properties you would use for identifying a browser & page when using descriptive programming ?

2 Answers  


how do you invoke the application through QTP?

1 Answers  


Suppose one object is changed in a project after delivering the project.Where we will update that object? it can be present in many scripts so can we update all the scripts?

1 Answers   IBM,


what is KEYWORD DRIVEN TESTING ? I M NOT ASKIN WHAT IS KEY WORD VIEW PLZ ANS FOR ONLY WHAT IS KEYWORD DRIVEN TESTING EXACTLY THANX

3 Answers  


How should i get name of the screen? Ex:There is a "submit" button.If i clicked on the submit button it opens a screen. I want that screen name.How can i get that screen name I dont have any property regarding that screen. If suppose we cliked on the screen , Then QTP captures the screen properties then i can get the screen name by using GETROPROPERTY But i want the screen name without clicking the screen. ("I am using the "settoproperty" for Second screen by using fist screen properties") Please tell me anyone

3 Answers   Livetek,


What is operator in VB Script?

1 Answers   IBM,


How do you test the text displayed in the header portion of times of india epaper. Hot news(banner) are scrolling in the top of the page, how do you test using QTP?

0 Answers  


Categories