0 votes
1 view
in Devops and Agile by (28.1k 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 (48k 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(...);

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...