Using Selenium 2 / Web Driver with C #

I recently studied using Selenium 2 / webdriver for some automated web tests. The API looks great. However, you can record the test through the selenium IDE and generate C # code for webdriver. I found some Java formatter but cannot find them for C #.

While the test IDE Export As / C # test runs, the code that it creates is not the new Selenium2 / WebDriver API for the previous Selenium 1 / RC.

+4
source share
4 answers

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

This option is called C # (NUnit) - WebDriver support .

Export Test Case As ... submenu

+3
source

If you are comfortable using the API, I would suggest leaving the IDE behind you. Whatever generator you find, at some point it will create an uncontrollable mess. I would suggest taking a look at the selenium design template at http://code.google.com/p/selenium/wiki/DesignPatterns . For example, pagefactory makes it easy to quickly make pages accessible by properties, and you will do it in a repair.

testcode is much easier to reorganize to supported code, while it is much harder to record test files in selenium IDE

+1
source

Maybe I don’t understand something, but Selenium IDE 1.0.10 in the "Parameters / Format" section has an entry for C #, which converts the IDE test to C # format.

-1
source

1. There is a plugin that can convert selinium 1 scripts to java webdrive. Unfortunately, it is argued that the current C # implementation is incomplete. I think I'm just using Java.

-2
source

Source: https://habr.com/ru/post/1343132/


All Articles