When creating UI automated tests our main goal is to always simulate environment as close to the real one as possible. As you may all know simulating typing in an input has always been a pain when working with Selenium.
In fact ‘pain’ is an understatement. There are scenarios which cannot be simulated at all with Selenium due to the fact that some client events of the control are not executed when they should. This is an indication that something is very wrong with the whole simulation as we are not getting the results which are observed when a real user is actually working with the input control. Things can get even worse if you add different browsers in the equation.
All the above explains why back in the times when we used exclusively Selenium for automated testing of our controls, we had a simple custom command which used the client-side API of RadInput to set values in the control. That way we could avoid all the peculiarities of Selenium’s typing simulation. About a year ago when we started working on the WebUI Test Studio translators we kept that approach as it had proved to be reliable. What the 1.1 version of the testing tool actually does is capture the typed text and on execution simply pass the typed string to the set_value() client-side method of the control. This approach has its merit as it is fast and allows the testing of the client-api in various scenarios.
However, now we are striving for more real-world simulation, one that will be required in most cases when populating RadInputs in our tests. Thus we decided that the release of the 2.0 version of our test automation tool is the perfect time to introduce such a change.
The new verdict
The WebAii framework offers tremendous versatility in this area. It is just great at simulating things and the text typing is so reliable that there is no reason to stay away from it. That’s why we decided it will be cool to update the Input’s wrapper API with a text typing method and we now use that in our Action descriptor. Your old tests of course, will continue to execute the old code. The only change you’ll notice when recording new tests is that you need to actually blur the control (a simple tab from your keyboard should suffice) in order for it to update its value, which is what you do when you actually use the control.
I will now leave you to discover if the new WebUI TestStudio is real enough for you. Download trial and explore
Pavel