2

I have coded a simple test in visual studio using selenium which works in Firefox. However, I'm trying to run the same test on multiple browsers but I keep getting the same error that the drivers are not found in the directory or the PATH environment variable. I have them downloaded and they are in the project I am working on. I've been trying all the different ways that I have found but nothing is working. Can anyone help with this? Thanks :)

Here's a snippet of the code:

using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Support.UI;



namespace SeleniumTest2
{

    //1 test multiple browsers
    [TestFixture(typeof(ChromeDriver))]
    [TestFixture(typeof(FirefoxDriver))]
    [TestFixture(typeof(InternetExplorerDriver))]


    public class ClickTestMetaLearning3TestUser<TWebDriver> where TWebDriver : IWebDriver, new()
    {
        private IWebDriver driver;
        private StringBuilder verificationErrors;
        private string baseURL;
        private bool acceptNextAlert = true;

        [SetUp]
        public void SetupTest()
        {

            this.driver = new TWebDriver();
            //Runtime.getRuntime().exec("RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255");
            baseURL = "http://url";
            verificationErrors = new StringBuilder();
}
leppie
  • 115,091
  • 17
  • 196
  • 297
DaBradley
  • 43
  • 1
  • 8
  • already a thread present for IE driver - http://stackoverflow.com/questions/11010317/iedriverserver-does-not-exist-error-during-running-selenium-test-with-c-sharp . more information can be found here - http://www.qaautomation.net/?p=373 – Rabi Aug 06 '14 at 10:00

1 Answers1

0

We have had to explicitly tell the ChromeDriver where it is located when constructing it :

_chromeDriver = new ChromeDriver(@"<path to the chromedriver.exe");
  • I've done that but it's saying that it doesn't exist but its the exact path to the file with the file name included – DaBradley Aug 06 '14 at 10:52
  • 1
    We have only specified the path, dont include "chromedriver.exe" in the string – mark.oliver.asp.newbie Aug 06 '14 at 11:01
  • How would you go about implementing that into the TWebDriver? Or what way would you call it so that all browsers are tested within the test – DaBradley Aug 06 '14 at 12:36
  • We have a class that is responsible for creating an instance of each browser type we want to use (Firefox/Chrome/Safari), and then in EVERY test we have a foreach loop that runs the same test for every browser supplied to it.. – mark.oliver.asp.newbie Aug 07 '14 at 11:47