首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Calabash - HTTPClient::KeepAliveDisconnected

Calabash - HTTPClient::KeepAliveDisconnected
EN

Stack Overflow用户
提问于 2015-11-19 18:17:24
回答 1查看 1.7K关注 0票数 2

当我准备运行一个简单的calabash测试时,我总是会遇到一个HTTPClient::KeepAliveDisconnected异常。

控制台输出:

代码语言:javascript
复制
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

步骤定义:

代码语言:javascript
复制
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

我在运行Rubyv2.0.0

为什么“我在第一个场景中失败,但在第二个场景中通过”我按下“按钮?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-11-19 19:23:57

这可能意味着你的应用程序崩溃了。请参阅adb日志中的堆栈跟踪。

不建议使用query("* id:'email'",{:setText => "admin@mapit.com"})。使用方法enter_text("* id:'email'", "admin@mapit.com")

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33811445

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档