Using JRuby in Rational Function tester

Source: Internet
Author: User
Tags java se

I. Overview

Rational function Tester is an IBM automated test tool that uses Java as a scripting language and does not understand that his friends can go to the IBM website.

Ruby is the hottest language in web development at the moment, simple, flexible, relaxed, and fun. In this year's automated test project, the RFT was used to build the test framework, and the identification of some OCX controls in the page was identified by Ruby. In this case, you need to solve the problem of variable transfer and method invocation between Java code and Ruby script, and JRuby is naturally the best choice.

In this article I put myself in the process of configuring and experimenting, sharing and communicating with you

Second, prepare

The operating environment that needs to be installed is: Jruby,rft,java SE 6.0.

JRuby and JDK 1.6 are installed in another article I have already introduced, you can visit the following address to view:

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

RFT installation Please refer to the instructions on the IBM website

In order to be able to use Ruby in RFT, we also need to download the Rdt plugin, one might wonder, is this not a plugin in eclipse? Yes, because RFT itself is a test tool based on the Eclipse platform (now I prefer to call RFT software "Eclipse's RFT Plugin")

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

Third, RFT configuration

1, the Rdt compressed packets to any directory, get features and plugins two directories, copies of the two directories to RFT installation directory D:\program files\ibm\sdp70 directory, covering the original directory.

2, start RFT, according to this click: Window-Preferences, in the left-hand list should be able to see the Ruby node, and then click on the ruby--installed interpreters node

3. Configure the JRuby operating environment in this interface. Click the Add button, in the new window, interpreters name can be customized, location fill in the%jruby_home%/bin/jruby.bat directory, where%jruby_home% is your JRUBY installation directory, Can be viewed in environment variables. This should look like this after the entry is completed:

Click OK to complete the configuration

Iv. Verification

After the installation is complete, we need to verify that the JRuby can run properly under RFT.

First in the RFT a new Ruby project, in the project list can see the Ruby node, do not know how to operate the friends themselves to Baidu search Eclipse usage bar;

After you create a new Ruby project in RFT, you need to switch the perspective to see the project node, click on the window--open the perspective--others, select the Ruby node in the list, click OK, and then see the new Ruby Project on the left side of RFT.

Right-click on the Ruby project node, add a file named Helloworld.rb (note, be sure to bring the. RB suffix name), and then enter the following code in the file:

Puts "Hello JRuby world"

There are no symbols at the end of the above code. Save.

Finally, right-click on the file-run--ruby application, run the file. If you can see the console output Hello JRuby world, the configuration is already in effect.

If there is an error message in the console: ' cmd ' is not an internal command or an external command, please modify the%jruby_home%/bin/jruby.bat file to 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.