What's the best way to use Selenium PageObject Design Pattern

后端 未结 3 544
长情又很酷
长情又很酷 2020-12-12 16:34

I\'m creating tests using Selenium 2 Web Driver with C#.Net. After reading through a lot of the Selenium documentation, I am left still feeling unsure on how to go about tes

3条回答
  •  佛祖请我去吃肉
    2020-12-12 17:13

    I would avoid the Asserts in the tests and stick with the LoginPage.signIn method, which will throw an exception in case of unsuccessful login. I'm not familiar with NUnit but I guess it supports the 'expected to fail' behavior.

    It's better to keep your page-dependent logic in one place(the page class).

    I guess you'll have to modify the web UI tests a lot as the main app evolves anyway.

提交回复
热议问题