Create an Alias for Interactive Console Work: Selenium and Capybara
If you are working on shell most of the time Aliases are very helpfull and time saving. For testing purposes you can use Alias for getting ready your test suites. In this post, I want to explain both running Selenium and Capybara on console and creating aliases for each. This post is for Windows machines, if you are using Unix-like see this post.
Creating Scripts for Selenium and Capybara
First of all, it is assumed that you have installed Selenium and Capybara correctly and they work on your machines. If you haven't installed, you can see my previous posts. I am using the Selenium with Python and the Capybara with Ruby. You can use several different language for Selenium but Capybara works only with Ruby. Create scripts in a directory called scripts (in your home folder, like as ~/scripts) for your automation tool as following, save them as capybara.rb, sel.py:
Depends on your favourite shell, you need to add the alias to .bashrc bash shell, config_fish for fish shell and etc. You can see the example for fish and bash shell as following:
For fish: edit ~/.config/fish/config.fish
For Bash: edit ~/.bashrc