ggarber
ggarber

Reputation: 8360

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?

Upvotes: 4

Views: 971

Answers (3)

user302455
user302455

Reputation:

I might keep in mind how you plan on executing your recorded tests. For instance, it might be trivial to incorporate Selenium's generated JUnit tests into a pre-existing JUnit-based testing framework.

Upvotes: 1

retornam
retornam

Reputation: 339

I'd highly recommend you look at moving to Selenium in C#, Ruby,PHP or Python. I found many timing issues resolving once I got away from the HTML Selenese.

Upvotes: 2

AutomatedTester
AutomatedTester

Reputation: 22428

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

Upvotes: 7

Related Questions