Comparing Selenium commands in multiple languages

Translating recorded tests from IDE into Ruby is rather simple, and we can get started even if we do not have any previous programming experience; learning as we go works just fine. The most exciting part is that these commands are even easier to translate from Ruby to any other programming language. Here are a couple of examples of the usage of the sendKeys() method that we used in the preceding example:

Language

Command

Ruby

element.send_keys("cheese");

Java

element.sendKeys("cheese");

C-Sharp

element.SendKeys("cheese");

Python

element.send_keys("cheese");

JavaScript

element.sendKeys("cheese");

The consistency of the WebDriver API makes it incredibly easy to port your knowledge ...

Get Selenium Design Patterns and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.