Highlighted
New Member.
1307 views

Cannot find the "[ WebEdit ]" object's parent "[ Browser ]" (class Browser).

Hi Pros,


I am very new to UFT and I am trying to automate a very simple test case as below:


Launch amazon.com. In the item search type "Male hair band".


For this I am writing the script as below:

Systemutil.run "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe","https://www.amazon.com/"
Browser("micclass:=Browser").Page("micclass:=Page").WebEdit("type:=text","name:=field-keywords","html tag:=INPUT").Set "Male hair band"

When I am executing the script I am seeing error as below:

Cannot find the "[ WebEdit ]" object's parent "[ Browser ]" (class Browser).
Verify that parent properties match an object currently displayed in your application.

Looks like the error is related to object identification. I have tried to record the script and play back. Recorded script is as below and it runs without any issue.

Systemutil.run "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe","https://www.amazon.com/"
Browser("Amazon.com: Online Shopping").Page("Amazon.com: Online Shopping").WebEdit("field-keywords").Set "Male hair band"

I have even tried to add additional properties of the web edit box as abs_x and abs_y in my descriptive progamming script but still the error persists.

Can any one please help me out to resolve the error with my descriptive programing script?

0 Likes
2 Replies
Highlighted
Honored Contributor.
Honored Contributor.

Re: Cannot find the "[ WebEdit ]" object's parent "[ Browser ]" (class Browser).

Hi there.

Do you have the Chrome extnesion for your UFT installation?

Please see the attached image .

Sould look something ike it...

 

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Cannot find the "[ WebEdit ]" object's parent "[ Browser ]" (class Browser).

Abhijnan, 

Use name or title property for browser and page. You can also use creationtime or index. 

Browser("CreationTime:=0").Page("index:=0").WebEdit("type:=text","name:=field-keywords","html tag:=INPUT").Set "Male hair band"

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.