# Error when I try to run my script in Firefox with a specific non anonymous profile

**URL:** <https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [February 19, 2022, 12:38pm UTC](https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675 "2022-02-19T12:38:29Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![simos.sigma](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/simos.sigma/32/19248_2.png) [@simos.sigma](https://forum.katalon.com/u/simos.sigma)\
**Post date:** [February 19, 2022, 12:38pm UTC](https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675/1 "2022-02-19T12:38:29Z")

</div>

Hello community!!!

I am trying to open my test case with a non anonymous profile of Firefox, using the code I found [here](http://forum.katalon.com/t/opening-firefox-with-a-specific-non-anonymous-profile/12012/2), but I get error.

Here is my code:

```auto
import org.openqa.selenium.By
import org.openqa.selenium.WebDriver
import org.openqa.selenium.WebElement
import org.openqa.selenium.firefox.FirefoxDriver
import org.openqa.selenium.firefox.FirefoxOptions
import org.openqa.selenium.firefox.FirefoxProfile
import org.openqa.selenium.firefox.ProfilesIni

import com.kms.katalon.core.model.FailureHandling
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:
		ProfilesIni profile = new ProfilesIni()
		FirefoxProfile FF = profile.getProfile("default")
		FirefoxOptions options = new FirefoxOptions().setProfile(FF)
		System.setProperty('webdriver.gecko.driver', DriverFactory.getGeckoDriverPath())
		WebDriver driver = new FirefoxDriver(options)
		WebUI.closeBrowser()
		DriverFactory.changeWebDriver(driver)
		break
}
WebUI.navigateToUrl(GlobalVariable.artistURL)

```

And here is the error:

```auto
Test Cases/MyCaseName FAILED.
Reason:
org.openqa.selenium.WebDriverException: Unexpected value for profile: null
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'MYPCNAME', ip: 'MyIP', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_282'
Driver info: driver.version: unknown
	at org.openqa.selenium.firefox.FirefoxOptions.setCapability(FirefoxOptions.java:328)
	at org.openqa.selenium.firefox.FirefoxOptions.setProfile(FirefoxOptions.java:224)
	at org.openqa.selenium.firefox.FirefoxOptions$setProfile.call(Unknown Source)
	at MyCaseName.begin(MyCaseName:109)
	at MyCaseName.artistURL(MyCaseName:52)
	at MyCaseName.beginChoice(MyCaseName:34)
	at MyCaseName.run(MyCaseName:18)
	at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
	at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:442)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:433)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:412)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:404)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:281)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:142)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:133)
	at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
	at TempTestCase1645273475588.run(TempTestCase1645273475588.groovy:25)

```

Any idea why is this happening?

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [February 19, 2022, 12:52pm UTC](https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675/2 "2022-02-19T12:52:19Z")

</div>

> [@simos.sigma](#):
>
> ```auto
> at MyCaseName.begin(MyCaseName:109) 
> at MyCaseName.artistURL(MyCaseName:52) 
> at MyCaseName.beginChoice(MyCaseName:34)
> 
> ```

The code you exposed to us does not contain `begin`, `artistURL`, `beginChoice`.  
This implies that the error was thrown by some other code.  
You are looking at wrong point.

---

<div class="post-metadata">

**Author:** ![simos.sigma](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/simos.sigma/32/19248_2.png) [@simos.sigma](https://forum.katalon.com/u/simos.sigma)\
**Post date:** [February 19, 2022, 12:57pm UTC](https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675/3 "2022-02-19T12:57:42Z")

</div>

No, I just change the `WebUI.navigateToUrl` and removed what it does after navigates to this URL… I think the problem is here: `org.openqa.selenium.WebDriverException: Unexpected value for profile: null` and here `Driver info: driver.version: unknown`. But I don’t know what to do with this…

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [February 19, 2022, 1:01pm UTC](https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675/4 "2022-02-19T13:01:20Z")

</div>

I tried the code you exposed to us. It worked fine without any error.

This implies your original code (which is different from what you exposed to us) has something wrong, but others can not see what. I have no more comment.

---

<div class="post-metadata">

**Author:** ![simos.sigma](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/simos.sigma/32/19248_2.png) [@simos.sigma](https://forum.katalon.com/u/simos.sigma)\
**Post date:** [February 19, 2022, 1:27pm UTC](https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675/5 "2022-02-19T13:27:09Z")

</div>

Okay, I isolated the code into an other, new test case, and it gives me error again…

Here is my code as it is now:

```auto
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.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:
		ProfilesIni profile = new ProfilesIni()
		FirefoxProfile FF = profile.getProfile("default")
		FirefoxOptions options = new FirefoxOptions().setProfile(FF)
		System.setProperty('webdriver.gecko.driver', DriverFactory.getGeckoDriverPath())
		WebDriver driver = new FirefoxDriver(options)
		WebUI.closeBrowser()
		DriverFactory.changeWebDriver(driver)
		break
}
WebUI.navigateToUrl('https://wwww.google.com')
WebUI.waitForPageLoad(60)

```

And here is the error:

```auto
Test Cases/Just a test case FAILED.
Reason:
org.openqa.selenium.WebDriverException: Unexpected value for profile: null
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: ' ***', ip: '***', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_282'
Driver info: driver.version: unknown
	at org.openqa.selenium.firefox.FirefoxOptions.setCapability(FirefoxOptions.java:328)
	at org.openqa.selenium.firefox.FirefoxOptions.setProfile(FirefoxOptions.java:224)
	at org.openqa.selenium.firefox.FirefoxOptions$setProfile.call(Unknown Source)
	at Just a test case.run(Just a test case:24)
	at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
	at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:442)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:433)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:412)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:404)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:281)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:142)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:133)
	at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
	at TempTestCase1645276899755.run(TempTestCase1645276899755.groovy:25)

```

---

<div class="post-metadata">

**Author:** ![simos.sigma](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/simos.sigma/32/19248_2.png) [@simos.sigma](https://forum.katalon.com/u/simos.sigma)\
**Post date:** [February 19, 2022, 1:44pm UTC](https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675/6 "2022-02-19T13:44:07Z")

</div>

The script worked and I think I found what was wrong… For some reason, I had to create a second Firefox profile. It doesn’t work if Firefox has only one profile and in fact the default one!!! Have you noticed that too?

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [February 19, 2022, 1:46pm UTC](https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675/7 "2022-02-19T13:46:10Z")

</div>

No. I noticed another point.

> [@simos.sigma](#):
>
> ‘[https://wwww.google.com](https://wwww.google.com)’

This URL is wrong.  
`wwww` should be `www`.  
Not 4 w but 3.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [February 19, 2022, 1:50pm UTC](https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675/8 "2022-02-19T13:50:45Z")

</div>

You should remove 2 lines:

> [@simos.sigma](#):
>
> ```auto
> // WebUI.openBrowser('')
> 
> WebUIDriverType executedBrowser = DriverFactory.getExecutedBrowser()
> switch(executedBrowser) {
> case WebUIDriverType.FIREFOX_DRIVER:
> ProfilesIni profile = new ProfilesIni()
> FirefoxProfile FF = profile.getProfile("default")
> FirefoxOptions options = new FirefoxOptions().setProfile(FF)
> System.setProperty('webdriver.gecko.driver', DriverFactory.getGeckoDriverPath())	
> WebDriver driver = new FirefoxDriver(options)
> 
> // WebUI.closeBrowser()
> 
> DriverFactory.changeWebDriver(driver)
> break
> }
> WebUI.navigateToUrl('https://wwww.google.com')
> 
> ```

The above 2 lines does not make sense in this context.

---

<div class="post-metadata">

**Author:** ![simos.sigma](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/simos.sigma/32/19248_2.png) [@simos.sigma](https://forum.katalon.com/u/simos.sigma)\
**Post date:** [February 19, 2022, 2:05pm UTC](https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675/9 "2022-02-19T14:05:12Z")

</div>

Okay I changed it and it is working… **But** , only with my new created profile. If I run it using by default Firefox profile `FirefoxProfile FF = profile.getProfile("default")` script keep saying `Running` without do something. If I run it using my new created profile `FirefoxProfile FF = profile.getProfile("For Katalon")` it is working!!!

And I wonder, does this have to do with the default profile? Or because my default profile is signed in as Firefox account?

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [February 19, 2022, 2:13pm UTC](https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675/10 "2022-02-19T14:13:33Z")

</div>

The _default_ Firefox profile is not necessarily named with a string “default”.

For example, on my PC, the _default_ Firefox profile is named with a string “kazurayam”.

---

<div class="post-metadata">

**Author:** ![simos.sigma](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/simos.sigma/32/19248_2.png) [@simos.sigma](https://forum.katalon.com/u/simos.sigma)\
**Post date:** [February 19, 2022, 2:25pm UTC](https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675/11 "2022-02-19T14:25:39Z")

</div>

Oh okay… In my case named “default” and it is signed in as a Firefox account!!! And I think maybe this is the reason why script can’t finish with my default profile…

 ![Untitled-3](https://europe1.discourse-cdn.com/katalon/original/3X/b/0/b0f97ed830f05a557c53107cbc06dd2a58ff39a7.jpeg)

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [February 19, 2022, 2:29pm UTC](https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675/12 "2022-02-19T14:29:47Z")

</div>

> [@simos.sigma](#):
>
> In my case named “default” and …

Perhaps, the _default_ profile doesn’t have any string name.

---

<div class="post-metadata">

**Author:** ![simos.sigma](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/simos.sigma/32/19248_2.png) [@simos.sigma](https://forum.katalon.com/u/simos.sigma)\
**Post date:** [February 19, 2022, 2:35pm UTC](https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675/13 "2022-02-19T14:35:03Z")

</div>

Υes this is really possible but if I rename it, doesn’t get one? Because I also tried to rename it to “Simos Sigma” and then I tried the script with this new name `FirefoxProfile FF = profile.getProfile("Simos Sigma")` but again, nothing. Keep saying `Running` without do something.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [February 19, 2022, 2:41pm UTC](https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675/14 "2022-02-19T14:41:19Z")

</div>

Sorry, I do not know much about firefox.

---

<div class="post-metadata">

**Author:** ![simos.sigma](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/simos.sigma/32/19248_2.png) [@simos.sigma](https://forum.katalon.com/u/simos.sigma)\
**Post date:** [February 19, 2022, 2:44pm UTC](https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675/15 "2022-02-19T14:44:31Z")

</div>

Okay thank you very much for your time!!!

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [February 19, 2022, 4:37pm UTC](https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675/16 "2022-02-19T16:37:41Z")

</div>

What happens if you set “For Katalon” as the default?

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/f/5/f539ed57643d25039f0e8ac4cc91541a050b6ec7.png)

---

<div class="post-metadata">

**Author:** ![simos.sigma](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/simos.sigma/32/19248_2.png) [@simos.sigma](https://forum.katalon.com/u/simos.sigma)\
**Post date:** [February 19, 2022, 6:37pm UTC](https://forum.katalon.com/t/error-when-i-try-to-run-my-script-in-firefox-with-a-specific-non-anonymous-profile/62675/17 "2022-02-19T18:37:34Z")

</div>

I tried that too… And still, default (by the name) profile keep saying `Running` and after some time gives this error:

```auto
Test Cases/*** FAILED.
Reason:
java.lang.OutOfMemoryError: Java heap space
	at org.openqa.selenium.io.Zip.zip(Zip.java:46)
	at org.openqa.selenium.firefox.FirefoxProfile.toJson(FirefoxProfile.java:362)
	at org.openqa.selenium.firefox.FirefoxOptions.asMap(FirefoxOptions.java:364)
	at org.openqa.selenium.MutableCapabilities.<init>(MutableCapabilities.java:48)
	at org.openqa.selenium.firefox.FirefoxDriver.dropCapabilities(FirefoxDriver.java:257)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:147)
    ...
	at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
	at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:442)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:433)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:412)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:404)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:281)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:142)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:133)
	at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)

```

I also noticed that as much as I load with addons the new profile (For Katalon) the longer it takes to open and run the script!!! Maybe the default (by the name) profile it’s late to open because it has to load too many things? And in the end it gives this error due to timeout or something?
