Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Highlighted
tomek86 Valued Contributor.
Valued Contributor.
287 views

Clear Browser History in Mobile Chrome on Android

Hi,

I'm executing a test on Mobile Browser and need to delete browser history/cache in the beginning.

I'm using WebUtil.LaunchBrowserById method to connect to the device and open the browser (Android device, Chrome Browser).

Using Browser("xxx").ClearCache or Browser("xxx").DeleteCookies DOESN'T WORK.

So far I've found the following options to clear the history:

1. Use 'Device' object

Automated clicking in Chrome on 'More Settings -> Advanced -> Privacy -> Clear browsing data

This solution however means that I need to connect to the device using MobileUtil.SetActiveMobileDeviceByID, which is then causing problems with WebUtil.LaunchBrowserById (the browser objects are no longer recognized)

2. Use Chrome URLs

Either 'chrome://chrome-urls/' or directly 'chrome://history'.

This solution is better for me because I can use my WebUtil method to connect to device and all my objects are recognized.

However, the problem is that when I type Browser("xxxx").Navigate "chrome://history" then the colon character (:) is skipped and the navigation fails.

How can I force UFT to navigate to "chrome://history"??

 

Thanks a lot,

Tomasz

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.