Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (29.3k points)

I am using Selenium Web Driver API with Java. Every time I want to debug my test cases, a temporary profile for Firefox is created in the temporary files directory. This is a headache in two ways.

It definitely is taking unnecessary time to create a profile and is taking unnecessary space.

I cannot install any add-ons that will be available next time I launch my test cases.

How do I get around this?

1 Answer

0 votes
by (50.2k points)

You can handle this by using

FirefoxProfile profile = new FirefoxProfile(new File("D:\\Selenium Profile"));                  

WebDriver driver = new FirefoxDriver(profile);

There is one more option but it inherits all the cookies, cache contents, etc. of the previous uses of the profile let’s see how it will be

System.setProperty("webdriver.firefox.profile", "MySeleniumProfile");

WebDriver driver = new FirefoxDriver(...);

Browse Categories