Re: Not able to open browser with customize firefox profile

2,234 views
Skip to first unread message

kaprikorn07

unread,
Sep 3, 2012, 1:08:15 AM9/3/12
to robotframe...@googlegroups.com

Hi Chan,


I think that is not the right way to do it. It should be like this:

 Start Selenium Server-firefoxProfileTemplate/path/to/the/profile

Then you do:  Open browser  <url> 

Best regards!

chan

unread,
Sep 3, 2012, 8:53:59 AM9/3/12
to robotframe...@googlegroups.com
Hi,

Thanks for the reply. The approach you mention is for SeleniumLibrary.
I was trying to run a script that import Selenium2Library.

However, I have created another set of test script that import SeleniumLibrary and follow the way you suggested but the test still not able to launch the firefox browser with custom profile. I think it keep launching the browser with the default profile where the new window will not be open in new tab.

I came across this reply from selenium: http://code.google.com/p/selenium/issues/detail?id=1516

Do you know if there's any other way that can solve this problem? I am using Windows 7.

For Selenium2Library, I am able to change the prefs.js of the profile bundled together with the library and able to launch new window in new tab. The problem is, I am not able to use other cutom firefox profile.

Thanks,

Ho Sang

Vara

unread,
Feb 18, 2013, 4:26:46 AM2/18/13
to robotframe...@googlegroups.com
Could any body found the solution to following issue
- Opening Browser on custom firefox profile
 
Thanks,
Vara

Tatu aalto

unread,
Feb 18, 2013, 11:52:43 AM2/18/13
to bonamva...@gmail.com, robotframe...@googlegroups.com

Ugh

I use quite often custom FireFox profile, but in Linux. As far I can remember, it works as documented (do not have test case now at hand and profile is quite deep in lower level keywords).

But I do remember that escape character's could be tricky, specially in windows. But without seeing you test case it is hard say more

-Tatu

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Tatu Aalto

unread,
Feb 19, 2013, 4:39:17 AM2/19/13
to varaprasad bonam, robotframework-users
Ugh

I did try it in windows, with similar code:
*** Settings ***
Library           Selenium2Library

*** Test Cases ***
bar
    Open Browser    https://www.google.fi/    ff    ff_profile_dir=C:\\tmp\\default\\
    Sleep    2
    [Teardown]    Close All Browsers


And for me, it works OK. The default directory contains a copy of my own windows profile (containing all the .sqlite, .ini and so on files). I did modify the windows size and when using the profile, I did see that RF open Firefox with the same size window.  

I though that for Firefox, one could enable debug log from webdriver, but I did not find anything like this. Best that I can offer, is that I see this from the RF debug file:
+-- START KW: Selenium2Library.Open Browser [ https://www.google.fi/ | ff | ff_profile_dir=C:\\tmp\\default\\ ]
Opening browser 'ff' to base url 'https://www.google.fi/'
POST http://127.0.0.1:50758/hub/session {"sessionId": null, "desiredCapabilities": {"platform": "ANY", "browserName": "firefox", "version": "", "javascriptEnabled": true}}
POST http://127.0.0.1:50758/hub/session/0b5a3ed2-6e81-44ef-bf26-f7e76db2817e/timeouts/async_script {"sessionId": "0b5a3ed2-6e81-44ef-bf26-f7e76db2817e", "ms": 5000.0}
POST http://127.0.0.1:50758/hub/session/0b5a3ed2-6e81-44ef-bf26-f7e76db2817e/timeouts/implicit_wait {"sessionId": "0b5a3ed2-6e81-44ef-bf26-f7e76db2817e", "ms": 0.0}
POST http://127.0.0.1:50758/hub/session/0b5a3ed2-6e81-44ef-bf26-f7e76db2817e/url {"url": "https://www.google.fi/", "sessionId": "0b5a3ed2-6e81-44ef-bf26-f7e76db2817e"}
Opened browser with session id 0b5a3ed2-6e81-44ef-bf26-f7e76db2817e
+-- END KW: Selenium2Library.Open Browser (13253)

-Tatu

On 19.2.2013 10:15, varaprasad bonam wrote:
Below is the code i am using..
 
*** Settings ***
Library    Selenium2Library
 
*** Test Cases ***
Simple Test FF
 Open Browser 
http://google.com  ff ff_profile_dir=D:\\FFProfile\\
 
Thanks,
VaraPrasad

sourabh saini

unread,
Jul 16, 2014, 6:44:12 AM7/16/14
to robotframe...@googlegroups.com, bonamva...@gmail.com
Hi,

I am facing the same issue, its not working. Have you got it resolved?


Regards,
Sourabh Saini
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.

Tatu Aalto

unread,
Jul 16, 2014, 12:26:29 PM7/16/14
to sourab...@gmail.com, robotframework-users, bonamva...@gmail.com

Ugh

It should work OK, because I use ff profile on daily basis. Could you share example that can be run and shows the problem?

-Tatu
Send from my mobile

To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.

To post to this group, send email to robotframe...@googlegroups.com.

sourabh saini

unread,
Jul 17, 2014, 12:10:47 AM7/17/14
to Tatu Aalto, robotframework-users, bonamva...@gmail.com
Hi,

The code I am using is below,

Open Local Browser
[Arguments]    ${browser}=ff
 Open Browser    ${IONWEBLOCALURL}#user=${IONWEBUSER}&pwd=${IONWEBUSERPASSWORD}&workspace=${IONWEBWORKSPACE}    ${browser}    ff_profile_dir=D:\\firefoxprofile\\saini\\

I am using this on OS: windows7, Browser: FireFox 29.01

Regards,
Sourabh Saini

Tatu Aalto

unread,
Jul 17, 2014, 2:10:26 AM7/17/14
to sourabh saini, robotframework-users, Varaprasad Bonam

Ugh

Without seeing inside of the variables, I would guess that it is #-character in the URL. #-character is a special character and you need to escape it. User guide explain this [1].

-Tatu
[1] http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#escaping
Send from my mobile

Jerison Joy

unread,
Jul 17, 2014, 2:17:16 AM7/17/14
to aalto...@gmail.com, sourabh saini, robotframework-users, Varaprasad Bonam
And my guess is the backslashes(\\)used in the ff_profile definition. 

 ff_profile_dir=D:\\firefoxprofile\\saini\\

I have used below code and it works fine:

${FF_PROFILE} D:/Automation/FFProfile


Open Browser ${loginUrl} ${browser} ff_profile_dir=${FF_PROFILE}

Thanks,
Jerry

Tatu Aalto

unread,
Jul 17, 2014, 4:36:33 AM7/17/14
to Jerison Joy, robotframework-users, sourabh saini, Varaprasad Bonam

Ugh

And that guess is wrong. \\ is a proper way to express folder separators in the windows world. This is also explained in link I did post.

-Tatu
Send from my mobile

Reply all
Reply to author
Forward
0 new messages