Share this post with your friends
I've been looking all over the internet to find a way to login to a website with Selenium and keep the cookies saved. So I won't have to relogin every time. But all I got was disappointment. Then I came across the Google Chrome Driver. It has command line options to just what I was trying to do. I just want to share it with you guys. I know it's a pain in the ass to fix things like this.
ChromeOptions options = new ChromeOptions();
WebDriver driver = new ChromeDriver(options);
That's how I initialized the ChromeDriver and it worked like a charm. Do remember that,
profile\dir is the directory where you want to save the google chrome profile data.
User is the username for which you would like to save the preference of. Usually a directory will be created inside the
User, where all the user specific configurations will be saved.