Via eclipse, I run the JUnit test using geckodriver, the firefox 50.1 browser is open, without plugins, without a saved login. How to make tests run in my working browser?

package com.example.tests; import java.util.regex.Pattern; import java.util.concurrent.TimeUnit; import org.junit.*; import static org.junit.Assert.*; import static org.hamcrest.CoreMatchers.*; import org.openqa.selenium.*; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.Select; public class InstSubs { private WebDriver driver; private String baseUrl; private boolean acceptNextAlert = true; private StringBuffer verificationErrors = new StringBuffer(); @Before public void setUp() throws Exception { System.setProperty("webdriver.gecko.driver", "C:/eclipse/selenium/geckodriver.exe"); driver = new FirefoxDriver(); baseUrl = "http://*****.com/"; driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); } 

    1 answer 1

    Copy your profile folder to the FF folder named myprofile2222111.

    Option 1: Enter the -profile myprofile2222111 in the FF startup parameters

    Option 2: Rename firefox.exe to firefox1.exe create a .bat file with the contents

     start firefox.exe -profile myprofile2222111 

    using battoexeconverter, convert your .bat to .exe file in the FF folder with the name firefox.exe

    • Thanks for the answer. I tried the second option, it turned out to be obsession. firefox.exe launches firefox.exe. if before compiling the batch file in the exe, specify start firefox1.exe ..., then it is manually started as desired, and the geckodriver doesn’t find firefox1.exe when the test is started. You didn’t google the launch options, can you tell in more detail what you meant? - Rodger