Opening Firefox with a Specific, non anonymous profile

I will describe what I have found.

I made 2 Firefox profiles: usualProfile and seleniumProfile:

By clicking “start firefox” button with seleniumProfile selected, I got the following “about:profiles” page. Please note that a Green Extension icon is displayed. This Green icon indicates that Firefox is opened with seleniumProfile.

In the “firefox.exe -P” dialog I selected usualProfile.

Then, By clicking “start firefox” button with usualProfile selected, I got the following “about:profiles” page. Please note that a Red Extension icon is displayed and no Green icon there. This Red icon indicates that Firefox is opened with usualProfile.

Now, I go back to Katalon Studio, executed the following testcase:

import org.openqa.selenium.WebDriver
import org.openqa.selenium.firefox.FirefoxDriver
import org.openqa.selenium.firefox.FirefoxOptions
import org.openqa.selenium.firefox.FirefoxProfile
import org.openqa.selenium.firefox.internal.ProfilesIni
import com.kms.katalon.core.webui.driver.DriverFactory
import com.kms.katalon.core.webui.driver.WebUIDriverType
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
//WebUI.openBrowser('')
WebUIDriverType executedBrowser = DriverFactory.getExecutedBrowser()
switch(executedBrowser) {
    case WebUIDriverType.FIREFOX_DRIVER:          // "Firefox"
        ProfilesIni profile = new ProfilesIni();
        FirefoxProfile FF = profile.getProfile("seleniumProfile");
        FirefoxOptions options = new FirefoxOptions().setProfile(FF);        System.setProperty('webdriver.gecko.driver', DriverFactory.getGeckoDriverPath())
        WebDriver driver = new FirefoxDriver(options);
        // let Katalon Studio to use the WebDriver created here
        DriverFactory.changeWebDriver(driver)
        break
}
WebUI.navigateToUrl('http://demoaut.katalon.com/')

//WebUI.closeBrowser()

Then I got the following “about:profiles” page displayed:

Please find

(1) On the top-right of the window, I find a Green extension icon. This Green icon indicates that the Firefox is opened with the seleniumProfile.

(2) However the “about:profiles” page is saying that the usualProfile is in use.
_
Inconsistent!_

I think that

(a) Firefox browser is actually opened with seleniumProfile which I specified through WebDriver call. The test case code ran successful

(b) The “about:profiles” page displays some static information which can be visualized by “firefox.exe -P” command. The “about:profiles” page shows the previous record which user profiles you clicked and selected in the UI for the last time. The “about:profiles” does not displays dynamic status which Profiles has been applied by WebDriver to the current Forefox process.

-----

So, my lesson is that “about:profiles” of Firefox does not tell me the truth (which user profile is applied) when Firefox is opened by WebDriver.

19122_i_have_2_firefox_profiles.png

19122_seleniumProfile_applied.png

19122_usualProfile_applied_2.png

19122_select_usualProfile.png

19122_Firefox_opened_by_webdriver_shows_about-profiles_page_misleading.png