Cannot launch Firefox with defined Firefox Profile

Hi,

I am automating a system which after the first logon does not ask for an OTP.
I want to leverage this in my automation. Hence, I created a user profile in Firefox and later trying to open firefox with the user profile by doing the following.

test_click_on_an_element
Selenium2Library.Open Browser ${url} ff ff_profile_dir=C:\Users\username\AppData\Local\Mozilla\Firefox\Profiles\profilepath
Maximize Browser Window

The profile was created using about:properties feature on Firefox.

But it always launches the browser on a new profile on the TEMP directory.

Kindly guide on how to resolve the issue.

Thanks.

Regards,
Susanta Kumar Patra

I think the problem is the path backslash, the \-character is an escape character in Robot Framework. To write literal , you escape it. Like: C:\Users\username\…

Please note than Selenium2Library is deprecated and you should migrate to SeleniumLibrary.

1 Like

Hi Tatu,

Many thanks for the reply.
I would definitely move back to SeleniumLibrary.

I am using double slash but while pasting it here it was auto changed to single slash.

I have also tried / before = e.g. “/=”. When doing the same it is giving an error that the folder is not found. “…/AppData/Local/Programs/Python/Python37/Lib/site-packages/SeleniumLibrary/resources/firefoxprofile”.

Kindly guide me to resolve the issue.

I am using,

Python 3.7
Robotframework - 3.2.1
SeleniumLibrary - 3.0.0a2

Thanks

regards,
Susanta

If you are using SeleniumLibrary 3.0, you should not use the alpha version, instead use the officially released version. Also the used Selenium version affects, I do not recall which Selenium version that version of SeleniumLibrary supports, because SeleniumLibrary 3.0 is about 5 years old.

The forward slash works also in Windows. Also the error comes from the operating system and is telling that operating system can not find the folder you defined. I think operating system is correct and you a bug in the path. But relative paths difficult and trying with full paths first is easier.