Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98494

Clicking on Chrome UI (Selenium and Java) [duplicate]

$
0
0

I need to clear the Chrome cache during my automated testing...

![enter image description here]1

I need to uncheck the 1st and 2nd checkboxes, then click clear data. However, i am unable to do so. I did some research and found that i had to use the /deep/ selector, however, it still doesn't seem to work.

In my code, I tried to locate it as a web element, before using javascript to execute the click

js.executeScript("window.open()");
ArrayList<String> tabs = new ArrayList<String> (webDriver.getWindowHandles());
webDriver.switchTo().window(tabs.get(1)); 
webDriver.get("chrome://settings/clearBrowserData");

WebElement browsingHistory = 
          wait.until(ExpectedConditions.elementToBeClickable(By.cssSelector("* /deep/  #checkbox")));

js.executeScript("arguments[0].click()", browsingHistory);

Doesn't seem to be working... does anyone have any idea? I can get selenium to open a new tab, but that seems to be about it

Thanks!


Viewing all articles
Browse latest Browse all 98494

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>