Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need to Validate Text filed is blank after clicking on the Text box
#1
Not Solved
This is to validated the text filed is getting blank after clicking on the text field

Code:
Dim valTXT

Browser(xx).Page(yy).webedit("userName").Click
valTXT = Browser(xx).Page(yy).webedit("userName").GetRoProperty("value")

if valTXT="" Then
    print "The pasword field is blank after clicking"
else
    print "The pasword field is not blank after clicking"

EndIF

Above code i have used.

Note:
On clicking the text box it will be blank and when we click the anywhere outside the text box then the pre-populated text has to displayed.

So when the UFT click the Text box we can observe the text field is getting blank and while UFT getting the RO Property the pre-populated text is getting displayed. Because of which my test cases is getting failed.
Reply
#2
Not Solved
I guess for clicking outside you need low level recording mode to capture the outside clicks.
try this:
Code:
Dim valTXT
Browser(".*").Page(".*").webedit("email").Click
valTXT = Browser(".*").Page(".*").webedit("email").GetRoProperty("value")
if valTXT="" Then
print "The pasword field is blank after clicking"
else
print "The pasword field is not blank after clicking"
End if
Window("Window").WinObject("Running applications").Click 45,30
'Actvate Lowlevel recording to capture the click
Window("Windows Internet Explorer").Activate
Window("Windows Internet Explorer").WinObject("Internet Explorer_Server").Click 382,160
Window("Window").WinObject("Running applications").Click 532,21
Browser(".*").Page(".*").webedit("email").Click
valTXT = Browser(".*").Page(".*").webedit("email").GetRoProperty("value")
if valTXT="" Then
print "The pasword field is blank after clicking"
else
print "The pasword field is not blank after clicking"
End IF
Reply
#3
Not Solved
This doesn't solve the issue.
Reply
#4
Not Solved
Sorry, can you please provide the link where u r trying this if possible. 'cause there seems to be nothing wrong .
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problems with Text color recognition Treirk 0 973 06-17-2019, 12:19 PM
Last Post: Treirk
  How to remove text in the webedit silpavinod 3 13,377 07-12-2018, 11:08 AM
Last Post: vijaychourasiya0109@gmail.com
  text checkpoint properties error alp 0 1,051 11-24-2017, 04:36 PM
Last Post: alp
  How can we get the Windows application Text box background color Using UFT 11.53 Kuppampattu 3 5,669 06-06-2017, 11:12 AM
Last Post: workrohit08
  How to find and change text in PDF document using QTP UFT automation VBscript alexwhite 0 11,903 02-18-2017, 04:20 AM
Last Post: alexwhite

Forum Jump:


Users browsing this thread: 1 Guest(s)