Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
sivaaprasadpadhy
Posts : 1
Join date : 2018-12-07
Age : 30
https://tekslate.com/selenium-training

Can I set the GeckoDriver path in selenium programatically when using node? Empty Can I set the GeckoDriver path in selenium programatically when using node?

Fri Dec 07, 2018 2:10 pm
I am trying to avoid using the path variable and would like to execute geckodriver from a local file.
For example I have this (Win64)...

Code:
- My Project
    - bin
        - geckodriver.exe

How can I tell mocha to use this bin file I am currently running mocha like this...

Code:
const {sync: globSync} = require("glob");

(async () => {
    await import("./Sanity.spec.mjs");
    await import("./site.spec.mjs");
    run();
})();


Any help here is appreciated.

Thanks
Siva Prasad
avatar
sureshprabhu1538
Posts : 2
Join date : 2019-01-08
Age : 31
Location : india
https://mindmajix.com/selenium-with-c-sharp-training

Can I set the GeckoDriver path in selenium programatically when using node? Empty Re: Can I set the GeckoDriver path in selenium programatically when using node?

Thu Jan 17, 2019 2:15 pm
First of all, you will need to download the latest executable gecko driver from the internet that will use the selenium

Actually, The Selenium client bindings try to locate the gecko driver executable from the system PATH. You will need to add the directory containing the executable to the system path.

On Unix systems you can do the following to append it to your system’s search path if you’re using a bash-compatible shell:

Code:
export PATH=$PATH:/path/to/directory/of/executable/downloaded/in/previous/step



On Windows, you will definitely need to update the Path system variable to add the full directory path to the executable gecko driver manually or command line(don't forget to restart your system after adding executable gecko driver into system PATH to take effect). The formula is the same as on Unix.

Now you can run your code same as you're doing as below

Code:
from selenium import webdriver

browser = webdriver.Firefox()
selenium.common.exceptions.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

Exception clearly informs that you have installed firefox some other location while Selenium is trying to find firefox and launch from default location but it couldn't find. You need to provide explicitly firefox installed binary location to launch firefox as below
Code:
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

binary = FirefoxBinary('path/to/installed firefox binary')
browser = webdriver.Firefox(firefox_binary=binary)


Thanks 
Suresh Prabhu
https://mindmajix.com/selenium-with-c-sharp-training
avatar
sona456
Posts : 7
Join date : 2018-12-20
https://crbtech.in/programmes/software-testing-training-programm

Can I set the GeckoDriver path in selenium programatically when using node? Empty Re: Can I set the GeckoDriver path in selenium programatically when using node?

Wed Feb 13, 2019 7:15 pm
This discussion got me lot of new information .
Sponsored content

Can I set the GeckoDriver path in selenium programatically when using node? Empty Re: Can I set the GeckoDriver path in selenium programatically when using node?

Back to top
Permissions in this forum:
You cannot reply to topics in this forum