我使用Ruby Cucumber(v3.1.0)和Selenium WebDriver为Web应用程序创建了自动化测试。
某些失败的测试也导致Cucumber崩溃并出现以下错误:“无法修改冻结的String(RunTimeError)”。此时,测试执行将停止,并且不会生成任何报告。
有人可以解释一下这个的根本原因吗?我想知道这是Cucumber或WebDriver问题,还是我没有正确使用它们。有谁见过这个?提前谢谢。
这是黄瓜的输出:
Scenario: Verify Pool link verification # features/home/pool.feature:19
When I click on the Pool link on Backoffice Home Page # step_definitions/pool_steps.rb:9
timed out after 30 seconds, waiting for #<Watir::Anchor: located: false; {:href=>"/backoffice/pool/info", :index=>, :tag_name=>"a"}> to be located (Watir::Exception::UnknownObjectException)
(eval):1:in `process_watir_call'
./step_definitions/pool_steps.rb:11:in `block (2 levels) in <top (required)>'
./step_definitions/pool_steps.rb:10:in `"I click on the Pool link on Backoffice Home Page"'
features/home/pool.feature:20:in `When I click on the Pool link on Backoffice Home Page'
can't modify frozen String (RuntimeError)
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/formatter/html.rb:571:in `snippet'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/formatter/html.rb:293:in `extra_failure_content'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/formatter/html.rb:435:in `build_exception_detail'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/formatter/html.rb:288:in `exception'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/formatter/ignore_missing_messages.rb:11:in `method_mising'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/formatter/legacy_api/ast.rb:181:in `print_exception'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/formatter/legacy_api/ast.rb:116:in `accept'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/formatter/legacy_api/adapter.rb:580:in `step_invocatin'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/formatter/legacy_api/adapter.rb:543:in `step_invocatin'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/formatter/legacy_api/adapter.rb:387:in `print_step'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/formatter/legacy_api/adapter.rb:251:in `after_test_stp'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/formatter/legacy_api/adapter.rb:107:in `after_test_stp'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/formatter/legacy_api/adapter.rb:31:in `block in initilize'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/event_bus.rb:34:in `block in broadcast'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/event_bus.rb:34:in `each'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/event_bus.rb:34:in `broadcast'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/event_bus.rb:40:in `method_missing'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/runner.rb:35:in `around_hook'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/around_hook.rb:12:in `describe_to'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/case.rb:120:in `block (2 levels) in copose_around_hooks'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/case.rb:121:in `compose_around_hooks'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/case.rb:26:in `block in describe_to'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/runner.rb:19:in `test_case'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/case.rb:25:in `describe_to'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/filters/prepare_world.rb:12:in `test_case'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/case.rb:25:in `describe_to'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/filter.rb:57:in `test_case'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/filters/retry.rb:18:in `test_case'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/case.rb:25:in `describe_to'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/filters/quit.rb:12:in `test_case'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/case.rb:25:in `describe_to'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/filters/broadcast_test_run_started_event.rb:20:in `blck in done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/filters/broadcast_test_run_started_event.rb:19:in `ma'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/filters/broadcast_test_run_started_event.rb:19:in `doe'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/filter.rb:62:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/filter.rb:62:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/filter.rb:62:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/filter.rb:62:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/filter.rb:62:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/filters/locations_filter.rb:20:in `don'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/filter.rb:62:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/filters/tag_filter.rb:18:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/compiler.rb:24:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/gherkin/parser.rb:37:in `done'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core.rb:32:in `parse'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core.rb:21:in `compile'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/runtime.rb:74:in `run!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/lib/cucumber/cli/main.rb:33:in `execute!'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/cucumber-3.1.0/bin/cucumber:9:in `<top (required)>'
C:/Ruby24-x64/bin/cucumber:23:in `load'
C:/Ruby24-x64/bin/cucumber:23:in `<main>'