06-24-2008, 10:14 AM
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:
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.
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.