Write TestCases using PageFactory (Selenium-WebDriver). Advantages? [closed]

。_饼干妹妹 提交于 2019-12-08 09:27:24

问题


Is it a good practice to go the PageFactory way when writing testcases in Selenium2? If yes why?

To be frank I have never used them when writing test-cases and have not missed it either. But I would to know what are the advantages of using PageFactory over not using it.


回答1:


From my point of view the advantages are on the one hand, all the ids and xpaths at only one place in code, on the other hand the abstraction layer between the implementation an the test itself.

This will allow non- programmers to test the websites what's useful for me, because some people know exactly what the workflows are and which functionality is the most important but are not part of the development teams or engineers at all.

Last but not least, the PageFactory term is quite useful.

Based on these reasons we decided to switch from over 500 Selenium 1 testcases to Selenium 2 with PageObjects. And try to compensate the effort of creating POs, which will surely exceed the effort for std test executions, by increased maintainability, usability and scalability



来源:https://stackoverflow.com/questions/12140344/write-testcases-using-pagefactory-selenium-webdriver-advantages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!