Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Condition if used to check set values in text box(simple one here)
#1
Solved: 10 Years, 9 Months, 1 Week ago Toungue 
Code:
window("Flight Reservation").Dialog("Open Order").Winedit("Edit").Set "swapna"

The above statement would set the text feild with swapna

Clarification:I want to check all the conditions in the like:
If the text box is null or if it has numerics ......then it should not aloow
i am using
1)for example:if i have to check text box is empty i used. I jus tried this.not working
Code:
if window("Flight Reservation").Dialog("Open Order").Winedit("Edit").Set ""="" then
statements........
end if

2) when i use the key word exsists
Code:
if window("Flight Reservation").Dialog("Open Order").exsits then
statements........
else
ststements
end if


Regards
Swapna
Reply
#2
Solved: 10 Years, 9 Months, 1 Week ago
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:

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
Reply
#3
Solved: 10 Years, 9 Months, 1 Week ago
Hi deepak
The above is fine ,n thank u for tht

But i jus wanna knoe in genral how to validate a text box with different conditions

like if (srting)
If (special chracters).
If (Blank space)
and also wrt date how to chk if its a valid date


regards
Swapna
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How can we get the Windows application Text box background color Using UFT 11.53 Kuppampattu 3 5,672 06-06-2017, 11:12 AM
Last Post: workrohit08
  Not able to set value in application web edit box tanuj dewangan 4 3,471 07-29-2016, 03:58 PM
Last Post: harshadevadas
  Need to verify the drop down values based on condition santhoshmscsoftware 1 2,714 05-04-2016, 11:28 PM
Last Post: supputuri
  Need to Validate Text filed is blank after clicking on the Text box balak89 3 4,545 09-13-2015, 12:06 AM
Last Post: ADITI1992
  Check Box Object Identification rakesh499 0 2,018 01-27-2015, 01:56 PM
Last Post: rakesh499

Forum Jump:


Users browsing this thread: 2 Guest(s)