Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top