4

I have recently been looking at using Selenium 2 / webdriver for some automated web tests. The API looks great. However is it possible to record a test through the selenium-IDE and generate C# code for webdriver. I have found some Java formatters, but can't find anyway to do this for C#.

Whilst the IDE's Export Test Case As/C# works, the code it generates is for the previous Selenium 1/RC not the new Selenium2/WebDriver API.

4 Answers 4

3

In the newer versions of Selenium IDE this option now exists under File > Export Test Case As...

The option is called C# (NUnit) - WebDriver Backed.

Export Test Case As... submenu

Sign up to request clarification or add additional context in comments.

Comments

1

If you're comfortable using the API i would suggest leaving the IDE behind you. Whatever generator you will find, at some point it will generate an unmanageable mess. I would suggest to take a look at the selenium design pattern at http://code.google.com/p/selenium/wiki/DesignPatterns . For instance the pagefactory makes it pretty easy to quickly make pages accesible through properties and you will be doing so in a maintainable manner.

testcode is far more easy to refactor into maintainable code, whereas this is far more difficult for recorded testcases in selenium IDE

Comments

-1

Maybe I'm misunderstanding something but Selenium IDE 1.0.10 under Options / Format has an entry for C# which will convert the IDE test to C# format.

1 Comment

Yes indeed but for the Selenium 1.0 API. There is nothing I can find which will generate the equivalent for the Selenium 2 / Webdriver API.
-2

1.There is a plugin that can convert selinium 1 scripts to webdrive java. Unfortuantely it is claimed that the current implementation of C# is incomplete. I think I will just use Java instead.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.