views:

110

answers:

3

Hi,

I am trying out WebDriverBacked selenium. I used the below code. But, it gives me "System.NotSupportedException : command" exception.

IWebDriver driver= new FirefoxDriver(); Selenium.WebDriverBackedSelenium selenium= new WebDriverBackedSelenium(driver,myUrl); selenium.Type(locator,value);

Here the command gets replaced by any selenium statement I execute after instantiation. I've written "Type" just as an example. I throws exception at any selenium command.

I'm using c# for RC. Can someone point out, where I'm going wrong over here?

Thanks,
Vamyip

+1  A: 

The C# implementation of Selenium Emulation is behind the Java one however from the source code it seems that Type method is implemented.

Are you porting your existing Selenium tests to the WebDriver? If you are staring new tests from the stretch you do not need the Selenium Emulation and should use WebDriver methods

ZloiAdun
Actually, we have a lot of scripts written in the older version. We're are facing some issues with the way Alerts and Confirmations are handled in older version. Hence, I'm checking out Selenium 2 to find out that how many changes do we require to transfer the older scripts to the newer version. Thanks for quick reply.
vamyip
+2  A: 

The .net version of Webdriver (Selenium 2) does not have WebDriverBackedSelenium implemented yet. Also Webdriver doesn't handle Alerts right now. A defect has been written and I believe FirefoxDriver code is almost done.

If you want to convert the code from Selenium to Webdriver you will need a complete rewrite since the API is different.

Example to click in Selenium:

driver.Click("id");

While in Webdriver it's:

driver.FindElement(By.Id("id")).Click();

Also Webdriver is missing some of the features in Selenium, such as istextpresent and doubleclick.

Reflux
A: 

I'm am also experiencing this. I was wondering if you ever found a solution. The web is extremely quiet on this issue.

Thanks...

bluetoft