groupon / Selenium-Grid-Extras

Simplify the management of the Selenium Grid Nodes and stabilize said nodes by cleaning up the test environment after the build has been completed
BSD 3-Clause "New" or "Revised" License
536 stars 209 forks source link

need ability NOT clear browser history.... #247

Open shankarkc opened 8 years ago

shankarkc commented 8 years ago

Hi I have a scenario where the class suite initialization sets some cookies. But when I close browser session grid extra always clears all browser history. Its a problem for us. each time we need to call code to reinit the cookies. Can you please change the code NOT to clean up the cookies based on some config value? Like below ?

 if (!RuntimeConfig.historyCleanupNotRequired) {
        logger.info(String.format("Clearing all browser data with command %s", getClearHistoryCommand()));
        JsonObject clearHistoryResponse = ExecuteCommand.execRuntime(getClearHistoryCommand(), true);
        logger.debug(clearHistoryResponse);
    }
    else
    {
        logger.info("Not cleaning the history as RuntimeConfig.historyCleanupNotRequired set to true");
    }

This code may go in files like ...SeleniumGridExtras/src/main/java/com/groupon/seleniumgridextras/tasks/KillAll*.java If there is some better way of doing this please let me know. Thanks Shankar

smccarthy commented 8 years ago

@shankarkc This seems like a good enhancement.