Fix example code in README.md

The console methods `console_messages` and `error_messages` each return
an array of messages.
This commit is contained in:
Ryunosuke SATO 2013-12-20 16:22:15 -05:00 committed by Joe Ferris
parent ce1b2366e1
commit 3f011c2684
1 changed files with 2 additions and 2 deletions

View File

@ -91,14 +91,14 @@ console.log("hello")
```ruby
# In Ruby:
page.driver.console_messages
=> {:source=>"http://example.com", :line_number=>1, :message=>"hello"}
=> [{:source=>"http://example.com", :line_number=>1, :message=>"hello"}]
```
**error_messages**: returns an array of Javascript errors that occurred
```ruby
page.driver.error_messages
=> {:source=>"http://example.com", :line_number=>1, :message=>"SyntaxError: Parse error"}
=> [{:source=>"http://example.com", :line_number=>1, :message=>"SyntaxError: Parse error"}]
```
**alert_messages, confirm_messages, prompt_messages**: returns arrays of Javascript dialog messages for each dialog type