Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/Selenium2Library/keywords/browsermanagement.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,18 @@ def select_window(self, locator=None):
pass
finally:
self._window_manager.select(self.browser, locator)

@keyword
def get_log(self, log_type):
"""Get the log for a given selenium log type

The `log_type` argument defines which logs to get. Possible values are:
`browser`, `driver`, `client` or `server`

New in SeleniumLibrary 3.0
"""
return self.browser.get_log(log_type)


@keyword
def list_windows(self):
Expand Down
8 changes: 8 additions & 0 deletions test/acceptance/keywords/javascript.robot
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,11 @@ Drag and Drop by Offset
Element Text Should Be id=droppable Drop here
Drag and Drop by Offset id=draggable ${100} ${20}
Element Text Should Be id=droppable Dropped!

Verify Console Log Can be Caught
[Tags] Known Issue - Firefox
${message} Set Variable Sample Console Error
Execute Javascript console.error('${message}')
${logs}= Get Log browser
${err}= Convert To string ${logs}
Should Contain ${err} ${message}
2 changes: 2 additions & 0 deletions test/resources/html/javascript/dynamic_content.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Original</title>
<script type="text/javascript">
function add_content(target_container, content) {
Expand Down