Micro Focus QTP (UFT) Forums
Cannot find the "WebEdit" object's parent "Page" (class Page) - 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: Cannot find the "WebEdit" object's parent "Page" (class Page) (/Thread-Cannot-find-the-WebEdit-object-s-parent-Page-class-Page)



Cannot find the "WebEdit" object's parent "Page" (class Page) - hpham - 06-24-2008

Hi everyone,

I'm a newbie in QTP. I have just learn it, and I try to automate a requirement like this "Open google page,fill in data search then search".
I write code like these:

Code:
Dim obj_Browser
Dim obj_Page
Dim obj_Text
Dim obj_Search
Set obj_Browser = Description.Create
Set obj_Text = Description.Create
Set obj_Search = Description.Create
Set obj_Page = Description.Create

obj_Browser("name").value = "Google"
obj_Text("name").value = "q"
obj_Text("html tag").value = "INPUT"
obj_Page("name").value="Google"


obj_Search("type").Value = "Submit"
obj_Search("html tag").Value = "INPUT"
obj_Page("url").Value = "http://www.google.com"
obj_Browser.navigate "http://www.google.com"

Browser(obj_Browser).Page(obj_Page).WebEdit(obj_Text).Set "test"
Browser(obj_Browser).Page(obj_Page).WebButton(obj_Search).Click
Browser(obj_Browser).Page(obj_Page).Sync

However, when running, it cause error "Cannot find the "WebEdit" object's parent "Page" (class Page). Verify that parent properties match an object currently displayed in your application."

I don't know how to correct it. Pls hekp me, tks a lot.


RE: Cannot find the "WebEdit" object's parent "Page" (class Page) - Ankur - 06-26-2008

Since you are a beginner I would suggest you to go through each and every post on QTP Blog. This Q is related to Descriptive Programming(DP),you would find a lot of info there regarding DP.

ok, in the above Q, remove
Code:
obj_Page("url").Value = "http://www.google.com"
and check.