Installing Ruby on Windows XP

Similar documents
Installing the Android SDK

Java Software Development Kit (JDK 5.0 Update 14) Installation Step by Step Instructions

Supplement I.B: Installing and Configuring JDK 1.6

Practice Fusion API Client Installation Guide for Windows

How to Configure Windows 8.1 to run ereports on IE11

Installation of IR under Windows Server 2008

Getting Started with Android Development

POOSL IDE Installation Manual

Notepad++ The COMPSCI 101 Text Editor for Windows. What is a text editor? Install Python 3

Supplement I.B: Installing and Configuring JDK 1.6

Download and Installation Instructions. Android SDK and Android Development Tools (ADT)

Java. How to install the Java Runtime Environment (JRE)

Setting Up a Windows Virtual Machine for SANS FOR526

Online Backup Client User Manual Linux

Primavera P6 Professional Windows 8 Installation Instructions. Primavera P6. Installation Instructions. For Windows 8 Users

RecoveryVault Express Client User Manual

FlexSim LAN License Server

Introduction to Android Development

1. Product Information

Online Backup Linux Client User Manual

Virtual Office Remote Installation Guide

Online Backup Client User Manual

Configuring Secure Socket Layer (SSL) for use with BPM 7.5.x

Compiere 3.2 Installation Instructions Windows System - Oracle Database

Setting up VMware ESXi for 2X VirtualDesktopServer Manual

WA1826 Designing Cloud Computing Solutions. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc. 1

Online Backup Client User Manual

Tutorial: setting up a web application

How to configure the DBxtra Report Web Service on IIS (Internet Information Server)

Web VTS Installation Guide. Copyright SiiTech Inc. All rights reserved.

BSDI Advanced Fitness & Wellness Software

TUTORIAL ECLIPSE CLASSIC VERSION: ON SETTING UP OPENERP 6.1 SOURCE CODE UNDER WINDOWS PLATFORM. by Pir Khurram Rashdi

Installing Java. Table of contents

Getting Started using the SQuirreL SQL Client

Click Start > Control Panel > System icon to open System Properties dialog box. Click Advanced > Environment Variables.

EMC Documentum Composer

Test Automation Integration with Test Management QAComplete

Setting up Sudoku example on Android Studio

SSO Plugin. J System Solutions. Upgrading SSO Plugin 3x to 4x - BMC AR System & Mid Tier.

Erie 1 BOCES/WNYRIC. Secure File Transfer. Upload/Download Wizard

Personal Token Software Installation Guide

CONFIGURING MICROSOFT SQL SERVER REPORTING SERVICES

How to Install Eclipse. Windows

NetBeans IDE Field Guide

Hudson configuration manual

AUSTRALIAN CUSTOMS AND BORDER PROTECTION SERVICE TYPE 3 CERTIFICATE 2014 INSTALLATION GUIDE

BSDI Advanced Fitness & Wellness Software

Download and Installation Instructions. Android SDK and Android Development Tools (ADT) Microsoft Windows

SonicWALL CDP 5.0 Microsoft Exchange InfoStore Backup and Restore

Outlook Profile Setup Guide Exchange 2010 Quick Start and Detailed Instructions

Setting up Citrix XenServer for 2X VirtualDesktopServer Manual

Release Date May 10, Adeptia Inc. 443 North Clark Ave, Suite 350 Chicago, IL 60654, USA

Installation Guide. Research Computing Team V1.9 RESTRICTED

Implementing a SAS 9.3 Enterprise BI Server Deployment TS-811. in Microsoft Windows Operating Environments

USING STUFFIT DELUXE THE STUFFIT START PAGE CREATING ARCHIVES (COMPRESSED FILES)

National Fire Incident Reporting System (NFIRS 5.0) NFIRS Data Entry/Validation Tool Users Guide

WA2262 Applied Data Science and Big Data Analytics Boot Camp for Business Analysts. Classroom Setup Guide. Web Age Solutions Inc.

USING SSL/TLS WITH TERMINAL EMULATION

Bulk Downloader. Call Recording: Bulk Downloader

Troubleshooting Guide. 2.2 Click the Tools menu on Windows Explorer 2.3 Click Folder Options. This will open a dialog box:

GETTING STARTED WITH SQL SERVER

How to Configure Windows 7 to run ereports on IE 11

Compiere ERP & CRM Installation Instructions Windows System - EnterpriseDB

Selenium Automation set up with TestNG and Eclipse- A Beginners Guide

SIM900 Eclipse environment install Application Note_V1.00

How to Configure a Remote Desktop Licensing Server for vspace 6

Installing and Configuring DB2 10, WebSphere Application Server v8 & Maximo Asset Management

Installing LearningBay Enterprise Part 2

POINT OF SALES SYSTEM (POSS) USER MANUAL

Instructions for Microsoft Outlook 2003

For Introduction to Java Programming, 5E By Y. Daniel Liang

Deploying Microsoft Operations Manager with the BIG-IP system and icontrol

How To Restore Your Data On A Backup By Mozy (Windows) On A Pc Or Macbook Or Macintosh (Windows 2) On Your Computer Or Mac) On An Pc Or Ipad (Windows 3) On Pc Or Pc Or Micro

Upgrading MySQL from 32-bit to 64-bit

Install guide for Websphere 7.0

How to Install Applications (APK Files) on Your Android Phone

Install MS SQL Server 2012 Express Edition

Test Case 3 Active Directory Integration

How to install and use the File Sharing Outlook Plugin

Qvis Security Technical Support Field Manual LX Series

How To Run A Hello World On Android (Jdk) On A Microsoft Ds.Io (Windows) Or Android Or Android On A Pc Or Android 4 (

Jenkins on Windows with StreamBase

ilaw Installation Procedure

Mapping ITS s File Server Folder to Mosaic Windows to Publish a Website

EVALUATION ONLY. WA2088 WebSphere Application Server 8.5 Administration on Windows. Student Labs. Web Age Solutions Inc.

1. Open the preferences screen by opening the Mail menu and selecting Preferences...

How To Configure CU*BASE Encryption

XStream Remote Control: Configuring DCOM Connectivity

3. Installation and Configuration. 3.1 Java Development Kit (JDK)

Installation and Troubleshooting Guide for SSL-VPN CONNECTIONS Access

Witango Application Server 6. Installation Guide for Windows

CentreWare Internet Services Setup and User Guide. Version 2.0

Installing (1.8.7) 9/2/ Installing jgrasp

The goal with this tutorial is to show how to implement and use the Selenium testing framework.

IBM Support Assistant v5. Review and hands-on by Joseph

ACCEPT THE SECURITY CERTIFICATE FOR THE WEB FILTER

Installation Guide and Machine Setup

new Business Online Technical Troubleshooting Guide

Troubleshooting steps for Oracle Financials and Markview. Jan 2015

Installing Drupal on Your Local Computer

Transcription:

Table of Contents 1 Installation...2 1.1 Installing Ruby... 2 1.1.1 Downloading...2 1.1.2 Installing Ruby...2 1.1.3 Testing Ruby Installation...6 1.2 Installing Ruby DevKit... 7 1.3 Installing Ruby Gems... 10 1.4 Installing Selenium... 12 1.5 Installing the IDE... 14 1.5.1 Install the Java JDK where required...14 1.5.2 Installing Netbeans...18 1.5.3 Configuring NetBeans...20 2 Testing your installation...22 2.1 Create a new project... 22 2.2 Create your test file... 24 2.3 Run your test file... 25 1 Installation 1.1 Installing Ruby 1.1.1 Downloading We will be installing Ruby version 1.9.2 the latest version of Ruby. You can download the installer from: http://rubyforge.org/frs/download.php/72170/rubyinstaller-1.9.2-p0.exe Download the file, save it on your desktop, and once complete, double click on the.exe file to open it. Agree with any security warnings that appear. 1.1.2 Installing Ruby You should now see this window: Page 2 of 26

Click Next Select I accept the license and click Next On the next screen: Change the installation path to C:\Tech\Ruby192 Check the Add Ruby executables to your PATH checkbox Check the Associate.rb and.rbw files with this Ruby installation checkbox The screen should now look like this: Page 3 of 26

Click Install Page 4 of 26

Once installation is complete, you should see this screen: Click Finish, and the installer will close. Page 5 of 26

1.1.3 Testing Ruby Installation We re now going to test that ruby has installed properly by running ruby. Open the windows Command Prompt by clicking on the start menu, and clicking Run. When the Run popup appears, type cmd into the text box and click Ok : When the Command Prompt appears, type: ruby v and press Enter. You should see the ruby version number as in this screenshot: Here you can see we have installed ruby version 1.9.2p0. Page 6 of 26

1.2 Installing Ruby DevKit The rest of this document (except for the paths) works across pretty much any operating system. There are some problems compiling some Ruby gems on Windows because of the lack of a C compiler installed by default. The Ruby DevKit takes care of all of this for you. First of all, download the DevKit from: http://github.com/downloads/oneclick/rubyinstaller/devkit-4.5.0-20100819-1536- sfx.exe Download the file, save it on your desktop, and once complete, double click on the.exe file to open it. Agree with any security warnings that appear. When the 7-Zip self-extracting archive window pops up, you should change the path to: C:\Tech\Ruby-DevKit\ Once the file has extracted, open the Windows Command Prompt by select Start / Ru, typing cmd and pressing Enter. Next, navigate into the directory that you just extracted the files into. For instance: cd../../ cd Tech/Ruby-DevKit Page 7 of 26

Now type: ruby dk.rb init Which will generate a config file which should list the version of Ruby that we installed earlier. Type: notepad config.yml To check that it s OK. You should see a line at the bottom of the file which reads: - C:/Tech/Ruby192 Next, we will install the DevKit enhancements. To do this, type: ruby dk.rb install Which should produce: Page 8 of 26

Finally, to check that the installation has been successful, we re going to try compiling a gem (see section 1.4 below for a full explanation of gems) to check this installation. Type: gem install rdiscount --platform=ruby RDiscount should install correctly and you should see: Temporarily enhancing PATH to include DevKit... in the screen messages. Next type: ruby -rubygems -e "require 'rdiscount'; puts RDiscount.new('**Hello RubyInstaller**').to_html" and press enter. You should see: In summary: <p><strong>hello RubyInstaller</strong></p> Page 9 of 26

1.3 Installing Ruby Gems Gems in Ruby are self-contained programs or libraries. So, the mysql gem contains code that you may use to connect to mysql. I say may as there can be multiple gems that do the similar things in different ways. For instance there are two well known and competing Object Relational Mappers DataMapper and ActiveRecord. In this section we will download and install the gems you will need to test. To do this, return to the command prompt you have open above, and type in: gem list This lists the gems which are already installed. We will now download and install the gems you need; which are: selenium-webdriver watir-webdriver rspec ruby-debug-ide test-unit The gem package manager will also download any dependencies that are required by these gems, and that you do not have installed. Return to the Command Prompt window, and type: gem install selenium-webdriver watir-webdriver rspec ruby-debugide test-unit --platform=ruby and press Enter. Note: When installing gems on Windows with DevKit, you should always append -- platform=ruby when installing gems. This ensures that the source is downloaded and compiled locally rather than binaries downloaded which will not work on windows. More information can be found here: http://github.com/oneclick/rubyinstaller/wiki/development-kit under the heading Example Native RubyGem Installations using the DevKit. Page 10 of 26

It may take a while to complete, but once done you should see output that looks like this: Page 11 of 26

1.4 Installing Selenium Although we will be creating tests using Watir, which is a Ruby test API, the tests will be run by a Selenium server. The call stack looks like this: Watir tests -> Watir-Webdriver -> Selenium-Webdriver -> Selenium Server This means that you can run Selenium tests without having it open a browser window. This is called running headlessly. This is much, much faster than having watir open a browser and run the tests. This means that you can run tests headless locally, prior to checking in, and then the build server can take care of the longer and heavier cross browser testing in the nightly build. We re going to install the standalone selenium server on your PC. To do this: Create a new directory; C:\Tech\Selenium\ Go to http://code.google.com/p/selenium/downloads/list/ and download the latest version of the selenium-server-standalone-2* file, saving it to C:\Tech\Selenium\ Open the Windows Command Prompt by clicking Start / Run, typing cmd and pressing Enter. Navigate to the Selenium directory and list the contents by typing: cd../.. cd Tech/Selenium You should see: Page 12 of 26

Now we re going to start the Selenium server. Type: java jar selenium-server-standalone-2.0a5.jar The Selenium server will now start. When the security alert appears, click the Unblock button: You should see something like this in the Command Prompt window: This means that the Selenium server is up and running and waiting for connections on port 4444. Leave the window where it is, as we will return to it later. Page 13 of 26

1.5 Installing the IDE Everyone has their favourite IDE, but if you do not have one yet and want one that works well with Ruby, then Netbeans is a good choice. In this section we will install Netbeans and configure it for use with the version of Ruby we just installed. 1.5.1 Install the Java JDK where required Netbeans is a Java application and needs the JDK (Java Development Kit) to run. So that we can be sure that everyone s IDE works in the same way, we re first going to download the current version of the Java JDK from here: http://is.gd/fdhjl Download the file, save it on your desktop, and once complete, double click on the.exe file to open it. Agree with any security warnings that appear. You should now see this window: Click Next Page 14 of 26

Next, you will see the installation options page. Leave the default options as they are and click Next : The installation will start. Page 15 of 26

When the installation is about half way through, a second window will pop up. This is for the JRE Java Runtime Environment. You will see a window that looks like this: Click Next, and the JRE will be installed. Page 16 of 26

The second window will disappear when the JRE has been successfully installed, and you will be left with: Click Finish to close the window. When the browser window opens asking you to register, close it again. Page 17 of 26

1.5.2 Installing Netbeans We re going to download the Ruby bundle of Netbeans, which you can get from here: http://netbeans.org/downloads/index.html Download the Ruby version, save it on your desktop, and once complete, double click on the.exe file to open it. Agree with any security warnings that appear. The first installation screen asks you which server you want to install with the IDE. As we re not going to be doing any web development, deselect the Glassfish Server Open Source Edition 3.0.1 checkbox: Then click Next. On the next screen, accept the Terms & Conditions by checking the checkbox, and select Next. Page 18 of 26

The next screen asks you for your installation location and the location of the JDK. The screen should look like this: You must ensure that the Java environment for the NetBeans IDE path matches the one you just installed: Click Next. Click Install C:\Program Files\Java\jdk1.6.0_21 Once the registration is done, uncheck the Register checkbox and click Finish. Page 19 of 26

1.5.3 Configuring NetBeans We re now going to check that NetBeans is configured correctly. To start, open NetBeans by selecting: Start / All Programs / NetBeans / NetBeans IDE 6.9.1 Once it s finished loading, select the Tools menu and select Ruby Platforms Page 20 of 26

You should now see the Ruby Platform Manager, which shows the different versions of Ruby installed on your computer. You should see two versions: 1. Built in JRuby 1.5.1 which comes bundled with NetBeans 2. Ruby 1.0.2-p0 the version we installed earlier Click Close to close. Page 21 of 26

2 Testing your installation Lastly, we re going to test that your installation works by writing a quick test that uses Watir to run a test against the google homepage. 2.1 Create a new project With Netbeans open, select File from the top menu, and then New Project : In the new project dialog, select Ruby in the middle section, and then Ruby Application in the right panel. Click Next. Page 22 of 26

On the next screen: Rename the project to RubyTraining Change the Project Path to C:\Tech\Projects Deselect the Create Main File checkbox Change the Ruby Platform to Ruby 1.9.2-p0 The screen should now look like this: Click Finish. Page 23 of 26

2.2 Create your test file Once the project has been created, right click on Source Files in the project pane, select select New / Ruby File. Enter google_test into the File Name text box, and click Finish. When the file opens, select all of the text in the file and replace it with the text below: require 'watir-webdriver' browser = Watir::Browser.new(:remote, :url => "http://127.0.0.1:4444/wd/hub", :desired_capabilities => :htmlunit) browser.goto "http://google.com" browser.text_field(:name => 'q').set("watir is working!") browser.button(:name => 'btng').click puts browser.url browser.close Save the file by pressing Ctrl + S or selecting File / Save from the menu. Page 24 of 26

This script goes to www.google.com enters Watir is working! in the question box Presses the search button (btng) puts (prints to screen) the new browser URL closes the browser 2.3 Run your test file We re now going to run this file in debug mode. To do this, either press Shift + F6, or select Run / Run File from the top menu. When the Windows Security Alert pops up, select Unblock. You ll only need to do this once. The IDE s appearance will now change as the file is run. Page 25 of 26

When it s finished, click on the Output google_test tab in the lower right pane. You will see the output of the script: The important line here is: http://www.google.co.uk/search?hl=en&source=hp&q=watir+is+working %21&btnG=Google+Search This is the new URL that the script put If you check the Command Prompt window where you earlier left Selenium open, you will also be able to see that Selenium has also been logging the output. And that s it you re now ready for the ruby course and to run Watir & Ruby yourself. Page 26 of 26