Selenium tests: html vs code?

Is it better to write / write selenium tests in html format and run them directly on the server using "-htmlSuite" or write tests in java / C # / ... and run them on the server using selenium-rc

What is the recommended solution?

+4
source share
3 answers

I would always recommend to people who write Selenium Tests in a programming language, because it allows you to run tests much more expressive.

You can create common methods that are used by all tests, and if these changes you can then update 1 method to pass n tests, because all of them do not work on this element. One example of this is the Object Object model , which is a method for developing tests that propose creating a DSL for every page you interact with, and then your tests are read very poorly for both technical and non-technical people.

If you write your tests in a programming language, you can also use the Selenium Grid, which runs your tests in parallel to speed up their work.

+7
source

I highly recommend you take a look at switching to Selenium in C #, Ruby, PHP, or Python. I found that many of the problems of the times are resolved after I left HTML Selenese.

+2
source

I could keep in mind how you plan to run your recorded tests. For example, it would be trivial to include tests produced by Selenium JUnit in an existing JUnit-based testing environment.

+1
source

Source: https://habr.com/ru/post/1305166/


All Articles