Micro Focus QTP (UFT) Forums
I do not understand why my DP is not working. So obvious! - 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: I do not understand why my DP is not working. So obvious! (/Thread-I-do-not-understand-why-my-DP-is-not-working-So-obvious)



I do not understand why my DP is not working. So obvious! - chong67 - 06-22-2012

This is my DP:

Code:
Browser("name:=Delta - Book a flight").Page("title:=Delta - Book a flight").WebEdit("name:=departureCity[0]", "html id:=departureCity_0").Set "ATL"

This is what is recorded by QTP10:

Code:
Browser("Delta - Book a flight").Page("Delta - Book a flight").WebEdit("departureCity[0]").Set "ATL"

Error msg says "cannot identify the object "[WebEdit]" .... etc See screenshot

See my two attachments.

This is very frustrating! I dont know what I am doing wrong.

Please help.


RE: I do not understand why my DP is not working. So obvious! - ravi.gajul - 06-23-2012

Use escape sequence where ever a special character occurs while writing a DP code for your object to be identified properly.So lets correct your code as shown below.
Code:
Browser("name:=Delta - Book a flight").Page("title:=Delta - Book a flight").WebEdit("name:=departureCity\[0\]", "html id:=departureCity_0").Set "ATL"
This will identify and set the value "ALT" in the webedit mentioned.


Regards,
Ravi



RE: I do not understand why my DP is not working. So obvious! - chong67 - 06-25-2012

Thank you so much Ravi! It work!

I wonder what my next stumbling block is.
Thanks Ravi! It is working now!