Saturday, 7 December 2019

The chromedriver.exe or geckodriver.exe file does not exist in Selenium

Selenium Driver Setup


If you are getting an error like "The chromedriver.exe file does not exist in the current directory"
or "geckodriver.exe does not exist"

Step 1:


For Chrome, open the URL mentioned below. Here you need to download chromedriver.exe
You can choose the latest version of this file.

For Firefox, open the URL mentioned below. Here you need to download geckodriver.exe

Step 2: 


After downloading the file, place the .exe file in your project under any directory. 
Note: Location choice is yours.
















Step 3: 


Specify the location in the code.








Step 4: 


If you are working on the console application then you can specify a generic path as shown in the snapshot below.


















Alternate and Easy Step


















Install the chrome driver only as mentioned in the snapshot below. You don't need .exe in this case.
Run the code as shown in the snapshot below















Note: You might get chrome version error. Make sure you have the latest chrome installed or update your browser.

It will open the browser successfully. In the above example, it will open the chrome browser.




Implement Authorization in Swagger with Static Value in Header .Net 8

If you want an anonymous user should not run the APIs. To run your API Endpoints From Swagger / Postman / Code the user should pass the head...