Use Selenium RC directly or Selenium with Robot platform

I must admit that I fell in love with Selenium for its recording and playback function, as well as for generating a test test for these recorded actions from the IDE. But I still do not dare to go to the implementation stage due to random details (for example, searching for events with the DOM, xpath..etc) that are embedded in the test file during recording, which can make the test test fail if there is an html change after import it into RC. I fully understand that this is part of the tasks of testers in order to adjust the expected results from time to time as part of the regression test, but I also do not want the time spent on this to be more than the time spent on a manual test,

As far as I know, Selenium with the Robot frame takes the form of keywords of test files. I suppose this allows us to extract random details into various keywords, which could facilitate the setup of test boxes and more ease of maintenance. (Please correct me if I am wrong)

It’s clear that you’ll hear suggestions for setting up an effective user interface automation environment. Should I use Selenium RC or Selenium with Robot platform? And why?

Thanks in advance

+8
java selenium selenium-rc robotframework
source share
2 answers

You are absolutely right that random and often changing details in the created scenarios are the biggest problem of recording and playback automation. Obviously, you can remove data from scripts after recording, but in my opinion, it’s better to start creating reuse libraries and code scripts from the very beginning.

A good alternative for coding scenarios using "real" programming languages ​​is to use a higher-level automation infrastructure, for example, the SeleniumLibrary demo illustrates this very well, and the demo also shows how to use Selenium through Robot.

You also asked about Sikuli . I never used it myself, but it certainly looks interesting. You might be interested in this excellent guide , which explains how to use it through the Robot Framework.

+9
source share

Our company uses Fitnesse, not Robot, to control Selenium, however, we have the same problem. We have moved from DOM assumptions to accessing elements by ID. Since this is very difficult at Fitnesse, we are currently working on adding the Selenium backend to our own Framework (which previously only had Java and Smalltalk servers).

So, requiring elements with a specific identifier to be present in the DOM, we will of course break our tests if someone removes elements from the page; however, we found that this behavior is very useful because it imposes a contract on the tests performed with the implementation, and it is good that we find the missing elements as soon as someone breaks the implementation.

In addition, it’s good practice to automate the user interface more deeply: check only what is present on the page with Selenium and test the business logic by calling the main functions directly.

+2
source share

All Articles