Skip to main content

Selenium WebDriver Ruby tutorial

This is a list of very short examples which demonstrate the basic usage of Selenium Webdriver for test automation in Ruby language. Each section includes a sample web page code and automated test code, along with the comments for better understanding.

Getting started. WebDriver initialization

Working with Element Locators

Submitting Forms

Page

Test

Testing Image elements on the page

Page

Test

Setting Checkboxes

Page

Test

Setting Radio Buttons

Page

Test

Selecting Select Boxes

Page

Test

Testing HTML Tables

Page

Test

Executing JavaScript code on the page. Handling popup dialogs

Page

Test

Dealing with the Frames

Page

Test

A single Test Unit

Include several Test Units in a Test Suite

Popular posts from this blog

Switching between keyboard layouts in Openbox (Arch Linux)

Switching between two (or more) keyboard layouts in Openbox DE is a task that's quite easy to accomplish, although it might not be so obvious as in other desktop environments. This solution was tested on Arch Linux. You just need to edit this file (assuming you want to switch between English and Ukrainian Phonetic layouts with Alt-Shift): /etc/X11/xorg.conf.d/01-keyboard-layout.conf Section "InputClass" Identifier "keyboard-layout" Driver "evdev" MatchIsKeyboard "yes" Option "XkbLayout" "us,ua(phonetic)" Option "XkbModel" "pc105" Option "XkbOptions" "grp:alt_shift_toggle" EndSection If you have Nvidia card, don't forget to edit /etc/X11/xorg.conf.d/20-nvidia.conf and change Driver from "kbd" to "evdev" in InputDevice section: Section "InputDevice" Identifier "Keyboard0" Driver "evdev" EndSection Y...

Integrating TestRail and Gitlab CI/CD

Perhaps you are using Gitlab CI/CD at your project. Every project requires some test cases for regression testing, and Gitlab actually provides this feature, but it’s only available in Ultimate version that is more expensive. TestRail is another popular platform for managing your test suite that provides way more extensive capabilities and options than Gitlab’s own test case management feature. So the chances are that you are still willing to use TestRail for your acceptance and regression testing efforts. Why not combining the best of two worlds — the flexibility of Gitlab CI/CD and rich test case management capabilities of TestRail? In the following example I’ll demonstrate how this goal could be achieved with ease. Let’s assume that we need to create a new Milestone in TestRail that contains two test runs — the one with Acceptance tests, and another one with Regression tests. The step in your .gitlab-ci.yml Gitlab configuration file would look like this: This step is reading C...

How to control CPU frequency on Linux Fedora 20

Sometimes you need to make CPU run faster or slower, depending on your needs. In Linux you can control this by using different CPU governors. The following steps were tested on Fedora 20, but most likely they would also work on later versions of Linux Fedora OS. sudo yum install kernel-tools Check the available CPU governors: sudo cpupower frequency-info --governors sudo cpupower frequency-set --governor [governor] More information about the governors here: http://docs.fedoraproject.org/en-US/Fedora/20/html/Power_Management_Guide/cpufreq_governors.html