Watir-webdriver User Manual

Source: Internet
Author: User

First, environmental installation
1. Ruby Installation
: HTTPS://YUNPAN.CN/CP4SSPDGRTPBW access Password 2473
We are now using ruby193, can be directly copied to use, the Ruby installed directory under the Bin directory configuration to the environment variable path, open the command line input ruby–v to see if the installation is successful;

2, Installation Devkit
: Https://yunpan.cn/cP4S3Min4YeTq access Password 3858
Ibid can directly copy our Dev installation directory, into the Extract directory D:\Dev, run Ruby DK.RB Init initialization operation, and then run the Ruby dk.rb install to complete the installation, the Dev directory under the bin directory configuration to the environment variable under path;

3, installation cucumber
If it is a direct copy of ruby193, you open the command prompt input gem list can see Cucumber has been installed;

If not you can also be installed online, gem install cucumber can install the latest version of the Cucumber;
4, Installation WATIR-WEBDRIVR
Ibid. if it's a direct copy, open the command prompt and enter the Gem list to see if the Watir-webdriver is already installed.

If no installation is installed at the command prompt, enter gem install Watir-webdriver to install the latest version of Watir-webdriver.
Ii. use of the Cucumber+watir+ruby framework
First build a directory structure that creates a features folder, as shown:

Under the features directory, create a new wt_login.feature
# Encoding:utf-8
Feature:my_login Feature
Scenario:login_wsyyt
When I login Wsyyt
Executive Test.feature


Modify Marketplace Login Script according to Cucumber generated RB format
# Encoding:utf-8
When (/^i login wsyyt$/) do
Require ' watir-webdriver '
Mallloginpage = Watir::browser.start ' http://ah.10086.cn/mall/login.shtml '
Mallloginpage.text_field (: ID, "LoginName"). Set ("15156889837")
Mallloginpage.text_field (: ID, "Smsvalicodeinput_"). Set ("112233")
Mallloginpage.checkbox (: ID, "Licensechk_index"). Set "On"
Mallloginpage.link (: Title, "Login"). Click
End
Execute file:

Cucumber Framework Implementation Report

Watir-webdriver User Manual

Related Article

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.