Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium tests: html vs code?

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

What is the recommended solution?

like image 936
ggarber Avatar asked Dec 28 '22 22:12

ggarber


1 Answers

I would always recommend people writing their Selenium Tests in a programming language because it allows the tests to be a lot more expressive.

You can create common methods that all tests use and if that changes you can then update 1 method to get n tests passing because they all fail on that item. One example of this is the Page Object model which is a development method for tests that suggest you create a DSL for each page you interact with and then your tests read a lot more fluently to both technical and non-technical people.

If you write your tests in a programming language you can also take advantage of Selenium Grid which runs your tests in parallel to make them faster

like image 116
AutomatedTester Avatar answered Jan 08 '23 03:01

AutomatedTester