作者热门文章
- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
当我需要运行一个简单的葫芦测试时,我总是会遇到 HTTPClient::KeepAliveDisconnected 异常。
控制台输出:
Feature: Login
As a User i want to have access to my account
Scenario: right credentials # features\login.feature:4
1698 KB/s (567017 bytes in 0.326s)
1596 KB/s (1481497 bytes in 0.906s)
Given I am at the login page # features/step_definitions/login.rb:1
When I enter my username # features/step_definitions/login.rb:5
And I enter my password # features/step_definitions/login.rb:10
And I hit the Sign In button # features/step_definitions/login.rb:15
**HTTPClient::KeepAliveDisconnected: Eine vorhandene Verbindung wurde vom Remotehost geschlossen. (HTTPClient::KeepAliveDisconnected)**
./features/step_definitions/login.rb:16:in `/^I hit the Sign In button$/'
features\login.feature:8:in `And I hit the Sign In button'
Then I will see the Dashboard page # features/step_definitions/login.rb:19
Scenario: wrong credentials # features\login.feature:11
Given I am at the login page # features/step_definitions/login.rb:1
When I enter a wrong username # features/step_definitions/login.rb:24
And I enter a wrong password # features/step_definitions/login.rb:29
And I hit the Sign In button # features/step_definitions/login.rb:15
Then I will stay at the login page # features/step_definitions/login.rb:34
步骤定义:
Given(/^I am at the login page$/) do
query("* id:'email_sign_in_button'")
end
When(/^I enter my username$/) do
touch("* id:'email'")
query("* id:'email'",{:setText => "admin@mapit.com"})
end
When(/^I enter my password$/) do
touch("* id:'password'")
query("* id:'password'",{:setText => "admin"})
end
When(/^I hit the Sign In button$/) do
touch("* id:'email_sign_in_button'")
end
Then(/^I will see the Dashboard page$/) do
query("* text:'Dashboard'")
sleep(3)
end
When(/^I enter a wrong username$/) do
touch("* id:'email'")
query("* id:'email'",{:setText => "ich bin cool"})
end
When(/^I enter a wrong password$/) do
touch("* id:'password'")
query("* id:'password'",{:setText => "hululu"})
end
Then(/^I will stay at the login page$/) do
query("* id:'email_sign_in_button'")
sleep(3)
end
我正在运行 Ruby V2.0.0
为什么“我点击登录按钮”步骤在第一个场景中失败,但在第二个场景中通过?
最佳答案
这可能意味着您的应用已崩溃。查看 adb logcat 以获取堆栈跟踪。
不推荐使用 query("* id:'email'",{:setText => "admin@mapit.com"})
。使用方法 enter_text("* id:'email'", "admin@mapit.com")
关于android - 葫芦 android - HTTPClient::KeepAliveDisconnected,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33811445/
当我需要运行一个简单的葫芦测试时,我总是会遇到 HTTPClient::KeepAliveDisconnected 异常。 控制台输出: Feature: Login As a User i wa
我是 Ruby/Calabash 语言的新手,我正在使用 irb(main) 接口(interface)做一些示例;我已经使用“reinstall_apps”在 Android 模拟器上安装了 myF
我是一名优秀的程序员,十分优秀!