Micro Focus QTP (UFT) Forums

Full Version: Cannot find the "WebEdit" object's parent "Page" (class Page)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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.