HTML5 Required field pop-up errors can’t be identified in UFT
Question ID: 108319
1
0

I am trying to test error messages using QTP/UFT but having trouble capturing the error messages such as popup e.g. Name Required. I googled it and tried following but it doesn’t find the element.

Browser ("CreationTime:=0").Page("index:=0").WebElement("html tag:=DIV", "html id:=contentContainer").GetROProperty("innertext")

Could you please let me know if you have any other recommendations?

Example: https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_input_required

Marked as spam
Posted by (Questions: 424, Answers: 91)
Asked on April 27, 2018 9:34 pm
39 views
Answers (1)
1
Private answer

One method would be to capture the pop-up as a Bitmap Checkpoint, then use **Update Run Mode**.

1) Start recording and record the first step of making the pop-up appear (in this case, by clicking the Submit Query button with nothing in the username field).

![alt text][1]

2) While still recording, click on the Checkpoint dropdown and select ''Bitmap Checkpoint.''

![alt text][2]

3) Click anywhere on the webpage (it doesn't matter where, we will update it later), enter a name, and click OK. Don't worry that the pop-up doesn't show in the bitmap capture.

![alt text][3]

4) You now have your portion of code that will invoke the pop-up.

5) Now, click on the down-arrow next to the Run button in UFT and select **Update Run Mode**, and run the script.

6) Open your Object Repository and you will see your Bitmap Checkpoint now includes the pop-up. You can then refine the checkpoint image to only include it, if desired:

![alt text][4]

7) You now have the pop-up captured as a Bitmap Checkpoint that you can test against:

![alt text][5]

[1]: /storage/temp/801-1.png
[2]: /storage/temp/802-2.png
[3]: /storage/temp/803-3.png
[4]: /storage/temp/804-4.png
[5]: /storage/temp/805-5.png

Marked as spam
Posted by (Questions: 0, Answers: 771)
Answered on April 27, 2018 9:41 pm
0
Thanks, this helps a great deal.
( at April 27, 2018 9:42 pm)
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top