python - Force selenium to use the portable firefox application -


i have installed firefox 14 , has firefox portable version 25.0.1 on machine, run tests web site.

due limitation in site i'm testing, cannot run tests on firefox 14 installation. cannot upgrade firefox 14 installation.

so i'm looking solution can use portable firefox version instead of installed firefox 14 version.

how should force selenium use portable version , not installed version? if direct me descriptive article/blog great.

my code goes like:-

* variables *

${selenium_hub}     remote_url=http://127.0.0.1:4444/wd/hub ${browser}      firefox d:\\firefox portable\\firefoxportable\\firefox.exe ${client_url}       https://abcd.aline.local  open browser    ${client_url}    ${browser}   ${selenium_hub} 

specifying path as, d:/firefox portable/firefoxportable/firefox.exe not work because '/' get's removed. thoughts?

ps: python used language

you can specify path firefox binary want firefoxbinary class passed firefox_binary parameter when instantiating firefox webdriver.

http://selenium.googlecode.com/svn/trunk/docs/api/py/webdriver_firefox/selenium.webdriver.firefox.firefox_binary.html

and

http://selenium.googlecode.com/svn/trunk/docs/api/py/webdriver_firefox/selenium.webdriver.firefox.webdriver.html#module-selenium.webdriver.firefox.webdriver

make sure path binary correct like:

from selenium import webdriver selenium.webdriver.firefox.firefox_binary import firefoxbinary  firefox_binary = firefoxbinary("d:\\firefox portable\\firefoxportable\\firefox.exe") driver = webdriver.firefox(firefox_binary=firefox_binary) 

using robotframework like:

${firefox_binary}=  evaluate    sys.modules['selenium.webdriver.firefox.firefox_binary'].firefoxbinary("d:\\firefox portable\\firefoxportable\\firefox.exe")    sys, selenium.webdriver.firefox_binary create webdriver    firefox    firefox_binary=${firefox_binary} 

may work.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -