Several colleagues asked me what I think about Selenium. Selenium has, similar to many tools, advantages and disadvantages and any advice can only be given context specific.
Jonathan Benn has compiled the following list of good reasons for using selenium for testing in an internal blog:
These are all valid reasons for using selenium, especially for end-to-end testing scenarios. However, the authors of How Google Tests Software state: “But overinvesting in end-to-end test automation often ties you to a product’s specific design and isn’t particularly useful until the entire product is built and in stable form. And it’s still browser testing. It’s slow, you need hooks in the API, and tests are pretty remote from the thing being tested.” [How Google Tests Software]. Furthermore we’ve observed that it’s rather inefficient if there are people that write only tests while others are doing the coding without eating their own dog food. Therefore we thought about an alternative, avoiding these disadvantages.
Testing apps with JavaScript based tools, on the other hand, has benefits and this brings OPA5 into play: OPA5 is an extension for SAPUI5 controls developed by Tobias Oetzel. It hides asynchronity and eases access to SAPUI5 elements. This makes OPA5 especially helpful for testing user interactions, integration with SAPUI5, navigation, and data binding:
The OPA5 library is JavaScript based, meaning that you can write your tests in the same language in which your app is written. This has the following advantages:
Developer writes tests along with developing the app, thus ensuring from the beginning that the app is testable. This is important from a testability point of view, whereas having people writing tests while others do the coding without writing automatic tests is rather inefficient. TDD results in less fragile tests, because the app is better isolated and supports less fragile APIs for testing.
It is very easy to write acceptance tests with OPA5 – Give it a try! It is already used by many developers inside of SAP.
What you currently should not or cannot do with OPA5:
How Google Tests Software, James Whittaker, Jason Arbin, Jeff Carollo, 2014
The documentation visible outside of SAP will be improve, so stay tuned. https://openui5beta.hana.ondemand.com/docs/guide/22f175e7084247bc896c15280af9d1dc.html
MockServer: https://help.sap.com/saphelp_uiaddon10/helpdata/en/41/5d1fc8cc154cb189809d3cb9747165/content.htm
Arrange Act Assert and Given When Then:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
10 | |
10 | |
10 | |
8 | |
7 | |
7 | |
7 | |
7 | |
6 |