Skip to content

Commit

Permalink
rb - fix Error errors
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Mar 12, 2016
1 parent 1e255d2 commit 85eadf5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion rb/lib/selenium/webdriver/common/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def for_code(code)
return Errors[code - 1] if code.is_a? Fixnum

klass_name = code.split(' ').map(&:capitalize).join
Error.const_get("#{klass_name}Error")
Error.const_get("#{klass_name.gsub('Error','')}Error")
rescue NameError
WebDriverError
end
Expand Down
16 changes: 8 additions & 8 deletions rb/lib/selenium/webdriver/remote/w3c_bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def setWindowSize(width, height, handle = :current)

def maximizeWindow(handle = :current)
unless handle == :current
raise Error::WebDriverError, 'Switch to desired window before changing its size'
raise Error::UnsupportedOperationError, 'Switch to desired window before changing its size'
end
execute :maximizeWindow
end
Expand All @@ -264,19 +264,19 @@ def fullscreenWindow

def getWindowSize(handle = :current)
unless handle == :current
raise Error::WebDriverError, 'Switch to desired window before getting its size'
raise Error::UnsupportedOperationError, 'Switch to desired window before getting its size'
end
data = execute :getWindowSize

Dimension.new data['width'], data['height']
end

def setWindowPosition(_x, _y, _handle = nil)
raise Error::WebDriverError::UnsupportedOperationError, 'The W3C standard does not currently support setting the Window Position'
raise Error::UnsupportedOperationError, 'The W3C standard does not currently support setting the Window Position'
end

def getWindowPosition(_handle = nil)
raise Error::WebDriverError::UnsupportedOperationError, 'The W3C standard does not currently support getting the Window Position'
raise Error::UnsupportedOperationError, 'The W3C standard does not currently support getting the Window Position'
end

def getScreenshot
Expand Down Expand Up @@ -336,19 +336,19 @@ def getSessionStorageSize
end

def getLocation
raise Error::WebDriverError::UnsupportedOperationError, 'The W3C standard does not currently support getting location'
raise Error::UnsupportedOperationError, 'The W3C standard does not currently support getting location'
end

def setLocation(_lat, _lon, _alt)
raise Error::WebDriverError::UnsupportedOperationError, 'The W3C standard does not currently support setting location'
raise Error::UnsupportedOperationError, 'The W3C standard does not currently support setting location'
end

def getNetworkConnection
raise Error::WebDriverError::UnsupportedOperationError, 'The W3C standard does not currently support getting network connection'
raise Error::UnsupportedOperationError, 'The W3C standard does not currently support getting network connection'
end

def setNetworkConnection(_type)
raise Error::WebDriverError::UnsupportedOperationError, 'The W3C standard does not currently support setting network connection'
raise Error::UnsupportedOperationError, 'The W3C standard does not currently support setting network connection'
end

#
Expand Down

0 comments on commit 85eadf5

Please sign in to comment.