Skip to main content

Clear cache Selenium




    /*
     * // clear cache
     *
     * public static void clearCache() throws InterruptedException {
     *
     * String chromedriverPath = System.getProperty("user.dir") +
     * "\\src\\test\\resources\\executable\\chromedriver.exe";
     *
     * System.setProperty("webdriver.chrome.driver", chromedriverPath);
     * ChromeOptions chromeoptions = new ChromeOptions();
     *
     *
     * // chromeoptions.addArguments("--headless");
     * chromeoptions.addArguments("start-maximized");
     *
     * chromeoptions.addArguments("disable-extensions");
     *
     * chromeoptions.addArguments("--disable-popup-blocking");
     *
     * chromeoptions.addArguments("--diable-infobars");
     *
     * driver = new ChromeDriver(chromeoptions);
     *
     * driver.get("chrome://settings/clearBrowserData"); Thread.sleep(5000);
     *
     * driver.switchTo().activeElement();
     *
     * driver.findElement(By.cssSelector("* /deep/ #clearBrowsingDataConfirm")).
     * click();
     *
     * Thread.sleep(5000);
     *
     * }
     *
     *
     *
     * //launch with cache disabled
     *
     * @SuppressWarnings("deprecation") public static void launchWithoutCache() {
     *
     *
     * String chromedriverPath = System.getProperty("user.dir") +
     * "\\src\\test\\resources\\executable\\chromedriver.exe";
     *
     * System.setProperty("webdriver.chrome.driver", chromedriverPath);
     * DesiredCapabilities cap=DesiredCapabilities.chrome();
     * cap.setCapability("applicationCacheEsnabled", false); driver=new
     * ChromeDriver(cap);
     *
     * }
     *
     */

Comments

Popular posts from this blog

Xpath toughest

1. //span[contains(text(),'Please enter the comments!')]//following-sibling::div//input//following-sibling::textarea Some of the other Xpaths are 1. search RBGA //clicking on the new request //a[@title='Request a new workflow for RB General Approval Form']         @FindBy(xpath="//body[contains(@class,'ext-safari')]/form[contains(@name,'workOnIssueForm')]/table[contains(@class,'jiraform maxWidth')]/tbody/tr/td[contains(@class,'rb_formArea')]/fieldset[contains(@class,'rb_WorkON_FieldSet')]/table/tbody/tr/td/div[contains(@class,'rb_WorkON_FieldContainer')]/div[contains(@class,'rb_WorkON_FieldValueArea rb_WorkON_FieldValueArea_create rb_WorkON_ValueArea_Wide')]/table[contains(@class,'workonstdtable')]/tbody/tr/td/input[1]")     public WebElement tickMark;         @FindBy(xpath="//body[contains(@class,'ext-safari')]/form[contains(@name,'workOnIssueForm')]/table[contains(@class,...

Date Time API

Issues with the Existing   Date / Time   APIs 1. Thread Safefty:- develpoers have to deal with concurrency issues.new date and time api in java 8 are immutable and thread safe and thus taking concurrency headache away from developers. 2. API Design and Ease of Understanding: good utility methods in new API 3. Zoned Date and Time Functinality is added. 4. The format that I have used in my project is basically a user defined format String userdefinedDate=localdate.format(DateTimeFormatter.ofPattern("dd.MM.yyyy")); System.out.println(userdefinedDate); ==================================================================== Study Link https://www.baeldung.com/java-8-date-time-intro#:~:text=Java%208%20provides%20ZonedDateTime%20when,to%20represent%20them%20as%20follows. Working With   LocalDate LocalDate localDate = LocalDate.now(); LocalDate.of(2015, 02, 20); LocalDate tomorrow = LocalDate.now().plusDays( 1 ); DayOfWeek sunday = LocalDate.parse("2016-06-12").getDayOfWeek...