Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP functionalities.
#1
Solved: 10 Years, 9 Months ago
Hi,

I am suma. I hav a query in QTP as below.

For particular field can hav no. of conditions like.,
ex: First Name
conditions :
  • should accept only char.
  • Should not contain any numericals - if then error message has to display
  • should not accept only special chars - otherwise error message has to display
  • should contain min 3 and max 10 char - otherwise appropriate error message has to display

For this how to write coding, that QTP has to display appropriate message automatically?
(ex: Through datatable parameterization if we pass "ra" and "ram" then for "ra" it has to display "Enter min 3 char and max 10 char"
and for "ram" has to display "Entered First Name is valid")
Hope i'l get solution for this query.
Thankyou in advance, Please help out
Thanks
Suma.K
Reply
#2
Solved: 10 Years, 9 Months ago
Hi,

Please look into the following URL,

https://www.learnqtp.com/forums/Thread-N...-using-QTP

Thanks,
Reply
#3
Solved: 10 Years, 9 Months ago
Suma -
I am not sure how you would be expecting a complete code base for your requirement. Normally on a forum you can expect a quick hint or a part of the code or resolved issues from your code. Plus, you would need to supply enough information in terms of the application & the QTP version you use.

I will show you an simple example for one of the scenarios you listed.("Enter min 3 char and max 10 char")

1. Calculate the length of the string you are passing.

if len(firstname) > 2 And len(firstname)<=10 Then
Reporter.reporterevent micpass, "First Name", "Entered First Name is valid"
Else
Reporter.Reporterevent micfail, "First Name", "Enter min 3 char and max 10 char"
End if

Hope this helps.

Let me know if you need anything else.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)