-1

Getting error as geckodriver.exe executable needs to be in PATH when running test runner file in robot framework

I have downloaded and added geckodriver path in executable path and system variable. But still facing the same.

As alternate way i tried same for chromedriver also, but still facing the same error

executable_path= "C:\New folder\geckodriver.exe"

enter image description here

I have followed whatever mentioned in,

Selenium using Python - Geckodriver executable needs to be in PATH

1 Answers1

1

If that's the way you're setting the location of the binary (python?), there's a small but easily fixable mistake - the backslash (\) is an escape character in most programming languages, and when you want to use it literally - you have to escape itself - \\

executable_path= "C:\\New folder\\geckodriver.exe"

Apart from that, what can I say, the webdriver really needs to be in the PATH of the user if you don't want to specify ts location explicitly :)

Open Command Prompt (win+R, type "cmd") and run geckodriver.exe - if it returns no executable with that name is found, then you have to fix the PATH variable for the current user; or move the exe to a dir that's already there.
If it is found though - are you running your automation with the same OS user?

And to get the current value of your path, in cmd type echo $PATH; the webdriver binaries must be in one the directories there to be found.

Todor Minakov
  • 19,097
  • 3
  • 55
  • 60
  • I tried following things also. 1. different slash i tried( /, \ , \\) 2. win+R, type "cmd") and run geckodriver.exe : getting geckodriver INFO 3. are you running your automation with the same OS user? : Im running with local machine using my own credential. Not a VM. Also i tried to set C:\New folder\chromedriver.exe and executed, getting error like, chromedriver needs to be in path. – Manoj Soundarrajan Jun 07 '23 at 07:05
  • 1
    geckodriver is not the same as chromedriver .. – rasjani Jun 07 '23 at 07:55
  • How to identify which from which location it takes the gecckodriver? i.e when we give GECKODRIVER in cmd window, it read from which location, how we can know? – Manoj Soundarrajan Jun 09 '23 at 01:33
  • I've ammended the answer to show how you can see your current path; `where geckodriver.exe` to answer your immediate question - will print you where is that file that _is_ found. – Todor Minakov Jun 09 '23 at 07:00