Sha256: 8cd8e0e3c4ef0a1e459024c58f0c43d4157ece977a8ad06cca21fdf17b40f81c

Contents?: true

Size: 722 Bytes

Versions: 4

Compression:

Stored size: 722 Bytes

Contents

require File.expand_path("../spec_helper", __FILE__)

describe Selenium::WebDriver::Error do

  it "should raise an appropriate error" do
    driver.navigate.to url_for("xhtmlTest.html")

    lambda {
      driver.find_element(:id, "nonexistant")
    }.should raise_error(WebDriver::Error::NoSuchElementError)
  end

  compliant_on :driver => [:remote, :firefox] do
    it "should show stack trace information" do
      driver.navigate.to url_for("xhtmlTest.html")

      rescued = false
      ex = nil

      begin
        driver.find_element(:id, "nonexistant")
      rescue => ex
        rescued = true
      end

      rescued.should be_true
      ex.backtrace.first.should include("[remote server]")
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
browserstack-webdriver-2.40.1 spec/integration/selenium/webdriver/error_spec.rb
browserstack-webdriver-0.0.22 spec/integration/selenium/webdriver/error_spec.rb
browserstack-webdriver-0.0.1 spec/integration/selenium/webdriver/error_spec.rb
bbc-selenium-webdriver-1.17.0 spec/integration/selenium/webdriver/error_spec.rb