How to Delete Chrome history without opening Chrome Application

Hi Guys,

I need help on deleting the Chrome History without opening the chrome application.

Right Now, I am doing it via opening the chrome browser and Sending the hotkeys Ctrl + Shift + Del and then clicking on the clear history option.

But sometimes it is working and sometimes not, robot is not able to find the UI Element and it is throwing the below error.

Error Message : The Exception is Could not find the UI element corresponding to this selector: [1] wnd app=‘chrome.exe’ cls=‘Chrome_WidgetWin_1’ title=‘Settings - Google Chrome’ [2] ctrl name=‘Settings’ role=‘document’ [3] ctrl name=‘Clear data’ role=‘push button’/> Search failed at selector tag: [1] wnd app=‘chrome.exe’ cls=‘Chrome_WidgetWin_1’ title=‘Settings - Google Chrome’ The closest matches found are: [91%] wnd app=‘chrome.exe’ cls=‘Chrome_WidgetWin_1’ title=‘Google - Google Chrome’/> at source UiPath.UiAutomation.Activities

Please let me know if you have any alternative robust approach. Also, Please suggest If there are any free packages on UiPath Marketplace.

Thanks in Advance! :grinning:

Hi

Replace the value of title attribute with a wild card symbol so that it will work

While coming to another approach
Check for this component

Cheers @shreyash_shirbhate

Hi @shreyash_shirbhate ,

Could you please automate to delete the userdata from the following path it will delete entire history from the google chrome browser.

C:\Users\Youruserid\AppData\Local\Google\Chrome

to navigate this path → Windows R → enter %appdata% → Local ->GOogle → Chrome.

Hope this will help your automation. and one more thing we cannot restore the history i guess once we perform the above step. thanks.

Regards,
Kirankumar.

Hey @kirankumar.mahanthi1 ,

You want me to delete all of the files inside below path?

And using which activity I will delete this all files?

We can go for delete activity to delete entire folder. but my concern it will remove the extensions as well i guess. i have tried at my end it removed the UiPath web automation extension from my chrome browser. Not good idea i guess.

I could see that userdata contains so many folders but we have to find out the exact folder for history so that we can delete that one alone or look for some other way.

@shreyash_shirbhate

Did this custom component helped you in achieving this

Find out the exact Path for history

Please delete the
C:\Users\kirmah\AppData\Local\Google\Chrome\User Data\Default\History file

using delete activity to remove the history alone from chrome browsers.

REgards,
Kirankumar.

Hey @Palaniyappan,

I am not able to see the package in manage package tab in UiPath.


Fine

You can download and add that your nugget feed
Then it will come under nugget.org feed in that manage packages window

@shreyash_shirbhate

Hey @kirankumar.mahanthi1,

You are talking about this file?
But I can see there are couple of history related files eg. Login Data

Hey @Palaniyappan,

After download, I can see below project and not a nugget package.

Also, please assist on how to add it on nugget feed?

Yeah @shreyash_shirbhate . Trying to see without using any custom activity how we can achieve this. Because in custom activity they would have used the similar steps what we are doing. in my organization we are not allowed to use custom activities we have to get permission from our architects.

Regards,
Kirankumar.

Yeah @kirankumar.mahanthi1 Please let me know if you are able to achieve it!

Sure buddy trying at my end.

1 Like

Custom activities are well tested by UiPath team before being published
So if crosses lot of validation process and compliance process before getting to market

It’s completely fine

The main purpose of custom component is reusability

And the way to add to nugget feed is
%ProgramFiles%\UiPath\Studio\Packages

Add that downloaded file here and go to studio and open manage packages
There you can see a tab called nuget.org
Click on and search for that activity package and install it

Cheers @shreyash_shirbhate

Hi @shreyash_shirbhate

Another approach is to incognito mode, or private browsing, that will not save your history, cache, password, or anything. This way u save both the execution time of the bot and add extra activity to delete history files.

1 Like

Hey @Palaniyappan, you want me to modify the selector like below?

wnd app=‘chrome.exe’ cls=‘Chrome_WidgetWin_1’ title=‘*’
ctrl name=‘Settings’ role=‘document’
ctrl name=‘Clear data’ role=‘push button’

is this right? Or Please modify it and can you please send it back to me?

Actual Selector:

wnd app=‘chrome.exe’ cls=‘Chrome_WidgetWin_1’ title=‘Settings - Google Chrome’
ctrl name=‘Settings’ role=‘document’
ctrl name=‘Clear data’ role=‘push button’

Thanks!

1 Like

Modify like this for title attribute

title=‘*Google Chrome’

Cheers @shreyash_shirbhate

Yeah got it @Palaniyappan . i also aware of that we are keeping these points in our upcoming discussions on governance. hope our organization will allow us to use it in upcoming projects. thanks for your message.

Regards,
Kirankumar.

1 Like

Hey @Palaniyappan, I am not able to find the above path in my machine.
I have tried with ProgramFiles(86) folder as well.