02-27-2008, 06:27 PM
Hi Swapna,
You want to check that whether the text box is null or if it has numerics.
Now, if you want to check it afterwards then it means after entering the values in the text box.Then, you can do so after taking the output values in a variable and then checking whether it is NULL or numeric
BUT if you want to check before entering any value in the text box like a validation that it should not allow blank or numeric.Then you can do that by getting the ROProperty of any property's value and matching it with the required data.
Here,you give the right choice for which the text box should accept the value and rest all cases will fail.I mean you cannot bifurcate the invalid cases,you just have one right and rest wrong.
Example-
Suppose I want username to be "Deepak" and I entered "abc" as username.So,this is how you can check:
You want to check that whether the text box is null or if it has numerics.
Now, if you want to check it afterwards then it means after entering the values in the text box.Then, you can do so after taking the output values in a variable and then checking whether it is NULL or numeric
BUT if you want to check before entering any value in the text box like a validation that it should not allow blank or numeric.Then you can do that by getting the ROProperty of any property's value and matching it with the required data.
Here,you give the right choice for which the text box should accept the value and rest all cases will fail.I mean you cannot bifurcate the invalid cases,you just have one right and rest wrong.
Example-
Suppose I want username to be "Deepak" and I entered "abc" as username.So,this is how you can check:
Code:
Browser("orkut - login").Page("orkut - login").WebEdit("Email").Set "abc"
username=Browser("orkut - login").Page("orkut - login").WebEdit("Email").GetROProperty("value")'
If username="deepak" Then
Reporter.ReportEvent micPass, "username" , "pass"
Browser("orkut - login").Page("orkut - login").WebEdit("Passwd").SetSecure "34723fh445346hgjhghfgh35dghdhjfhfk"
Browser("orkut - login").Page("orkut - login").WebButton("Sign in").Click
else
Reporter.ReportEvent micFail, "username" , "fail"
exittest()
End If