当我运行 Selenium 测试时,测试会间歇性地失败并出现错误:
'Element is not currently visible and so may not be interacted with'
但是对于哪个元素这是错误,错误日志中没有提到。有什么办法,我们可以确定哪个元素“元素当前不可见,因此可能无法与之交互”错误被抛出?
这是一个堆栈跟踪:
- Manage tab search: should test search by valid entire description within label: error - Element is not currently visible and so may not be interacted with ; ["[remote server] file:///C:/Temp/webdriver-profile20130701-4012-14mgqix/extensions/fxdriver@googlecode.com/components/command_processor.js:7736:in `fxdriver.preconditions.visible'", "[remote server] file:///C:/Temp/webdriver-profile20130701-4012-14mgqix/extensions/fxdriver@googlecode.com/components/command_processor.js:10437:in `DelayedCommand.prototype.checkPreconditions_'", "[remote server] file:///C:/Temp/webdriver-profile20130701-4012-14mgqix/extensions/fxdriver@googlecode.com/components/command_processor.js:10456:in `DelayedCommand.prototype.executeInternal_/h'", "[remote server] file:///C:/Temp/webdriver-profile20130701-4012-14mgqix/extensions/fxdriver@googlecode.com/components/command_processor.js:10461:in `DelayedCommand.prototype.executeInternal_'", "[remote server] file:///C:/Temp/webdriver-profile20130701-4012-14mgqix/extensions/fxdriver@googlecode.com/components/command_processor.js:10401:in `DelayedCommand.prototype.execute/<'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/response.rb:51:in `assert_ok'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/response.rb:15:in `initialize'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/common.rb:59:in `create_response'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/default.rb:66:in `request'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/bridge.rb:629:in `raw_execute'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/bridge.rb:607:in `execute'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/bridge.rb:364:in `clickElement'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/common/element.rb:54:in `click'", "C:/Temp/d20130701-2976-tv6kuq/lib/backjax_manage_search_helper.rb:147:in `select_label'", "./tests/backjax_manage_search_by_description.rb:36:in `test_search_by_valid_entire_description_within_label'", "./tests/backjax_manage_search_by_description.rb:85:in `BackjaxManageSearchTest'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-4.7.5/lib/minitest/unit.rb:1258:in `__send__'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-4.7.5/lib/minitest/unit.rb:1258:in `run'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-reporters-0.14.20/lib/minitest/reporters.rb:62:in `run_with_hooks'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/scope-0.2.4/lib/scope.rb:105:in `run'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/scope-0.2.4/lib/scope.rb:153:in `call'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/scope-0.2.4/lib/scope.rb:153:in `recursively_run_setup_and_teardown'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/scope-0.2.4/lib/scope.rb:155:in `recursively_run_setup_and_teardown'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/scope-0.2.4/lib/scope.rb:139:in `run_setup_and_teardown'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/scope-0.2.4/lib/scope.rb:105:in `run'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-4.7.5/lib/minitest/unit.rb:933:in `_run_suite'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-4.7.5/lib/minitest/unit.rb:926:in `map'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-4.7.5/lib/minitest/unit.rb:926:in `_run_suite'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-reporters-0.14.20/lib/minitest/reporter_runner.rb:45:in `_run_suite'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-4.7.5/lib/minitest/parallel_each.rb:71:in `_run_suites'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-4.7.5/lib/minitest/parallel_each.rb:70:in `map'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-4.7.5/lib/minitest/parallel_each.rb:70:in `_run_suites'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-reporters-0.14.20/lib/minitest/reporter_runner.rb:37:in `_run_suites'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-4.7.5/lib/minitest/unit.rb:877:in `_run_anything'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-4.7.5/lib/minitest/unit.rb:1085:in `run_tests'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-reporters-0.14.20/lib/minitest/reporter_runner.rb:30:in `run_tests'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-4.7.5/lib/minitest/unit.rb:1072:in `send'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-4.7.5/lib/minitest/unit.rb:1072:in `_run'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-4.7.5/lib/minitest/unit.rb:1071:in `each'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-4.7.5/lib/minitest/unit.rb:1071:in `_run'", "C:/jruby-1.7.2/lib/ruby/gems/shared/gems/minitest-4.7.5/lib/minitest/unit.rb:1059:in `run'", "./tests/backjax_manage_search_by_description.rb:98:in `(root)'"]