【发布时间】:2016-04-17 13:14:18
【问题描述】:
我正在尝试使用 Ruby 下的 cucumber 自动执行一些测试任务,使用 TE3270 gem 和 X3270 免费驱动程序连接到大型机平台,但打开大型机屏幕的部分无法进一步。
代码在 Windows 7、Ruby 2.1 上运行。
这是我基于 TE3270 网站上出现的代码:
require 'TE3270'
World(TE3270::ScreenFactory)
Before do
@emulator = TE3270.emulator_for :x3270 do |platform|
platform.executable_command = '"C:\Program Files (x86)\wc3270\wc3270.exe"'
platform.host = 'mainframe.hostname'
platform.max_wait_time = 5 # defaults to 10
platform.trace = true # turns on trace output from the emulator
end
end
Given /^my connection$/ do
my_screen = MainframeScreen.new(@emulator)
my_screen.userid = 'my_mainframe_user'
my_screen.password = 'my_mainframe_password'
end
class MainframeScreen
include TE3270
text_field(:userid, 19, 36, 8)
text_field(:password, 20, 36, 8)
def login(username, password)
self.userid = username
self.password = password
end
end
有什么想法吗?
问候, 强尼
【问题讨论】:
标签: ruby automation cucumber