Next we will introduce a commonly used IDE development tool. We believe you are familiar with netbeans and eclipse. Here I will mainly introduce netbeans as the main tool, if you want to know how to build Ruby in eclipse, you can search for relevant information on the Internet, probably because netbeans has an official Ruby version embedded, so now I want to save the trouble of downloading the ruby plug-in. Just go to the netbeans official website and find the ruby version, so we are lucky to start. you can directly install the netbeans-Ruby version, which is very convenient. Of course, after we start the netbeans new project after installation, we will find that there is a ruby project, and a new Ruby project is created in Mian. enter puts "Hello world! ", We can see the running result below by running it directly. It's very convenient, even we don't even need to install Ruby. However, even so, we can't be too optimistic, because it can be used for automated testing, we can find that the ruby version is very low through in-depth directory view, and I am using the netbeans-Ruby version 1.4, of course, the current watir architecture cannot be completed, so we will test it through the automated script, as shown in the following script:
Require 'rubygems'
Require 'watir'
Test_site = 'HTTP: // www.baidu.com /'
# Open the IE browser
Ie = watir: IE. New
Puts "Step 1: Go to the test site:" + test_site
Ie. Goto (test_site)
Puts "Action: entered" + test_site + "in the address bar ."
Put this script in main. in RB, save and run directly, and the result is unsuccessful. In this case, we need to automatically install Ruby and watir manually. This can be done according to the first consideration, after the environment is set up, how can we embed the manually built environment into netbeans? Here we need some settings.
Right-click our project and enter properties. Then, go to the running bar, manage the ruby platform, add the ruby platform, and import the environment just created manually, and select the new Ruby platform to be imported and run it again. The effects are certainly different, but the premise is that you have successfully set up the ruby + watir manual environment.
The development environment is mainly used to facilitate writing and running scripts. Therefore, you must select the most suitable one. Here I recommend two tools, one of which is that the big IDE is netbeans, the other is a small scite tool. Use it for different purposes!