Use jruby in rational function tester

Source: Internet
Author: User
Tags java se

I. Overview

Rational Function tester is an automated functional testing tool for IBM. It uses Java as a scripting language. If you are not familiar with it, visit the IBM website.

Ruby is currently a hot language in Web development. It is simple, flexible, loose, and interesting. In this year's automated testing project, the company used rft to build a testing framework and Ruby to identify some OCX controls on the page. In this way, we need to solve the problem of variable passing and method calling between Java code and Ruby scripts. jruby naturally becomes the best choice.

In this article, I post my own configuration and experiment processes, and share and exchange them with you.

2. Preparation

The runtime environments to be installed are: jruby, rft, and Java SE 6.0.

The installation of jruby and JDK 1.6 has been introduced in another article. You can visit the following link to View Details:

Http://blog.csdn.net/wyp_810618/archive/2008/06/28/2595180.aspx

For details about rft installation, refer to instructions on the IBM website.

In order to use Ruby in rft, we still need to download the RDT plug-in. Some people may wonder, isn't this a plug-in eclipse? Yes, because rft itself is a test tool based on the eclipse platform (now I prefer to call rft software "Eclipse rft plug-in ")

RDT: http://jaist.dl.sourceforge.net/sourceforge/rubyeclipse/org.rubypeople.rdt-0.7.0.601192300PRD.zip

Iii. rft Configuration

1. decompress the RDT package to any directory, and obtain the features and plugins directories. Copy these two directories to the rft Installation Directory D:/program files/IBM/sdp70, overwrite the original directory.

2. Start rft and click here: window -- preferences. You should be able to see the ruby node in the list on the left. Then click ruby -- installed interpreters node here.

3. Configure the runtime environment of jruby on this interface. Click the Add button. In the new window, the interpreters name can be customized. In the location field, enter % jruby_home %/bin/jruby. bat directory, where % jruby_home % is your jruby installation directory, which can be viewed in environment variables. After the input is complete, it should look like this:

Click OK to complete the configuration.

Iv. Verification

After the installation is complete, we need to verify whether jruby can run normally in rft.

First, create a new Ruby project in rft. You can see the ruby node in the project list. If you do not know how to operate it, search for the eclipse usage on Baidu;

After creating a ruby project in rft, you need to switch the perspective to see the project node, click the window -- open the Perspective -- others, select the ruby node in the list, and click OK, now you can see the newly added Ruby project in the project on the left of rft.

Right-click the ruby project node and add a new file named helloworld. Rb (note that the file must be suffixed with. RB). Then enter the following code in the file:

Puts "Hello jruby world"

The above Code does not end with any symbols. Save.

Finally, right-click the file and choose "run mode"> "Ruby application" to run the file. If Hello jruby world is output in the console, the configuration takes effect.

If an error message is displayed in the console: 'cmd' is neither an internal command nor an external command, modify % jruby_home %/bin/jruby. BAT file, just comment out the last line of code.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.