2

I'm new to Robot Framework, I have tried setting the path to the Firefox binary through Robot Framework without success. My goal is to parse the following python code:

from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

 binary = FirefoxBinary('c:\path\to\binary')
 driver = webdriver.Firefox(firefox_binary=binary)

with robot framework:

${firefox_path}=    Evaluate    sys.modules['selenium.webdriver'].firefox.firefox_binary.FirefoxBinary(firefox_path="C:\\Users\\xxx\\ff\\firefox.exe", log_file=None)    sys
Create WebDriver    Firefox    firefox_binary=${firefox_path}
Go to    www.google.fr

However when I run the above I get the following error message:

WebDriverException: Message: Expected browser binary location, but unable to
find binary in default location, no 'moz:firefoxOptions.binary' capability
provided, and no binary flag set on the command line         

Does anyone have any idea on how to fix my problem? Any help would be greatly appreciated, two days of trying to get Firefox to work.

Thanks, Nelly

6
  • can you share version of browser what you are using now? Commented Apr 28, 2017 at 12:03
  • I used firefox 52.0.2 installed version, and now I want to use the same version of firefox portable. Commented Apr 28, 2017 at 12:51
  • Please note that Firefox portable is not recommended (supported) by geckodriver. Instead of trying to set capabilities, why don't you try to set the PATH environment variable to find portable first? Commented Apr 29, 2017 at 19:21
  • I am aware that firefox portable is not recommanded.The path env variable runs fine for one firefox but I have several firefox portable versions on my machine Commented Apr 30, 2017 at 23:54
  • This looks correct to me as far as converting from Py to RF code. Have you tried doing it directly in Python? Commented May 1, 2017 at 16:24

1 Answer 1

1

I share with you one solution :

If you want to test Firefox Extended Support Release or portable Firefox, you just have to set the marionette to false

${firefox_path}= | Evaluate | sys.modules['selenium.webdriver'].firefox.firefox_binary.FirefoxBinary(firefox_path='C:\\Users\\xxx\\FirefoxPortable37\\FirefoxPortable.exe', log_file=None) | sys
${caps}= | Evaluate | sys.modules['selenium.webdriver'].common.desired_capabilities.DesiredCapabilities.FIREFOX | sys
Set To Dictionary | ${caps} | marionette=${False}
Create WebDriver | Firefox | firefox_binary=${firefox_path} | capabilities=${caps}
Go To | http://free.fr
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.