Using Selenium To Clear Browsing Data In Chrome

Using Selenium To Clear Browsing Data In Chrome

When working with pages in several automating projects I noticed that the fields like login ID, search fields, etc., are getting saved on the page. Thus, when my Selenium test runs, I need to put additional code to clear those fields if those are populated. I needed a way to clear the browsing data through my test before I went to the page.

When working with pages in several automating projects I noticed that the fields like login ID, search fields, etc., are getting saved on the page. Thus, when my Selenium test runs, I need to put additional code to clear those fields if those are populated. I needed a way to clear the browsing data through my test before I went to the page.

I attempted a few solutions from here and here. However, these worked on older versions of the Chrome browser. Next, I tried out the solution from here. It worked in part but I needed to also set the time range as AllTime.

A longer version of the final completed code is here. It basically traverses through the DOM which is tricky because of the nested shadow roots. This version is easy to understand but it is long and it's a bit flaky as well.

tutorial automation c# selenium chrome browser

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Why Selenium Grid Is Ideal For Automated Browser Testing?

Selenium Grid and Selenium test automation are the ideal choices for performing automated browser testing, find out why in this blog.

WebDriverIO Tutorial: Handling Alerts and Overlay In Selenium

In this WebDriverIO tutorial on alert handling in Selenium, I’ll show you how to handle alerts and pop-ups as well as overlay modal in WebDriverIO.

How To Get Attribute Value In Selenium WebDriver

How To Get Attribute Value In Selenium WebDriver. While you are automating your test cases with Selenium automation, here is how to start implementing Selenium getAttribute() method to get the best results.

Selenium C# Tutorial: Introduction

For C# fans who want to automate testing efforts using Selenium, here's a compilation of our Selenium C# tutorials to help you on the journey to an expert!

C++ Tutorial for Beginners - Full Course. DO NOT MISS!!!

C++ Tutorial for Beginners - Full Course.What's special about it? Why are so many people looking forward to it? DO NOT MISS!!!