I am using Visual Studio for preparing a开发者_运维技巧nd exucute WatiN scripts using Visual Studio (Test Project).
My approach was to create one method of each step and execute, but now i am facing the problem in ordering these methods.
For example:
1) Test Method 1: To login 2) Test Mehod 2 : To perform a search 3) Test Method 3: To verify the search 4) Test method 4: Log out
But while running script, the methods are exucuted in random order and the scripts fails.
Can anyone kindly suggest me what is the best approiach for executing watiN scripts with Visual Studio?
-- Best Regards, Kumar.
Unit tests should be written to execute on their own and not be dependent on other tests. I know this seems like a lot of duplication but you need to be able to run a test on it's own.
The only thing you can do is to use the setup and teardown methods, which are executed before and after each test, in order to simplify some of the setup.
精彩评论