Micro Focus QTP (UFT) Forums
Need to Validate Text filed is blank after clicking on the Text box - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Need to Validate Text filed is blank after clicking on the Text box (/Thread-Need-to-Validate-Text-filed-is-blank-after-clicking-on-the-Text-box)



Need to Validate Text filed is blank after clicking on the Text box - balak89 - 08-20-2015

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.


RE: Need to Validate Text filed is blank after clicking on the Text box - ADITI1992 - 08-20-2015

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



RE: Need to Validate Text filed is blank after clicking on the Text box - balak89 - 08-28-2015

This doesn't solve the issue.


RE: Need to Validate Text filed is blank after clicking on the Text box - ADITI1992 - 09-13-2015

Sorry, can you please provide the link where u r trying this if possible. 'cause there seems to be nothing wrong .