FAQ
We have Hudson running on a Solaris box and we have Selenium Server
Standalone 2.9.0 running on an XP box. Which means the Selenium code is
executed on Solaris. All day long I can get IE running across the network
(Selenium Server Standalone in between) or Firefox running from Windows to
Windows (with Selenium Server Standalone in between) but Firefox from Unix
to Windows is killing me.

I've seen this<https://groups.google.com/forum/#%21topic/selenium-users/mWSHr9nWDck>and I've seen
this<http://stackoverflow.com/questions/5485709/selenium-server-not-starting-for-for-custom-firefox-profile>but I still can't get it to work. I've seen variations on how to create a
FirefoxProfile instance... FirefoxProfile fp = new
ProfilesIni().getProfile("profileName") or even just FirefoxProfile = new
FirefoxProfile(). I've seen DesiredCapabilities instances created a couple
different ways as well... DesiredCapabilities dc = new
DesiredCapabilities() to DesiredCapabilities dc =
DesiredCapabilities.firefox(). It gets a little confusing as to which was
is best.

Bottom line is every way that I try to create a FirefoxProfile instance
seems to leave me with a null reference (only when run from Solaris to
browsers located on Windows.) Recently I saw the second link above where
you can direct Selenium Server Standalone to which profile it uses
seemingly taking that out of the test code. So I was hoping that new
FirefoxProfile() without mentioning profile directory in the constructor
would suffice. Still not working for me.

Please help me tweak my code to get Unix to Windows running. Here is what
I have so far (forgive any mistypes, I don't have copy/paste capabilities
directly from my code)...

DesiredCapabilities dc = DesiredCapabilities.firefox();
FirefoxProfile fp = newProfilesIni().getProfile("SeleniumProfile");
//also tried
//FirefoxProfile fp = new FirefoxProfile();
//also tried
//FirefoxProfile fp = new FirefoxProfile("C:\custprofiles");
fp.setEnableNativeEvents(true); //See first link I gave above for where I
found this
dc.setCapability(FirefoxDriver.PROFILE, fp);
dc.setJavascriptEnabled(true); //added this because at one point saw
errors reading in JS files or something
WebDriver wd = new RemoteWebDriver(new URL("http://blah:4444/wd/hub", dc));
...


Also, start up of Selenium Server went from
java -jar selenium-sever-standalone-2.9.0.jar
to
java -jar selenium-sever-standalone-2.9.0.jar -firefoxProfileTemplate
"C:\customprofiles"
after reading the link I gave above.


Again, can't copy/paste from private network to here but the error is I
can't get a FirefoxProfile instance created.

Any help will surely be appreciated. TIA



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/yQ1TPwgHjqEJ.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Search Discussions

  • Jojeeka at May 31, 2012 at 6:16 pm
    Forgot to add that when I try to create a FirefoxProfile instance by giving
    a (Windows) directory name to the constructor it comes back with, "Given
    model profile directory does not exist: C:\customprofiles"


    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/uaixQks0caIJ.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
  • Jojeeka at May 31, 2012 at 7:04 pm
    I was incorrect on the fact that FirefoxProfile fp = new FirefoxProfile()
    returned null. So, what makes it hard for me to debug is that our Hudson
    server running the Selnium tests isn't time sync'd with our SVN server.
    Which means when I check in code to fix the Selenium tests it won't be
    picked up right away (even with Hudson set to clean workspace and check out
    instead of update.) Sorry.

    What does happen with using no parameter constructor above is the browser
    starts up and then crashes (goes away right away.) That is better than
    null pointer or directory not found I was getting before. I feel I am
    close.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/3NeYyDedw_UJ.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
  • Jojeeka at Jun 1, 2012 at 2:02 am
    Wow! What a bear this is turning out to be. Here is where I am so far...

    1. With my original code the browser was starting up and then going down
    instantly.
    2. As I might have mentioned before... Windows test cases to Selenium
    Server Standalone running on Windows then
    FirefoxProfile fp = new ProfilesIni().getProfile("someName");
    works but Solaris test cases to Selenium Server Standalone running on
    Windows doesn't.
    3. FirefoxProfile fp = new FirefoxProfile()... doesn't work without a
    directory sent to the constructor
    which means I don't know how Tobias got it working with no constructor
    here <https://groups.google.com/forum/#%21topic/selenium-users/mWSHr9nWDck>.
    4. I saw in the debugger that the only different between the two
    instantiations above is that the prior has a model directory set
    and the latter doesn't.
    5. FirefoxProfile fp = anyway you get a profile instance is running 100% on
    my Solaris side. So the profile has to exist in some
    way on the Solaris box for things to work. That's what I am seeing.
    I.e. if the test cases are running from Solaris to control
    browsers on Windows the profile stuff is before the RemoteWebDriver
    code takes effect therefore profile "stuff" must exist
    on Solaris.
    6. So I copied my Windows profile dir into my code base and checked it in
    so it would exist on the Solaris box. Then had
    FirefoxProfile fp = new FirefoxProfile(new
    File("directory/checked-in/profile"))
    7. This stopped the browser from going down instantly.
    8. But the tests seem to not be able to click buttons.


    Bottom line there is something I am not doing or there is some magic I
    don't have that allows Firefox profile info to be seemlessly used from
    Solaris to Windows (with Selenium Server Standalone in between) that others
    seem to have as in the link I just gave where new FirefoxProfile() just
    works from Unix to Windows with no mention of special profile copying or
    Selenium Server parameters, etc.

    Man this has been a bear! Anyone see what I am missing?

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/jPrnyQOxB3cJ.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
  • Mike Riley at Jun 1, 2012 at 4:59 pm
    This is just a guess, but I think it is possible the profile under Windows
    is not the same as the profile under Solaris. The Solaris one is built by
    the group in Beijing and doesn't match the configuration for menu under
    Windows, so the profile may not match either.

    How about saving the profile you want to use on Solaris by running Firefox
    on Solaris and then saving it as a unique file on your Windows box that is
    running the test? That way you are using a profile created by the browser
    that will use it. I save unique profiles for each major version of FF
    under Windows and I would do the same thing for each OS.

    Right now they sit in directories called FirefoxProfile-# (where # is the
    major version number). If I had to support multiple OS platforms I would
    create a subdirectory for each OS platform under the FirefoxProfile-#
    directory (or vice-versa) to keep those grouped by OS platform.

    Mike
    On Thursday, May 31, 2012 7:02:20 PM UTC-7, Jojeeka wrote:


    Wow! What a bear this is turning out to be. Here is where I am so far...

    1. With my original code the browser was starting up and then going down
    instantly.
    2. As I might have mentioned before... Windows test cases to Selenium
    Server Standalone running on Windows then
    FirefoxProfile fp = new ProfilesIni().getProfile("someName");
    works but Solaris test cases to Selenium Server Standalone running on
    Windows doesn't.
    3. FirefoxProfile fp = new FirefoxProfile()... doesn't work without a
    directory sent to the constructor
    which means I don't know how Tobias got it working with no constructor
    here<https://groups.google.com/forum/#%21topic/selenium-users/mWSHr9nWDck>
    .
    4. I saw in the debugger that the only different between the two
    instantiations above is that the prior has a model directory set
    and the latter doesn't.
    5. FirefoxProfile fp = anyway you get a profile instance is running 100%
    on my Solaris side. So the profile has to exist in some
    way on the Solaris box for things to work. That's what I am seeing.
    I.e. if the test cases are running from Solaris to control
    browsers on Windows the profile stuff is before the RemoteWebDriver
    code takes effect therefore profile "stuff" must exist
    on Solaris.
    6. So I copied my Windows profile dir into my code base and checked it in
    so it would exist on the Solaris box. Then had
    FirefoxProfile fp = new FirefoxProfile(new
    File("directory/checked-in/profile"))
    7. This stopped the browser from going down instantly.
    8. But the tests seem to not be able to click buttons.


    Bottom line there is something I am not doing or there is some magic I
    don't have that allows Firefox profile info to be seemlessly used from
    Solaris to Windows (with Selenium Server Standalone in between) that others
    seem to have as in the link I just gave where new FirefoxProfile() just
    works from Unix to Windows with no mention of special profile copying or
    Selenium Server parameters, etc.

    Man this has been a bear! Anyone see what I am missing?
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/mpLhd6alNWkJ.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
  • Jojeeka at Jun 1, 2012 at 5:50 pm
    Hi Mike. Thanks for the reply...

    So I did basically what you are saying. I took my Windows profile (where
    the browsers will run) and checked it in (the whole profile directory) so
    that the code running on Solaris would see that when it ran. It got me
    along farther. Prior to doing that Firefox would open close instantly.
    After doing that the browser stayed up but would not click buttons. I'm
    going to look for the buttons not being clicked in the archives as well to
    see if I just need to do something else to get past that.

    Thanks again.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/dNicFdduorYJ.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
  • Jojeeka at Jun 1, 2012 at 6:50 pm
    Mike, few other questions...

    1. If the standalone has the ability to be started with the
    -firefoxProfileTemplate argument then why does the code have to have a
    FirefoxProfile specified at all?
    java -jar selenium-sever-standalone-2.9.0.jar -firefoxProfileTemplate
    "C:\customprofiles"

    2. Is there a link to the valid arguments that can be be passed to Selenium
    Server Standalone on the command line?
    If not, what are the valid arguements?

    3. Is there a link to the valid preferences that can be set with
    profile.setPreferences("key","value") ?
    If not, what are the valid preference key names?

    Thanks again!

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/0dGCmUl16EEJ.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
  • Mike Riley at Jun 1, 2012 at 7:12 pm
    Answers below:
    On Friday, June 1, 2012 11:50:16 AM UTC-7, Jojeeka wrote:


    Mike, few other questions...

    1. If the standalone has the ability to be started with the
    -firefoxProfileTemplate argument then why does the code have to have a
    FirefoxProfile specified at all?
    java -jar selenium-sever-standalone-2.9.0.jar -firefoxProfileTemplate
    "C:\customprofiles"
    It doesn't. This is an either-or case where if you don't do it one way you
    can do it the other. Also, I think the code would override whatever the
    server was invoked with, so you can specify a default for the server, but
    change it to be something else for special cases.

    2. Is there a link to the valid arguments that can be be passed to
    Selenium Server Standalone on the command line?
    If not, what are the valid arguements
    I know I have seen it listed somewhere, but try running it with an illegal
    option, like -help and you will get a list of them.

    3. Is there a link to the valid preferences that can be set with
    profile.setPreferences("key","value") ?
    If not, what are the valid preference key names?
    Not anywhere that I know of, except probably in the source code.

    Thanks again!
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/0B1Kv-qm2CQJ.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
  • Jojeeka at Jun 1, 2012 at 7:54 pm
    Looking at my tests again I think I actually got it working when I copied
    the Windows profile into my code base a few posts ago. I did that last
    night but didn't realize it was working completely because I was running a
    test someone else created that all it did was log in and close the browser
    (I was looking for more.) What also threw me off was no matter what
    (successful test or not) Firefox shows a nasty popup after it closes.
    Memory error or something.


    BTW, I don't think the profile setup in either code or server is true. I
    tried to set it up in the standalone server but include no profile in code
    and it didn't work. That would be optimal! If you can tell the sever
    which profile you shouldn't have to set up the code to know anything about
    profiles (just which browser.)

    Anyway. I am happy that it is working! Thanks for the replies!

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/8nUWzX1GxpcJ.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-users @
categoriesselenium
postedMay 31, '12 at 6:07p
activeJun 1, '12 at 7:54p
posts9
users2
websiteseleniumhq.org

2 users in discussion

Jojeeka: 7 posts Mike Riley: 2 posts

People

Translate

site design / logo © 2022 Grokbase