1
votes

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

3

3 Answers

2
votes

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.

1
votes

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

0
votes

Try to use selenium.start() before any other command. And obviously open some page before doing selenium.type()

Note: Some commands. like takescreenshot still might not work.