| Home | Trees | Index | Help |
|---|
|
|
Defines an object that runs Selenium commands.
Element Locators tell Selenium which HTML element a command refers to. The format of a locator is:
locatorType=argument
We support the following strategies for locating elements:
identifier=id: Select the element with the specified @id attribute. If no match is found, select the first element whose @name attribute is id. (This is normally the default; see below.)
id=id: Select the element with the specified @id attribute.
name=name: Select the first element with the specified @name attribute.
The name may optionally be followed by one or more element-filters, separated from the name by whitespace. If the filterType is not specified, value is assumed.
dom=javascriptExpression:
Find an element by evaluating the specified string. This allows you to traverse the HTML Document Object Model using JavaScript. Note that you must not return a value in this string; simply make it the last expression in the block.
xpath=xpathExpression: Locate an element using an XPath expression.
link=textPattern: Select the link (anchor) element which contains text matching the specified pattern.
css=cssSelectorSyntax: Select the element using css selectors. Please refer to CSS2 selectors, CSS3 selectors for more information. You can also check the TestCssLocators test in the selenium test suite for an example of usage, which is included in the downloaded selenium core package.
Currently the css selector locator supports all css1, css2 and css3 selectors except namespace in css3, some pseudo classes(:nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type, :only-of-type, :visited, :hover, :active, :focus, :indeterminate) and pseudo elements(::first-line, ::first-letter, ::selection, ::before, ::after).
ui=uiSpecifierString: Locate an element by resolving the UI specifier string to another locator, and evaluating it. See the Selenium UI-Element Reference for more details.
Without an explicit locator prefix, Selenium uses the following default strategies:
Element filters can be used with a locator to refine a list of candidate elements. They are currently used only in the 'name' element-locator.
Filters look much like locators, ie.
filterType=argument
Supported element-filters are:
value=valuePattern
Matches elements based on their values. This is particularly useful for refining a list of similarly-named toggle-buttons.
index=index
Selects a single element based on its position in the list (offset from zero).
Various Pattern syntaxes are available for matching string values:
glob:pattern: Match a string against a "glob" (aka "wildmat") pattern. "Glob" is a kind of limited regular-expression syntax typically used in command-line shells. In a glob pattern, "*" represents any sequence of characters, and "?" represents any single character. Glob patterns match against the entire string.
regexp:regexp: Match a string using a regular-expression. The full power of JavaScript regular-expressions is available.
regexpi:regexpi: Match a string using a case-insensitive regular-expression.
exact:string:
Match a string exactly, verbatim, without any of that fancy wildcard stuff.
If no pattern prefix is specified, Selenium assumes that it's a "glob" pattern.
For commands that return multiple values (such as verifySelectOptions), the string being matched is a comma-separated list of the return values, where both commas and backslashes in the values are backslash-escaped. When providing a pattern, the optional matching syntax (i.e. glob, regexp, etc.) is specified once, as usual, at the beginning of the pattern.
|
|||
| __init__(self, host, port, browserStartCommand, browserURL) | |||
| setExtensionJs(self, extensionJs) | |||
| start(self) | |||
| stop(self) | |||
| do_command(self, verb, args) | |||
| get_string(self, verb, args) | |||
| get_string_array(self, verb, args) | |||
| get_number(self, verb, args) | |||
| get_number_array(self, verb, args) | |||
| get_boolean(self, verb, args) | |||
| get_boolean_array(self, verb, args) | |||
|
click(self,
locator)
Clicks on a link, button, checkbox or radio button. |
|||
|
double_click(self,
locator)
Double clicks on a link, button, checkbox or radio button. |
|||
|
context_menu(self,
locator)
Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element). |
|||
|
click_at(self,
locator,
coordString)
Clicks on a link, button, checkbox or radio button. |
|||
|
double_click_at(self,
locator,
coordString)
Doubleclicks on a link, button, checkbox or radio button. |
|||
|
context_menu_at(self,
locator,
coordString)
Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element). |
|||
|
fire_event(self,
locator,
eventName)
Explicitly simulate an event, to trigger the corresponding "onevent" handler. |
|||
|
focus(self,
locator)
Move the focus to the specified element; for example, if the element is an input field, move the cursor to that field. |
|||
|
key_press(self,
locator,
keySequence)
Simulates a user pressing and releasing a key. |
|||
|
shift_key_down(self)
Press the shift key and hold it down until doShiftUp() is called or a new page is loaded. |
|||
|
shift_key_up(self)
Release the shift key. |
|||
|
meta_key_down(self)
Press the meta key and hold it down until doMetaUp() is called or a new page is loaded. |
|||
|
meta_key_up(self)
Release the meta key. |
|||
|
alt_key_down(self)
Press the alt key and hold it down until doAltUp() is called or a new page is loaded. |
|||
|
alt_key_up(self)
Release the alt key. |
|||
|
control_key_down(self)
Press the control key and hold it down until doControlUp() is called or a new page is loaded. |
|||
|
control_key_up(self)
Release the control key. |
|||
|
key_down(self,
locator,
keySequence)
Simulates a user pressing a key (without releasing it yet). |
|||
|
key_up(self,
locator,
keySequence)
Simulates a user releasing a key. |
|||
|
mouse_over(self,
locator)
Simulates a user hovering a mouse over the specified element. |
|||
|
mouse_out(self,
locator)
Simulates a user moving the mouse pointer away from the specified element. |
|||
|
mouse_down(self,
locator)
Simulates a user pressing the left mouse button (without releasing it yet) on the specified element. |
|||
|
mouse_down_right(self,
locator)
Simulates a user pressing the right mouse button (without releasing it yet) on the specified element. |
|||
|
mouse_down_at(self,
locator,
coordString)
Simulates a user pressing the left mouse button (without releasing it yet) at the specified location. |
|||
|
mouse_down_right_at(self,
locator,
coordString)
Simulates a user pressing the right mouse button (without releasing it yet) at the specified location. |
|||
|
mouse_up(self,
locator)
Simulates the event that occurs when the user releases the mouse button (i.e., stops holding the button down) on the specified element. |
|||
|
mouse_up_right(self,
locator)
Simulates the event that occurs when the user releases the right mouse button (i.e., stops holding the button down) on the specified element. |
|||
|
mouse_up_at(self,
locator,
coordString)
Simulates the event that occurs when the user releases the mouse button (i.e., stops holding the button down) at the specified location. |
|||
|
mouse_up_right_at(self,
locator,
coordString)
Simulates the event that occurs when the user releases the right mouse button (i.e., stops holding the button down) at the specified location. |
|||
|
mouse_move(self,
locator)
Simulates a user pressing the mouse button (without releasing it yet) on the specified element. |
|||
|
mouse_move_at(self,
locator,
coordString)
Simulates a user pressing the mouse button (without releasing it yet) on the specified element. |
|||
|
type(self,
locator,
value)
Sets the value of an input field, as though you typed it in. |
|||
|
type_keys(self,
locator,
value)
Simulates keystroke events on the specified element, as though you typed the value key-by-key. |
|||
|
set_speed(self,
value)
Set execution speed (i.e., set the millisecond length of a delay which will follow each selenium operation). |
|||
|
get_speed(self)
Get execution speed (i.e., get the millisecond length of the delay following each selenium operation). |
|||
|
check(self,
locator)
Check a toggle-button (checkbox/radio) |
|||
|
uncheck(self,
locator)
Uncheck a toggle-button (checkbox/radio) |
|||
|
select(self,
selectLocator,
optionLocator)
Select an option from a drop-down using an option locator. |
|||
|
add_selection(self,
locator,
optionLocator)
Add a selection to the set of selected options in a multi-select element using an option locator. |
|||
|
remove_selection(self,
locator,
optionLocator)
Remove a selection from the set of selected options in a multi-select element using an option locator. |
|||
|
remove_all_selections(self,
locator)
Unselects all of the selected options in a multi-select element. |
|||
|
submit(self,
formLocator)
Submit the specified form. |
|||
|
open(self,
url)
Opens an URL in the test frame. |
|||
|
open_window(self,
url,
windowID)
Opens a popup window (if a window with that ID isn't already open). |
|||
|
select_window(self,
windowID)
Selects a popup window using a window locator; once a popup window has been selected, all commands go to that window. |
|||
|
select_pop_up(self,
windowID)
Simplifies the process of selecting a popup window (and does not offer functionality beyond what selectWindow() already provides). |
|||
|
deselect_pop_up(self)
Selects the main window. |
|||
|
select_frame(self,
locator)
Selects a frame within the current window. |
|||
|
get_whether_this_frame_match_frame_expression(self,
currentFrameString,
target)
Determine whether current/locator identify the frame containing this running code. |
|||
|
get_whether_this_window_match_window_expression(self,
currentWindowString,
target)
Determine whether currentWindowString plus target identify the window containing this running code. |
|||
|
wait_for_pop_up(self,
windowID,
timeout)
Waits for a popup window to appear and load up. |
|||
|
choose_cancel_on_next_confirmation(self)
By default, Selenium's overridden window.confirm() function will return true, as if the user had manually clicked OK; after running this command, the next call to confirm() will return false, as if the user had clicked Cancel. |
|||
|
choose_ok_on_next_confirmation(self)
Undo the effect of calling chooseCancelOnNextConfirmation. |
|||
|
answer_on_next_prompt(self,
answer)
Instructs Selenium to return the specified answer string in response to the next JavaScript prompt [window.prompt()]. |
|||
|
go_back(self)
Simulates the user clicking the "back" button on their browser. |
|||
|
refresh(self)
Simulates the user clicking the "Refresh" button on their browser. |
|||
|
close(self)
Simulates the user clicking the "close" button in the titlebar of a popup window or tab. |
|||
|
is_alert_present(self)
Has an alert occurred? |
|||
|
is_prompt_present(self)
Has a prompt occurred? |
|||
|
is_confirmation_present(self)
Has confirm() been called? |
|||
|
get_alert(self)
Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts. |
|||
|
get_confirmation(self)
Retrieves the message of a JavaScript confirmation dialog generated during the previous action. |
|||
|
get_prompt(self)
Retrieves the message of a JavaScript question prompt dialog generated during the previous action. |
|||
|
get_location(self)
Gets the absolute URL of the current page. |
|||
|
get_title(self)
Gets the title of the current page. |
|||
|
get_body_text(self)
Gets the entire text of the page. |
|||
|
get_value(self,
locator)
Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter). |
|||
|
get_text(self,
locator)
Gets the text of an element. |
|||
|
highlight(self,
locator)
Briefly changes the backgroundColor of the specified element yellow. |
|||
|
get_eval(self,
script)
Gets the result of evaluating the specified JavaScript snippet. |
|||
|
is_checked(self,
locator)
Gets whether a toggle-button (checkbox/radio) is checked. |
|||
|
get_table(self,
tableCellAddress)
Gets the text from a cell of a table. |
|||
|
get_selected_labels(self,
selectLocator)
Gets all option labels (visible text) for selected options in the specified select or multi-select element. |
|||
|
get_selected_label(self,
selectLocator)
Gets option label (visible text) for selected option in the specified select element. |
|||
|
get_selected_values(self,
selectLocator)
Gets all option values (value attributes) for selected options in the specified select or multi-select element. |
|||
|
get_selected_value(self,
selectLocator)
Gets option value (value attribute) for selected option in the specified select element. |
|||
|
get_selected_indexes(self,
selectLocator)
Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element. |
|||
|
get_selected_index(self,
selectLocator)
Gets option index (option number, starting at 0) for selected option in the specified select element. |
|||
|
get_selected_ids(self,
selectLocator)
Gets all option element IDs for selected options in the specified select or multi-select element. |
|||
|
get_selected_id(self,
selectLocator)
Gets option element ID for selected option in the specified select element. |
|||
|
is_something_selected(self,
selectLocator)
Determines whether some option in a drop-down menu is selected. |
|||
|
get_select_options(self,
selectLocator)
Gets all option labels in the specified select drop-down. |
|||
|
get_attribute(self,
attributeLocator)
Gets the value of an element attribute. |
|||
|
is_text_present(self,
pattern)
Verifies that the specified text pattern appears somewhere on the rendered page shown to the user. |
|||
|
is_element_present(self,
locator)
Verifies that the specified element is somewhere on the page. |
|||
|
is_visible(self,
locator)
Determines if the specified element is visible. |
|||
|
is_editable(self,
locator)
Determines whether the specified input element is editable, ie hasn't been disabled. |
|||
|
get_all_buttons(self)
Returns the IDs of all buttons on the page. |
|||
|
get_all_links(self)
Returns the IDs of all links on the page. |
|||
|
get_all_fields(self)
Returns the IDs of all input fields on the page. |
|||
|
get_attribute_from_all_windows(self,
attributeName)
Returns every instance of some attribute from all known windows. |
|||
|
dragdrop(self,
locator,
movementsString)
deprecated - use dragAndDrop instead |
|||
|
set_mouse_speed(self,
pixels)
Configure the number of pixels between "mousemove" events during dragAndDrop commands (default=10). |
|||
|
get_mouse_speed(self)
Returns the number of pixels between "mousemove" events during dragAndDrop commands (default=10). |
|||
|
drag_and_drop(self,
locator,
movementsString)
Drags an element a certain distance and then drops it |
|||
|
drag_and_drop_to_object(self,
locatorOfObjectToBeDragged,
locatorOfDragDestinationObject)
Drags an element and drops it on another element |
|||
|
window_focus(self)
Gives focus to the currently selected window |
|||
|
window_maximize(self)
Resize currently selected window to take up the entire screen |
|||
|
get_all_window_ids(self)
Returns the IDs of all windows that the browser knows about. |
|||
|
get_all_window_names(self)
Returns the names of all windows that the browser knows about. |
|||
|
get_all_window_titles(self)
Returns the titles of all windows that the browser knows about. |
|||
|
get_html_source(self)
Returns the entire HTML source between the opening and closing "html" tags. |
|||
|
set_cursor_position(self,
locator,
position)
Moves the text cursor to the specified position in the given input element or textarea. |
|||
|
get_element_index(self,
locator)
Get the relative index of an element to its parent (starting from 0). |
|||
|
is_ordered(self,
locator1,
locator2)
Check if these two elements have same parent and are ordered siblings in the DOM. |
|||
|
get_element_position_left(self,
locator)
Retrieves the horizontal position of an element |
|||
|
get_element_position_top(self,
locator)
Retrieves the vertical position of an element |
|||
|
get_element_width(self,
locator)
Retrieves the width of an element |
|||
|
get_element_height(self,
locator)
Retrieves the height of an element |
|||
|
get_cursor_position(self,
locator)
Retrieves the text cursor position in the given input element or textarea; beware, this may not work perfectly on all browsers. |
|||
|
get_expression(self,
expression)
Returns the specified expression. |
|||
|
get_xpath_count(self,
xpath)
Returns the number of nodes that match the specified xpath, eg. |
|||
|
assign_id(self,
locator,
identifier)
Temporarily sets the "id" attribute of the specified element, so you can locate it in the future using its ID rather than a slow/complicated XPath. |
|||
|
allow_native_xpath(self,
allow)
Specifies whether Selenium should use the native in-browser implementation of XPath (if any native version is available); if you pass "false" to this function, we will always use our pure-JavaScript xpath library. |
|||
|
ignore_attributes_without_value(self,
ignore)
Specifies whether Selenium will ignore xpath attributes that have no value, i.e. |
|||
|
wait_for_condition(self,
script,
timeout)
Runs the specified JavaScript snippet repeatedly until it evaluates to "true". |
|||
|
set_timeout(self,
timeout)
Specifies the amount of time that Selenium will wait for actions to complete. |
|||
|
wait_for_page_to_load(self,
timeout)
Waits for a new page to load. |
|||
|
wait_for_frame_to_load(self,
frameAddress,
timeout)
Waits for a new frame to load. |
|||
|
get_cookie(self)
Return all cookies of the current page under test. |
|||
|
get_cookie_by_name(self,
name)
Returns the value of the cookie with the specified name, or throws an error if the cookie is not present. |
|||
|
is_cookie_present(self,
name)
Returns true if a cookie with the specified name is present, or false otherwise. |
|||
|
create_cookie(self,
nameValuePair,
optionsString)
Create a new cookie whose path and domain are same with those of current page under test, unless you specified a path for this cookie explicitly. |
|||
|
delete_cookie(self,
name,
optionsString)
Delete a named cookie with specified path and domain. |
|||
|
delete_all_visible_cookies(self)
Calls deleteCookie with recurse=true on all cookies visible to the current page. |
|||
|
set_browser_log_level(self,
logLevel)
Sets the threshold for browser-side logging messages; log messages beneath this threshold will be discarded. |
|||
|
run_script(self,
script)
Creates a new "script" tag in the body of the current test window, and adds the specified text into the body of the command. |
|||
|
add_location_strategy(self,
strategyName,
functionDefinition)
Defines a new function for Selenium to locate elements on the page. |
|||
|
capture_entire_page_screenshot(self,
filename,
kwargs)
Saves the entire contents of the current window canvas to a PNG file. |
|||
|
rollup(self,
rollupName,
kwargs)
Executes a command rollup, which is a series of commands with a unique name, and optionally arguments that control the generation of the set of commands. |
|||
|
add_script(self,
scriptContent,
scriptTagId)
Loads script content into a new script tag in the Selenium document. |
|||
|
remove_script(self,
scriptTagId)
Removes a script tag from the Selenium document identified by the given id. |
|||
|
use_xpath_library(self,
libraryName)
Allows choice of one of the available libraries. |
|||
|
set_context(self,
context)
Writes a message to the status bar and adds a note to the browser-side log. |
|||
|
attach_file(self,
fieldLocator,
fileLocator)
Sets a file input (upload) field to the file listed in fileLocator |
|||
|
capture_screenshot(self,
filename)
Captures a PNG screenshot to the specified file. |
|||
|
capture_screenshot_to_string(self)
Capture a PNG screenshot. |
|||
|
captureNetworkTraffic(self,
type)
Returns the network traffic seen by the browser, including headers, AJAX requests, status codes, and timings. |
|||
|
addCustomRequestHeader(self,
key,
value)
Tells the Selenium server to add the specificed key and value as a custom outgoing request header. |
|||
|
capture_entire_page_screenshot_to_string(self,
kwargs)
Downloads a screenshot of the browser current window canvas to a based 64 encoded PNG file. |
|||
|
shut_down_selenium_server(self)
Kills the running Selenium Server and all browser sessions. |
|||
|
retrieve_last_remote_control_logs(self)
Retrieve the last messages logged on a specific remote control. |
|||
|
key_down_native(self,
keycode)
Simulates a user pressing a key (without releasing it yet) by sending a native operating system keystroke. |
|||
|
key_up_native(self,
keycode)
Simulates a user releasing a key by sending a native operating system keystroke. |
|||
|
key_press_native(self,
keycode)
Simulates a user pressing and releasing a key by sending a native operating system keystroke. |
|
|
|
|
|
|
|
|
|
|
|
|
Clicks on a link, button, checkbox or radio button. If the click action causes a new page to load (like a link usually does), call waitForPageToLoad. 'locator' is an element locator |
Double clicks on a link, button, checkbox or radio button. If the double click action causes a new page to load (like a link usually does), call waitForPageToLoad. 'locator' is an element locator |
Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element). 'locator' is an element locator |
Clicks on a link, button, checkbox or radio button. If the click action causes a new page to load (like a link usually does), call waitForPageToLoad. 'locator' is an element locator 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. |
Doubleclicks on a link, button, checkbox or radio button. If the action causes a new page to load (like a link usually does), call waitForPageToLoad. 'locator' is an element locator 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. |
Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element). 'locator' is an element locator 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. |
Explicitly simulate an event, to trigger the corresponding "onevent" handler. 'locator' is an element locator 'eventName' is the event name, e.g. "focus" or "blur" |
Move the focus to the specified element; for example, if the element is an input field, move the cursor to that field. 'locator' is an element locator |
Simulates a user pressing and releasing a key. 'locator' is an element locator 'keySequence' is Either be a string("" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", " 9". |
|
|
|
|
|
|
|
|
Simulates a user pressing a key (without releasing it yet). 'locator' is an element locator 'keySequence' is Either be a string("" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", " 9". |
Simulates a user releasing a key. 'locator' is an element locator 'keySequence' is Either be a string("" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", " 9". |
Simulates a user hovering a mouse over the specified element. 'locator' is an element locator |
Simulates a user moving the mouse pointer away from the specified element. 'locator' is an element locator |
Simulates a user pressing the left mouse button (without releasing it yet) on the specified element. 'locator' is an element locator |
Simulates a user pressing the right mouse button (without releasing it yet) on the specified element. 'locator' is an element locator |
Simulates a user pressing the left mouse button (without releasing it yet) at the specified location. 'locator' is an element locator 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. |
Simulates a user pressing the right mouse button (without releasing it yet) at the specified location. 'locator' is an element locator 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. |
Simulates the event that occurs when the user releases the mouse button (i.e., stops holding the button down) on the specified element. 'locator' is an element locator |
Simulates the event that occurs when the user releases the right mouse button (i.e., stops holding the button down) on the specified element. 'locator' is an element locator |
Simulates the event that occurs when the user releases the mouse button (i.e., stops holding the button down) at the specified location. 'locator' is an element locator 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. |
Simulates the event that occurs when the user releases the right mouse button (i.e., stops holding the button down) at the specified location. 'locator' is an element locator 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. |
Simulates a user pressing the mouse button (without releasing it yet) on the specified element. 'locator' is an element locator |
Simulates a user pressing the mouse button (without releasing it yet) on the specified element. 'locator' is an element locator 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. |
Sets the value of an input field, as though you typed it in. Can also be used to set the value of combo boxes, check boxes, etc. In these cases, value should be the value of the option selected, not the visible text. 'locator' is an element locator 'value' is the value to type |
Simulates keystroke events on the specified element, as though you typed the value key-by-key. This is a convenience method for calling keyDown, keyUp, keyPress for every character in the specified string; this is useful for dynamic UI widgets (like auto-completing combo boxes) that require explicit key events. Unlike the simple "type" command, which forces the specified value into the page directly, this command may or may not have any visible effect, even in cases where typing keys would normally have a visible effect. For example, if you use "typeKeys" on a form element, you may or may not see the results of what you typed in the field. In some cases, you may need to use the simple "type" command to set the value of the field and then the "typeKeys" command to send the keystroke events corresponding to what you just typed. 'locator' is an element locator 'value' is the value to type |
Set execution speed (i.e., set the millisecond length of a delay which will follow each selenium operation). By default, there is no such delay, i.e., the delay is 0 milliseconds. 'value' is the number of milliseconds to pause after operation |
Get execution speed (i.e., get the millisecond length of the delay following each selenium operation). By default, there is no such delay, i.e., the delay is 0 milliseconds. See also setSpeed. |
Check a toggle-button (checkbox/radio) 'locator' is an element locator |
Uncheck a toggle-button (checkbox/radio) 'locator' is an element locator |
Select an option from a drop-down using an option locator. Option locators provide different ways of specifying options of an HTML Select element (e.g. for selecting a specific option, or for asserting that the selected option satisfies a specification). There are several forms of Select Option Locator.
If no option locator prefix is provided, the default behaviour is to match on label. 'selectLocator' is an element locator identifying a drop-down menu 'optionLocator' is an option locator (a label by default) |
Add a selection to the set of selected options in a multi-select element using an option locator. @see #doSelect for details of option locators 'locator' is an element locator identifying a multi-select box 'optionLocator' is an option locator (a label by default) |
Remove a selection from the set of selected options in a multi-select element using an option locator. @see #doSelect for details of option locators 'locator' is an element locator identifying a multi-select box 'optionLocator' is an option locator (a label by default) |
Unselects all of the selected options in a multi-select element. 'locator' is an element locator identifying a multi-select box |
Submit the specified form. This is particularly useful for forms without submit buttons, e.g. single-input "Search" forms. 'formLocator' is an element locator for the form you want to submit |
Opens an URL in the test frame. This accepts both relative and absolute URLs. The "open" command waits for the page to load before proceeding, ie. the "AndWait" suffix is implicit. Note: The URL must be on the same domain as the runner HTML due to security restrictions in the browser (Same Origin Policy). If you need to open an URL on another domain, use the Selenium Server to start a new browser session on that domain. 'url' is the URL to open; may be relative or absolute |
Opens a popup window (if a window with that ID isn't already open). After opening the window, you'll need to select it using the selectWindow command. This command can also be a useful workaround for bug SEL-339. In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using an empty (blank) url, like this: openWindow("", "myFunnyWindow"). 'url' is the URL to open, which can be blank 'windowID' is the JavaScript window ID of the window to select |
Selects a popup window using a window locator; once a popup window has been selected, all commands go to that window. To select the main window again, use null as the target. Window locators provide different ways of specifying the window object: by title, by internal JavaScript "name," or by JavaScript variable.
If no window locator prefix is provided, we'll try to guess what you mean like this: 1.) if windowID is null, (or the string "null") then it is assumed the user is referring to the original window instantiated by the browser). 2.) if the value of the "windowID" parameter is a JavaScript variable name in the current application window, then it is assumed that this variable contains the return value from a call to the JavaScript window.open() method. 3.) Otherwise, selenium looks in a hash it maintains that maps string names to window "names". 4.) If that fails, we'll try looping over all of the known windows to try to find the appropriate "title". Since "title" is not necessarily unique, this may have unexpected behavior. If you're having trouble figuring out the name of a window that you want to manipulate, look at the Selenium log messages which identify the names of windows created via window.open (and therefore intercepted by Selenium). You will see messages like the following for each window as it is opened: debug: window.open call intercepted; window ID (which you can use with selectWindow()) is "myNewWindow" In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). (This is bug SEL-339.) In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using an empty (blank) url, like this: openWindow("", "myFunnyWindow"). 'windowID' is the JavaScript window ID of the window to select |
Simplifies the process of selecting a popup window (and does not offer functionality beyond what selectWindow() already provides).
'windowID' is an identifier for the popup window, which can take on a number of different meanings |
|
Selects a frame within the current window. (You may invoke this command multiple times to select nested frames.) To select the parent frame, use "relative=parent" as a locator; to select the top frame, use "relative=top". You can also select a frame by its 0-based index number; select the first frame with "index=0", or the third frame with "index=2". You may also use a DOM expression to identify the frame you want directly, like this: dom=frames["main"].frames["subframe"] 'locator' is an element locator identifying a frame or iframe |
Determine whether current/locator identify the frame containing this running code. This is useful in proxy injection mode, where this code runs in every browser frame and window, and sometimes the selenium server needs to identify the "current" frame. In this case, when the test calls selectFrame, this routine is called for each frame to figure out which one has been selected. The selected frame will return true, while all others will return false. 'currentFrameString' is starting frame 'target' is new frame (which might be relative to the current one) |
Determine whether currentWindowString plus target identify the window containing this running code. This is useful in proxy injection mode, where this code runs in every browser frame and window, and sometimes the selenium server needs to identify the "current" window. In this case, when the test calls selectWindow, this routine is called for each window to figure out which one has been selected. The selected window will return true, while all others will return false. 'currentWindowString' is starting window 'target' is new window (which might be relative to the current one, e.g., "_parent") |
Waits for a popup window to appear and load up. 'windowID' is the JavaScript window "name" of the window that will appear (not the text of the title bar) If unspecified, or specified as "null", this command will wait for the first non-top window to appear (don't rely on this if you are working with multiple popups simultaneously). 'timeout' is a timeout in milliseconds, after which the action will return with an error. If this value is not specified, the default Selenium timeout will be used. See the setTimeout() command. |
By default, Selenium's overridden window.confirm() function will return true, as if the user had manually clicked OK; after running this command, the next call to confirm() will return false, as if the user had clicked Cancel. Selenium will then resume using the default behavior for future confirmations, automatically returning true (OK) unless/until you explicitly call this command for each confirmation. Take note - every time a confirmation comes up, you must consume it with a corresponding getConfirmation, or else the next selenium operation will fail. |
Undo the effect of calling chooseCancelOnNextConfirmation. Note that Selenium's overridden window.confirm() function will normally automatically return true, as if the user had manually clicked OK, so you shouldn't need to use this command unless for some reason you need to change your mind prior to the next confirmation. After any confirmation, Selenium will resume using the default behavior for future confirmations, automatically returning true (OK) unless/until you explicitly call chooseCancelOnNextConfirmation for each confirmation. Take note - every time a confirmation comes up, you must consume it with a corresponding getConfirmation, or else the next selenium operation will fail. |
Instructs Selenium to return the specified answer string in response to the next JavaScript prompt [window.prompt()]. 'answer' is the answer to give in response to the prompt pop-up |
|
|
|
Has an alert occurred? This function never throws an exception |
Has a prompt occurred? This function never throws an exception |
Has confirm() been called? This function never throws an exception |
Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts. Getting an alert has the same effect as manually clicking OK. If an alert is generated but you do not consume it with getAlert, the next Selenium action will fail. Under Selenium, JavaScript alerts will NOT pop up a visible alert dialog. Selenium does NOT support JavaScript alerts that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until someone manually clicks OK. |
Retrieves the message of a JavaScript confirmation dialog generated during the previous action. By default, the confirm function will return true, having the same effect as manually clicking OK. This can be changed by prior execution of the chooseCancelOnNextConfirmation command. If an confirmation is generated but you do not consume it with getConfirmation, the next Selenium action will fail. NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible dialog. NOTE: Selenium does NOT support JavaScript confirmations that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until you manually click OK. |
Retrieves the message of a JavaScript question prompt dialog generated during the previous action. Successful handling of the prompt requires prior execution of the answerOnNextPrompt command. If a prompt is generated but you do not get/verify it, the next Selenium action will fail. NOTE: under Selenium, JavaScript prompts will NOT pop up a visible dialog. NOTE: Selenium does NOT support JavaScript prompts that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until someone manually clicks OK. |
|
|
|
Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter). For checkbox/radio elements, the value will be "on" or "off" depending on whether the element is checked or not. 'locator' is an element locator |
Gets the text of an element. This works for any element that contains text. This command uses either the textContent (Mozilla-like browsers) or the innerText (IE-like browsers) of the element, which is the rendered text shown to the user. 'locator' is an element locator |
Briefly changes the backgroundColor of the specified element yellow. Useful for debugging. 'locator' is an element locator |
Gets the result of evaluating the specified JavaScript snippet. The snippet may have multiple lines, but only the result of the last line will be returned. Note that, by default, the snippet will run in the context of the "selenium" object itself, so this will refer to the Selenium object. Use window to refer to the window of your application, e.g. window.document.getElementById('foo') If you need to use a locator to refer to a single element in your application page, you can use this.browserbot.findElement("id=foo") where "id=foo" is your locator. 'script' is the JavaScript snippet to run |
Gets whether a toggle-button (checkbox/radio) is checked. Fails if the specified element doesn't exist or isn't a toggle-button. 'locator' is an element locator pointing to a checkbox or radio button |
Gets the text from a cell of a table. The cellAddress syntax tableLocator.row.column, where row and column start at 0. 'tableCellAddress' is a cell address, e.g. "foo.1.4" |
Gets all option labels (visible text) for selected options in the specified select or multi-select element. 'selectLocator' is an element locator identifying a drop-down menu |
Gets option label (visible text) for selected option in the specified select element. 'selectLocator' is an element locator identifying a drop-down menu |
Gets all option values (value attributes) for selected options in the specified select or multi-select element. 'selectLocator' is an element locator identifying a drop-down menu |
Gets option value (value attribute) for selected option in the specified select element. 'selectLocator' is an element locator identifying a drop-down menu |
Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element. 'selectLocator' is an element locator identifying a drop-down menu |
Gets option index (option number, starting at 0) for selected option in the specified select element. 'selectLocator' is an element locator identifying a drop-down menu |
Gets all option element IDs for selected options in the specified select or multi-select element. 'selectLocator' is an element locator identifying a drop-down menu |
Gets option element ID for selected option in the specified select element. 'selectLocator' is an element locator identifying a drop-down menu |
Determines whether some option in a drop-down menu is selected. 'selectLocator' is an element locator identifying a drop-down menu |
Gets all option labels in the specified select drop-down. 'selectLocator' is an element locator identifying a drop-down menu |
Gets the value of an element attribute. The value of the attribute may differ across browsers (this is the case for the "style" attribute, for example). 'attributeLocator' is an element locator followed by an @ sign and then the name of the attribute, e.g. "foo@bar" |
Verifies that the specified text pattern appears somewhere on the rendered page shown to the user. 'pattern' is a pattern to match with the text of the page |
Verifies that the specified element is somewhere on the page. 'locator' is an element locator |
Determines if the specified element is visible. An element can be rendered invisible by setting the CSS "visibility" property to "hidden", or the "display" property to "none", either for the element itself or one if its ancestors. This method will fail if the element is not present. 'locator' is an element locator |
Determines whether the specified input element is editable, ie hasn't been disabled. This method will fail if the specified element isn't an input element. 'locator' is an element locator |
Returns the IDs of all buttons on the page. If a given button has no ID, it will appear as "" in this array. |
Returns the IDs of all links on the page. If a given link has no ID, it will appear as "" in this array. |
Returns the IDs of all input fields on the page. If a given field has no ID, it will appear as "" in this array. |
Returns every instance of some attribute from all known windows. 'attributeName' is name of an attribute on the windows |
deprecated - use dragAndDrop instead 'locator' is an element locator 'movementsString' is offset in pixels from the current location to which the element should be moved, e.g., "+70,-300" |
Configure the number of pixels between "mousemove" events during dragAndDrop commands (default=10). Setting this value to 0 means that we'll send a "mousemove" event to every single pixel in between the start location and the end location; that can be very slow, and may cause some browsers to force the JavaScript to timeout. If the mouse speed is greater than the distance between the two dragged objects, we'll just send one "mousemove" at the start location and then one final one at the end location. 'pixels' is the number of pixels between "mousemove" events |
|
Drags an element a certain distance and then drops it 'locator' is an element locator 'movementsString' is offset in pixels from the current location to which the element should be moved, e.g., "+70,-300" |
Drags an element and drops it on another element 'locatorOfObjectToBeDragged' is an element to be dragged 'locatorOfDragDestinationObject' is an element whose location (i.e., whose center-most pixel) will be the point where locatorOfObjectToBeDragged is dropped |
|
|
|
|
|
|
Moves the text cursor to the specified position in the given input element or textarea. This method will fail if the specified element isn't an input element or textarea. 'locator' is an element locator pointing to an input element or textarea 'position' is the numerical position of the cursor in the field; position should be 0 to move the position to the beginning of the field. You can also set the cursor to -1 to move it to the end of the field. |
Get the relative index of an element to its parent (starting from 0). The comment node and empty text node will be ignored. 'locator' is an element locator pointing to an element |
Check if these two elements have same parent and are ordered siblings in the DOM. Two same elements will not be considered ordered. 'locator1' is an element locator pointing to the first element 'locator2' is an element locator pointing to the second element |
Retrieves the horizontal position of an element 'locator' is an element locator pointing to an element OR an element itself |
Retrieves the vertical position of an element 'locator' is an element locator pointing to an element OR an element itself |
Retrieves the width of an element 'locator' is an element locator pointing to an element |
Retrieves the height of an element 'locator' is an element locator pointing to an element |
Retrieves the text cursor position in the given input element or textarea; beware, this may not work perfectly on all browsers. Specifically, if the cursor/selection has been cleared by JavaScript, this command will tend to return the position of the last location of the cursor, even though the cursor is now gone from the page. This is filed as SEL-243. This method will fail if the specified element isn't an input element or textarea, or there is no cursor in the element. 'locator' is an element locator pointing to an input element or textarea |
Returns the specified expression. This is useful because of JavaScript preprocessing. It is used to generate commands like assertExpression and waitForExpression. 'expression' is the value to return |
Returns the number of nodes that match the specified xpath, eg. "//table" would give the number of tables. 'xpath' is the xpath expression to evaluate. do NOT wrap this expression in a 'count()' function; we will do that for you. |
Temporarily sets the "id" attribute of the specified element, so you can locate it in the future using its ID rather than a slow/complicated XPath. This ID will disappear once the page is reloaded. 'locator' is an element locator pointing to an element 'identifier' is a string to be used as the ID of the specified element |
Specifies whether Selenium should use the native in-browser implementation of XPath (if any native version is available); if you pass "false" to this function, we will always use our pure-JavaScript xpath library. Using the pure-JS xpath library can improve the consistency of xpath element locators between different browser vendors, but the pure-JS version is much slower than the native implementations. 'allow' is boolean, true means we'll prefer to use native XPath; false means we'll only use JS XPath |
Specifies whether Selenium will ignore xpath attributes that have no value, i.e. are the empty string, when using the non-native xpath evaluation engine. You'd want to do this for performance reasons in IE. However, this could break certain xpaths, for example an xpath that looks for an attribute whose value is NOT the empty string. The hope is that such xpaths are relatively rare, but the user should have the option of using them. Note that this only influences xpath evaluation when using the ajaxslt engine (i.e. not "javascript-xpath"). 'ignore' is boolean, true means we'll ignore attributes without value at the expense of xpath "correctness"; false means we'll sacrifice speed for correctness. |
Runs the specified JavaScript snippet repeatedly until it evaluates to "true". The snippet may have multiple lines, but only the result of the last line will be considered. Note that, by default, the snippet will be run in the runner's test window, not in the window of your application. To get the window of your application, you can use the JavaScript snippet selenium.browserbot.getCurrentWindow(), and then run your JavaScript in there 'script' is the JavaScript snippet to run 'timeout' is a timeout in milliseconds, after which this command will return with an error |
Specifies the amount of time that Selenium will wait for actions to complete. Actions that require waiting include "open" and the "waitFor*" actions. The default timeout is 30 seconds. 'timeout' is a timeout in milliseconds, after which the action will return with an error |
Waits for a new page to load. You can use this command instead of the "AndWait" suffixes, "clickAndWait", "selectAndWait", "typeAndWait" etc. (which are only available in the JS API). Selenium constantly keeps track of new pages loading, and sets a "newPageLoaded" flag when it first notices a page load. Running any other Selenium command after turns the flag to false. Hence, if you want to wait for a page to load, you must wait immediately after a Selenium command that caused a page-load. 'timeout' is a timeout in milliseconds, after which this command will return with an error |
Waits for a new frame to load. Selenium constantly keeps track of new pages and frames loading, and sets a "newPageLoaded" flag when it first notices a page load. See waitForPageToLoad for more information. 'frameAddress' is FrameAddress from the server side 'timeout' is a timeout in milliseconds, after which this command will return with an error |
|
Returns the value of the cookie with the specified name, or throws an error if the cookie is not present. 'name' is the name of the cookie |
Returns true if a cookie with the specified name is present, or false otherwise. 'name' is the name of the cookie |
Create a new cookie whose path and domain are same with those of current page under test, unless you specified a path for this cookie explicitly. 'nameValuePair' is name and value of the cookie in a format "name=value" 'optionsString' is options for the cookie. Currently supported options include 'path', 'max_age' and 'domain'. the optionsString's format is "path=/path/, max_age=60, domain=.foo.com". The order of options are irrelevant, the unit of the value of 'max_age' is second. Note that specifying a domain that isn't a subset of the current domain will usually fail. |
Delete a named cookie with specified path and domain. Be careful; to delete a cookie, you need to delete it using the exact same path and domain that were used to create the cookie. If the path is wrong, or the domain is wrong, the cookie simply won't be deleted. Also note that specifying a domain that isn't a subset of the current domain will usually fail. Since there's no way to discover at runtime the original path and domain of a given cookie, we've added an option called 'recurse' to try all sub-domains of the current domain with all paths that are a subset of the current path. Beware; this option can be slow. In big-O notation, it operates in O(n*m) time, where n is the number of dots in the domain name and m is the number of slashes in the path. 'name' is the name of the cookie to be deleted 'optionsString' is options for the cookie. Currently supported options include 'path', 'domain' and 'recurse.' The optionsString's format is "path=/path/, domain=.foo.com, recurse=true". The order of options are irrelevant. Note that specifying a domain that isn't a subset of the current domain will usually fail. |
|
Sets the threshold for browser-side logging messages; log messages beneath this threshold will be discarded. Valid logLevel strings are: "debug", "info", "warn", "error" or "off". To see the browser logs, you need to either show the log window in GUI mode, or enable browser-side logging in Selenium RC. 'logLevel' is one of the following: "debug", "info", "warn", "error" or "off" |
Creates a new "script" tag in the body of the current test window, and adds the specified text into the body of the command. Scripts run in this way can often be debugged more easily than scripts executed using Selenium's "getEval" command. Beware that JS exceptions thrown in these script tags aren't managed by Selenium, so you should probably wrap your script in try/catch blocks if there is any chance that the script will throw an exception. 'script' is the JavaScript snippet to run |
Defines a new function for Selenium to locate elements on the page. For example, if you define the strategy "foo", and someone runs click("foo=blah"), we'll run your function, passing you the string "blah", and click on the element that your function returns, or throw an "Element not found" error if your function returns null. We'll pass three arguments to your function:
The function must return null if the element can't be found. 'strategyName' is the name of the strategy to define; this should use only letters [a-zA-Z] with no spaces or other punctuation. 'functionDefinition' is a string defining the body of a function in JavaScript. For example: return inDocument.getElementById(locator); |
Saves the entire contents of the current window canvas to a PNG file. Contrast this with the captureScreenshot command, which captures the contents of the OS viewport (i.e. whatever is currently being displayed on the monitor), and is implemented in the RC only. Currently this only works in Firefox when running in chrome mode, and in IE non-HTA using the EXPERIMENTAL "Snapsie" utility. The Firefox implementation is mostly borrowed from the Screengrab! Firefox extension. Please see http://www.screengrab.org and http://snapsie.sourceforge.net/ for details. 'filename' is the path to the file to persist the screenshot as. No filename extension will be appended by default. Directories will not be created if they do not exist, and an exception will be thrown, possibly by native code. 'kwargs' is a kwargs string that modifies the way the screenshot is captured. Example: "background=#CCFFDD" . Currently valid options: * background the background CSS for the HTML document. This may be useful to set for capturing screenshots of less-than-ideal layouts, for example where absolute positioning causes the calculation of the canvas dimension to fail and a black background is exposed (possibly obscuring black text). |
Executes a command rollup, which is a series of commands with a unique name, and optionally arguments that control the generation of the set of commands. If any one of the rolled-up commands fails, the rollup is considered to have failed. Rollups may also contain nested rollups. 'rollupName' is the name of the rollup command 'kwargs' is keyword arguments string that influences how the rollup expands into commands |
Loads script content into a new script tag in the Selenium document. This differs from the runScript command in that runScript adds the script tag to the document of the AUT, not the Selenium document. The following entities in the script content are replaced by the characters they represent: < > & The corresponding remove command is removeScript. 'scriptContent' is the Javascript content of the script to add 'scriptTagId' is (optional) the id of the new script tag. If specified, and an element with this id already exists, this operation will fail. |
Removes a script tag from the Selenium document identified by the given id. Does nothing if the referenced tag doesn't exist. 'scriptTagId' is the id of the script element to remove. |
Allows choice of one of the available libraries. 'libraryName' is name of the desired library Only the following three can be chosen: * "ajaxslt" - Google's library * "javascript-xpath" - Cybozu Labs' faster library * "default" - The default library. Currently the default library is "ajaxslt" . If libraryName isn't one of these three, then no change will be made. |
Writes a message to the status bar and adds a note to the browser-side log. 'context' is the message to be sent to the browser |
Sets a file input (upload) field to the file listed in fileLocator 'fieldLocator' is an element locator 'fileLocator' is a URL pointing to the specified file. Before the file can be set in the input field (fieldLocator), Selenium RC may need to transfer the file to the local machine before attaching the file in a web page form. This is common in selenium grid configurations where the RC server driving the browser is not the same machine that started the test. Supported Browsers: Firefox ("*chrome") only. |
Captures a PNG screenshot to the specified file. 'filename' is the absolute path to the file to be written, e.g. "c:lahscreenshot.png" |
|
Returns the network traffic seen by the browser, including headers, AJAX requests, status codes, and timings. When this function is called, the traffic log is cleared, so the returned content is only the traffic seen since the last call. 'type' is The type of data to return the network traffic as. Valid values are: json, xml, or plain. |
Tells the Selenium server to add the specificed key and value as a custom outgoing request header. This only works if the browser is configured to use the built in Selenium proxy. 'key' the header name. 'value' the header value. |
Downloads a screenshot of the browser current window canvas to a based 64 encoded PNG file. The entire windows canvas is captured, including parts rendered outside of the current view port. Currently this only works in Mozilla and when running in chrome mode. 'kwargs' is A kwargs string that modifies the way the screenshot is captured. Example: "background=#CCFFDD". This may be useful to set for capturing screenshots of less-than-ideal layouts, for example where absolute positioning causes the calculation of the canvas dimension to fail and a black background is exposed (possibly obscuring black text). |
|
|
Simulates a user pressing a key (without releasing it yet) by sending a native operating system keystroke. This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular element, focus on the element first before running this command. 'keycode' is an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes! |
Simulates a user releasing a key by sending a native operating system keystroke. This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular element, focus on the element first before running this command. 'keycode' is an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes! |
Simulates a user pressing and releasing a key by sending a native operating system keystroke. This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular element, focus on the element first before running this command. 'keycode' is an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes! |
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 3.0alpha2 on Tue Jun 09 11:55:37 2009 | http://epydoc.sf.net |


Alice and Bob have an argument, usually with Alice questioning Bob's planning or general capability.

After a brief pause, Alice politely points out that Bob is going the wrong way. Bob makes an embarrassed excuse and sheepishly wanders out in the right direction.
Common variations include Alice not saying anything, but seeing Bob go one way, then hurriedly switching to the opposite direction, or Bob entering a closet (bonus points if Bob stays in there a while out of embarrassment).
Similar scenes can be used to show that a character is particularly flustered or worried, or that a character is an infiltrator that doesn't know his way around. As a variant, Bob may have just expressed sudden resolve and set off to do some dramatic, plot-important event, but his conviction turns into comic effect by his mistake in direction.
See also Your Other Left, House Amnesia, Door Focus, Crossing the Burnt Bridge. Often used as a tool of providing a Failed Attempt at Drama.
Examples:
- Neon Genesis Evangelion: The pilots break into their HQ using air vents. Asuka pompously begins leading off, before Rei points out she's going the wrong way.
- Ranma ½:
- A variation is used in the final arc: upon hearing about the bird people coming after Plum, Ryōga detects that two of them are in the room and makes a show of hurling his bamboo parasol in the direction of their hiding space... only to realize that, true to form, he threw it in the exact opposite direction.
- A second variation comes from the anime adaptation of the Breaking Point storyline. After turning down Cologne's initial offer to train him, Ryoga takes his leave. The next scene shows him wandering into the living room and sheepishly asking them to tell him the way out... again. The subbed version has Shampoo claim that this is the tenth time Ryōga has had to ask. And he still gets it wrong — he follows Shampoo's directions and ends up at the toilet. Ryōga has No Sense of Direction.
- Variant in Transformers: Robots in Disguise: Team Bullet Train arrives in search of the Predacons, and Midnight Express starts carefully picking his way among the civilians — but then Railspike points out that they're in the opposite direction.
- Kevin Hart discusses this in his special Seriously Funny.  Or even worse, pack his son's baby bag so he can go with him.
- Calvin and Hobbes: Calvin announces his secession from the family and heads outside to strike out for the Yukon. His mother calls after him... but only to sardonically inform him, "You're heading southeast. North is that way."
- Garfield:
- Jon opens a door.
Jon: Boy, it's dark outside!
Garfield: That's the closet. - Jon is excited about the new year and tries to get out of his house, only to mistakenly open the closet door.
Garfield: New year, new start, new world, same Jon.
- Jon opens a door.
- In Kitten Ears and Lion Hugs Harry, annoyed at Cedric's stalking attempt, storms off to the owlery.
Cedric: Wrong way, Harry.
- Inverted in Born Of The Same Impulse, where Tony visits Stephen and wears out his welcome after making one too many insensitive remarks. Stephen sends out his guest by saying, "You know where the door is." In response, Tony deliberately goes towards the opposite direction of the exit, and begins packing Stephen's stuffs to bring him out of the house.
- In Bolt, Rhino sets off after Bolt with a long monologue beginning with "If Bolt's taught me anything, it's that you never abandon a friend in a time of need!", but he sets off in the wrong direction.
- A Bug's Life:
- Manny the mantis magician walks offscreen and causes a loud crash in an attempt to get to the circus tent. His wife Gypsy, used to this, doesn't even look up as she corrects him.
Gypsy: The stage is the other way, dear.
Manny: Yes, of course! - Happens to Atta as a sign that she's beginning to fall for Flik.
Atta: I've got to go... uh.. check on the bird. [walks off]
Atta: [reappearing] Bird's.. um.. that way...
Flik: [seeing all the other insects looking at him with "isn't that sweet" expressions] What?
- Manny the mantis magician walks offscreen and causes a loud crash in an attempt to get to the circus tent. His wife Gypsy, used to this, doesn't even look up as she corrects him.
- Variation in Ego Trip: Dexter uses a time machine to go into the future, only to discover that his house is very different in the future, and runs into random rooms trying to find the front door. Unable to find it and frustrated, he uses a secret escape hatch underneath a lamp, which apparently was never changed.
- In Disney's Hercules, Hades frees the Titans with mighty fanfare as they all march forth to destroy Zeus. Hades interrupts their cries of "Destroy Zeus!" with the comment, "Uh, guys? Olympus would be that way.", pointing a thumb in the opposite direction to where they're going.
- In the film Adam's Rib, two characters conclude an argument by going to adjoining apartments and slamming the doors shut...then sheepishly crossing the hall, as each has accidentally gone to the other's apartment.
- In The American President, President Shepherd (Michael Douglas) and lobbyist Sidney Wade (Annette Benning) get into a heated discussion in the Oval Office. She starts to storm out and the President stops her, telling her that that door goes into his private study, and then points out the proper exit.
- Happens to Sam and his military escort at the start of Burn Notice: The Fall of Sam Axe as they get turned around on the way to Sam's court martial.
- In Mel Brooks' Dracula: Dead and Loving It, Dracula hypnotizes Mina from outside her bedroom window and instructs her to leave her room. She dreamily flows to a door, opens it, steps through, and closes it behind her.

- In the Extended Edition of Peter Jackson's The Lord of the Rings: The Fellowship of the Ring, Gandalf tells Frodo to lead the Fellowship out of Rivendell. When he gets to the gate, Frodo whispers to Gandalf: "Mordor, Gandalf - is it left or right?" Gandalf, of course, gives him the right answer: left...
- During the second of the Four Weddings and a Funeral, Hugh Grant's character is in a hotel room when the bride and groom enter, intent on consummating right there and then. Charles edges his way towards a door and slips through. Later we cut back, just as the bride and groom are in the middle of yet more noisy sex, and the door creaks open. Charles is sitting on a sink in a hidden en-suite, looking distinctly uncomfortable. Eventually, he gives up, steps boldly out of the cupboard, flourishes a pencil, exclaims "Found it!" and leaves by the real door.
- In the Israeli independent movie Hamossad Hasagur, Michal, who always wanted to be a kindergartner, is told by Rami to go take care of the career soldiers' children. She walks in the direction of his hand movement, but then comes back only to tell him that it's the other way around.
- In the movie of The Hitch Hikers Guide To The Galaxy, Zaphod has just set their course for the Restaurant at the End of the Universe, only to have Marvin point out that the restaurant is at the other end of the universe.
- This could be a more extreme example. In every adaptation where the restaurant is actually shown, it's at the temporal end of the universe.
- In the film It's a Wonderful Life, a drunken Uncle Billy walks home, needing George to point him in the right direction.
- The Ben Affleck film Man About Town features this as a Running Gag with a boardrooms door being right next to an identical door to a closet. Afleck at one point dramatically storms out of the boardroom, slams the door behind him and then reappears a second later to shout about the bad layout of the room.
- In Pacific Rim, Mako tries to evade questions from Raleigh by turning around and heading for her room. After some fiddling around with the key at the door Raleigh notes that it was his room she tried to unlock.
- Done by the title character in Who Framed Roger Rabbit, when after Eddie refuses to help him, he walks out in a huff... or tries to, anyway. Eddie helpfully shouts "That's the closet!"
- In The World's Greatest Athlete (1973), a bumbling coach gives the football team a pep talk in the locker room. When he tells the team to go out there and win, they all race out the door with renewed determination. A few seconds later, the team comes back in through the door, soaking wet. The door they went through led to the showers, not the field!
- * In The Medallion [[Butt Monkey Watson]], infuriated at the prospect that Li may be replacing him, storms out of the room. There is a pause, before an exasperated Hammerstock-Smythe informs him Watson that he is in the filing cabinet.
- Discworld:
- Inverted in The Last Continent, when Rincewind is told he's needed for a dangerous quest, and immediately starts running like hell. The quest-issuing creature follows; when Rincewind shouts that he's not going to stop for anything, he's told he's already running in the right direction.
- Played with in Jingo, when two rival fishermen grab their sons and rush for the beaches, frantic to sail back to their home cities and lay claim to a newly-discovered island. Each man reaches the shore, realizes they grabbed the wrong boy, then rushes back to exchange sons while accusing the other of kidnapping.
- Redwall
- In The Taggerung, Gruven, attempting to lead the hunting party, has just been told that the Taggerung is probably headed north. Much to their amusement, he tells them to break camp and starts marching south.
- In The Addams Family, a poor mook trying to warn his superiors about the Addams (due to a series of misunderstandings, he thinks they attempted to kill him) storms off after not being believed, slams the door behind him, and after a few seconds sheepishly steps out of the closet and uses the other door, leading to one of his bosses saying, "I never knew he drank."
- Variant on American Idol: "Other door" practically became a Catch Phrase in the seventh season. The audition rooms were always double-doored, but only one of these doors ever opened, and, having entered through one of those doors, auditioners would inevitably try to leave through the other one. Which did not open. This also happened to Simon once. And one contestant somehow managed to burst through the locked door, to the judges' amazement. (This seemed to be a problem at every location they visited, making you wonder if they weren't setting the doors up like that on purpose to further embarrass the contestants.)
- Angel, "Ground State": Angel, Gunn, and Fred are breaking into an auction house. Fred has just explained the plan in detail. The men boldly head off, one to the left and one to the right... at which point Fred shouts "Guys!" Embarrassed, they switch directions.
- In Series 10 of The Apprentice (UK), Solomon was so shaken by his interview with Claude Littner that he almost walked out of the window rather than the door.
- Once on Australias Got Talent, in real life, on national television: after a successful audition, Nobel Lakaev skipped off in the wrong direction before he figured out that off-stage was over there and skipped right back across the stage, pointing sheepishly.
- In the Being Human episode "Puppy Love", Emrys, believing that he has completed his unfinished business, tries to cross over and walks into a cupboard.
- In Boy Meets World, Cory saved face after walking into a closet by saying "And I'm taking back my sweater!" and storming out with it.
- A two-in-one example from Castle; Castle is dating a Hollywood actress. Beckett is pretending not to be bugged by this. They have an argument about her intentions, which ends with Castle turning around to get a cup of coffee from the squad room and Beckett turning to go to the murder board. Unfortunately, both are pulling an Exit Is That Way, meaning they must turn around and walk sheepishly past each other to get to where they actually want to go.
- In the second series of Derry Girls, Erin attempts to leave the mall after fighting with Clare but turns down the wrong hallway. Because the correct exit is in the opposite direction, she has to awkwardly pass by the group in order to actually leave.
- Happens to a sleep-deprived Jesse in Diagnosis: Murder in "Misdiagnosis Murder". When Amanda tells him to go home and get some sleep, he angrily says he will and turns and strides dramatically through a door.
 He returns sheepishly a moment later to ask her for directions.
- "Army of Ghosts": The Doctor strides out of a Torchwood lab and heads left. Yvonne Hartman immediately says "No, Doctor" and he heads right.
- "The Shakespeare Code": The Doctor and Martha run down a street, with Martha protesting that they're going the wrong way, and the Doctor assuring her that they're not. Two seconds later, they're running in the opposite direction, and the Doctor admits that they were going the wrong way.
- A particularly unusual (and funny) example occurs in Father Ted; the shot is composed so the viewer can only see the open door, and when Father Dougal walks behind it, apparently to leave the room, he sheepishly re-emerges a few seconds later, having walked the wrong side of the open door, missing the exit entirely.
- Frasier:
- In an episode, Daphne has an argument with Frasier about her whereabouts before storming off to her room. Alas, she goes the wrong way, leading to the quote at the top of the page.
- There's another episode where this trope is used in spirit; Frasier and Diane have a long heart-to-heart and they come to terms with their history together, and Frasier says his heartfelt goodbyes and turns to leave in this perfect moment... only to accidentally walk out the stage door, which has been designed to look like the Cheers bar, and have to sheepishly turn back and find the right door.
Frasier: Force of habit.
Diane: I've been doing it all week.
- The Golden Girls:
- Dorothy tries to walk out on a boyfriend who just revealed that he's married to her. Semi-justified since they're in a hotel room.
Dorothy: Oh god, I'm storming out to the closet!
- Dorothy tries to walk out on a boyfriend who just revealed that he's married to her. Semi-justified since they're in a hotel room.
- The IT Crowd: In "Moss and the German", Douglas arranges a man-date with Roy, says his PA will call him with the details, and then walks into Jen's office. He comes out a moment later saying "That's not my office".
- A more dramatic version is seen on an episode of Law & Order: Criminal Intent when the victim's mother asked the detectives for directions to the elevator in the court house. They gave her the directions and they talked for a little bit. The woman left and then Detective Logan said, "The elevators are this way." The woman nodded politely and walked away.
- Leverage, "The Three Days of the Hunter Job", when Sophie takes a turn planning a con. She finishes telling the team all about the mark, but her closing line falls flat. Nate tells her she should turn and leave the room at that point to make it more dramatic. She does, and Nate quietly remarks, "She's walking into the closet."
- On an episode of The Mighty Boosh, Howard has a flashback of when the soul of jazz tricks him into signing away Howard's soul to him. After the evil jazz soul gets mad at Howard for not telling him his hat is on fire (and "ruining his exit") he stomps off to the right of the screen. Seconds later, he comes back, saying "There isn't an exit there, it's a damn toilet." and walks off to the left of the screen.
- Only Fools and Horses: Rodney and Del have a blazing row (again) and Rodney storms out of the living room, heading for the pub.
- Our Miss Brooks: In "The Wrong Mrs. Boynton", Miss Brooks accidentally offers to masquerade as Mr. Boynton's mother in front of Dean Faraday of State University. Playing the "wrong" Mrs. Boynton requires her to go to Mr. Boynton's apartment and entertain the dean. Unfortunately, Mr. Boynton's apartment features mainly wildlife specimens ... and doors. Miss Brooks, at various times, mistakenly goes into the bathroom, closet, kitchen, bedroom, and once even locks herself outside the backdoor and has to be let in the front by the dean.
- Psych: In one episode, Gus tries to leave the morgue because he's necrophobic. The door he rushes through is not the exit, but the room where bodies are stored.
- Red Dwarf:
- Rimmer does this before taking his exams, insisting that everything is under control.
- Done again by Rimmer when Applied Phlebotinum creates a Tyrannosaurus rex.
Lister: What do we do now?
Rimmer: Follow the Rimmer-shaped blur!
[Rimmer exits, stage left]
[everyone else exits, stage right]
[beat]
[Rimmer runs back on screen, then exits right]
- Scrubs uses this a lot.
J.D.: Now let's see how you like it when I walk away from you.
[exits right]
[walks back on screen]
J.D.: Actually, I need to go this way.
[exits left]
[walks back on screen]
J.D.: Right the first time.
[exits right] - In the Top Gear Botswana special, James May manages to set off in the wrong direction - towards Zimbabwe. (At a time when The BBC were banned from Zimbabwe.) Fortunately he quickly realises his error.
- There is an instance involving Ainsley Hayes, Jed Bartlet, Leo McGarry, and a closet which is not a bathroom on The West Wing.
- In the episode "In the Shadow of Two Gunmen Part II", C.J., after falling into her pool, says she's going into her house to change and then she'll discuss the job Toby's offered her. Because she's not wearing her glasses or contacts, Toby has to point out she's walking in the wrong direction.
- Played for Drama in "Ellie"; after Ellie gets chewed out by Bartlet in his office, she starts to leave, only to indicate she has no idea where the exit is. He points it out to her.
- You're Skitting Me: After having been humiliated for being afraid of spiders, Ultra Boy attempts to leave with dignity by yelling "Ultra Boy, away!" and striding into the corridor. A few seconds later, he walks past the door again, noting sheepishly that the exit is this way.
- Used in the production of Hamlet in The Complete Works of William Shakespeare (abridged). Hamlet declares, "The time is out of joint—O cursed spite, that ever I was born to exit RIGHT!" He then starts to exit, only to realize that he is exiting stage left and quickly reverse direction.
- Subverted in Legally Blonde The Musical, with Elle making a dramatic exit with the parting line, "I'm never wearing that [a navy blue suit] again." When one of the other characters points out that she's in the supply closet, she replies, "I know! I said I'm never wearing that again...I'm wearing THIS!" and emerges in a hot pink suit.
- Play On, which is about a community theatre production, has a moment when one of the actors accidentally exits through the door to the servant's quarters instead of the door to the stairs. One of the other actors calls after him to tell him he's going the wrong way, and he turns around...only to go all the way past the windows instead. The other actors try to cover for him, saying, "He must be using the outside staircase."
- A variation of this is done in Wicked. After helping Elphaba rescue a lion cub and an awkward romantic moment, Fiyero takes the cub and runs off stage to take it to safety. Then, Fiyero runs back across stage pointing in the other direction and miming 'that way'.
- Done during the intro of Conker's Bad Fur Day where the title character ends up getting so drunk that he has trouble finding the exit. His first attempt has him going to the toilets.
- Done towards the end of The Secret of Monkey Island when Guybrush is heading for the church to rescue Elaine, but only if the player directs him to walk the wrong way.
- Red vs. Blue: Happens twice with Donut in the first season. The first time, he is asked to go to the "store" and instead heads for the back wall of the Red Base, before being pointed in the direction of the open field. The second time, Donut is told by Grif to take the Blue flag back to base. Donut runs off, before Grif clarifies to bring the flag to RED base. Both times, Donut gives the same reply:
Donut: I knew that! I just... got turned around, is all.
- Claire from Bite Me!:
Claire: This is a matter of life and death! RESCUE HO!
SLAM!
Luther: I believe she just strode into a closet.
Lucien: Yes, but it's very big, so it'll take her a while. - Kyran from Emergency Exit:
Delaine: Door's that way.
Kyran: BAH! I don't need doors!
[...]
Kyran: OK, yes I do. But gosh dorn it, I'm going to use it dramatically! - Loserz:
- Not about the exit, but definitely the wrong way in this strip.
"Uh, guys? Jodie would be that-a-way."
- A sleep-drunk Eric walks into the closet instead of leaving the house for school one morning.
Eric: Who left all these coats out here?
- When Eric and Alice meet up as dates at the Spring Dance, Ben attempts to smoothly make his exit to give them some alone-time, only to walk face-first right into a wall.
Ben: [face bruised] There's a wall there.
Eric: Thanks for the heads up.
- Not about the exit, but definitely the wrong way in this strip.
- Legendary Frog's parody Flash animation of The Lord of the Rings has Frodo eagerly tell Sam after destroying the One Ring, "Let's go home!", and walks off. A moment later, he walks back the other way and says, still as cheerful and eager as he was before, "The Shire is this way."
- Seen in one episode of American Dad!.
Francine: Stan, honey, that's a closet.
Stan: I'M LOOKING FOR PEACHES! - Spud of American Dragon: Jake Long has done this, in the episode "Professor Rotwood's Thesis". Having determined that the priceless antique belonging to Trixie's mom that the Power Trio just broke is actually one of a hundred copies, Spud dramatically declares that they just need is to find one and hurries off.
Spud: Um, I'm lost.
- On a very special episode of Clone High, Abe Lincoln, while talking to Joan of Arc on a dock, attempts to dramatically stride back to shore. "Goodbye, Joan." He walks the wrong way, and falls into the water. "Goodbye, Joan."
- In The Critic episode "Lady Hawke", Alice storms off Jay's set in a jealous huff and says she wants to leave with her dignity... only for the door she just walked through slam shut and reveal that its the Men's Bathroom.
Alice: Jay... is there a little man on the outside of this door?
Jay: Yes.
Alice: Oh poo! - In a Terrible Thunder Lizards segment of the Eek! The Cat cartoon Mr. T.Rex lead the Thunder Lizards away from the command center... into a bathroom.
- The Fairly OddParents: Mr. Turner is so upset over how unhelpful he is with Timmy's homework, he decides to leave Timmy's room. He first enters the closet, then the bathroom, and then he finally leaves Timmy's bedroom... through the window.
- Family Guy:
- In "If I'm Dyin', I'm Lyin'", Peter and Chris's favorite show Gumbel And Gumbel is cancelled, leading Peter to storm to the networks headquarters and demand it be brought back.
Secretary: Sir, you can't go in there.
Peter: Oh yeah? Just watch me! [Peter attempts to burst through the door only to smack into a brick wall, as it turns out the door is just a scenery prop]
Secretary: No, I mean you can't go in there because that door leads nowhere. It's the one next to it. - In "Brian Wallows and Peter Swallows", Brian gets fed up with caring for elderly shut-in Pearl and tries to storm out of her house after an argument, only to be frustrated by her locked front door. Pearl coaches him on how to open it, after which he politely reminds her to "drop dead" and leaves.
- In "If I'm Dyin', I'm Lyin'", Peter and Chris's favorite show Gumbel And Gumbel is cancelled, leading Peter to storm to the networks headquarters and demand it be brought back.
- Fat Albert and the Cosby Kids: In "The Stranger", Fat Albert and the gang are backing away from Donald's cousin Betty but back themselves into the janitor's closet instead of their classroom: not even noticing till they shut the door and all of the brooms and mops fall on them.
- In the 1977 Christmas Special A Flintstones Christmas, Mr. Slate asks Fred to perform as Santa at a charity event their wives are hosting. Fred, relieved due to thinking Slate was firing him, takes the costume and leaves through the nearest door, not looking to see which one.
Mr. Slate: Flintstone, will you get out of my closet?!
- Simultaneously lampshaded and averted in the Gravity Falls episode "The Hand That Rocks the Mabel":
[Grunkle Stan exits, slamming door behind him]
Soos: Dude, wouldn't it be funny if that was a closet, and he had to come back out again and walk out the real door? [opens door and looks out] Nope, real door. - The Hercules TV series episode "Hercules and the Twilight of the Gods" has a Call-Forward to the example from the film: All the baddies of the Norse pantheon march off in much the same way, with cries of "Ragnarok!", and a prominent sign indicates that they are, indeed, heading to Mount Olympus. Loki interrupts to let them know that, since they're Norse monsters, they should be heading to Valhalla instead.
- As the cliffhanger to the Legion of Doom episode of Justice League, the heroes all dramatically walk away in different directions, indicating the end of the League. However, they are in an enclosed warehouse. Fridge Logic dictates that at least some of them had to turn around and find another exit. Although if they were proud enough, most of them could have just made one...
- Looney Tunes loves this trope. From "Fallin' Hare":
Bugs Bunny: [struck on head] Which way did he go, George, which way did he go?
The Gremlin: Hmm! That way! [points in two directions, eyes crossed]
Bugs Bunny: Gee, thanks a lot, George! [knocked out] - My Financial Career: The young man's rising panic and nervousness at the bank cause him to walk into the safe instead of out the door when leaving the bank manager's office.
- My Life as a Teenage Robot: In "Ear No Evil" where Jenny wants her own ears to fit in, despite her mom insisting that she built the ears into her since she's a robot. Jenny still doesn't take it well.
Jenny: Fine, if you won't help me, I'll make my own ears!
[storms out and slams door]
Mrs. Wakeman: Uh...closet.
Jenny: [stomps out of the closet and storms out the other door, slamming it multiple times] - An unusual version is seen in the My Little Pony: Friendship Is Magic episode "Boast Busters", after Twilight Sparkle and Spike have an argument that involves her creating a door in the middle of the room in front of him. In the end, he slams it on her again, but of course has to come away from behind it after that to actually leave.
- Scooby-Doo! Mystery Incorporated: In "The Wild Brood", Sheriff Stone attempts to leave Daphne's bedroom and instead walks into her closet. Where he gets lost.
- The Simpsons:
- In one episode, Bart breaks into a blind man's house to get his dog back. When the man comes downstairs, Bart attempts to flee.
Blind Man: I may be blind, but you just ran into a closet!
- In The Movie: Burns has sent the dogs. After a small bit of chasing, he reminds his "visitors" of where the exit is.
- In one episode, Bart breaks into a blind man's house to get his dog back. When the man comes downstairs, Bart attempts to flee.
- In the Spongebob Squarepants episode, "Pickles", Spongebob starts struggling in making krabby patties, so Mr. Krabs tells his to go home and get some rest. Spongebob immediately has trouble finding the door out of the Krusty Krab... which was right next to him. He also has to ask which way his home is.
- In the VeggieTales episode "The Star of Christmas", Cavis (Bob), thinking that Millward (Larry) and Seymour (Pa Grape) are walking out on him when their musical isn't going as planned, "shows them the door" with an indignant face, and it turns out to be the closet. When he opens the right door, he checks quickly before making the face.
- An episode of The Weekenders involves Tish forcing the others to participate in a radio play. During rehearsal (in Tino's room) she becomes more and more demanding, until finally Carver has a prima-donna moment and declares, "I can't work under these conditions! I'm going to my trailer!" and walks into Tino's closet, slamming the door. When this is pointed out? "A real actor can make the audience believe a closet is a trailer."
- This spectacular George Bush fail.
- According to Dick Nunis, who was the area manager for Adventureland at Disneyland at the time, he once got into an argument with Walt Disney about making changes to an area in the park to improve guest flow.


Here you can add any other arguments to be placed on the game change URL. It will be added after the gametype and mutator elements.
The following variables are not allowed: <%urlextra.deny%>


Getting started with the Mixed Reality Toolkit
The Mixed Reality Toolkit's primary focus is to make it extremely easy to get started creating Mixed Reality applications and to accelerate deployment to multiple platforms from the same Unity project.
The goal of the Mixed Reality Toolkit is to enable developers to build a single project for multiple platforms, building for each platform from Unity as required without all the normal complexities of handling different XR SDKs.
More information about the architecture and design of the Mixed Reality Toolkit
Contents
- Prerequisites
- Adding XRTK to your project
- Creating your first Mixed Reality Scene
- Adding additional Platforms
- Build and Play
One of the Mixed Reality Toolkit's primary goals was to ensure new projects can get up and running as fast as possible. To this end, the default configuration supplied in the toolkit SDK ensures you can simply import, play and run a new project right out of the box.
Prerequisites
To get started with the Mixed Reality Toolkit you will need:
Note: Specific platforms may have additional platform requirements. It's best to check that platform's readme for more information.
Note: Currently, the Scriptable Render Pipeline is not yet supported, so the LWSRP, HDSRP and VRSRP workflows not compatible. Please stay tuned to the GitHub site for future announcements on SRP support.
Setting up a Windows Environment
If you're using a Windows OS for development, then you'll need to enable Developer Mode in the operating system settings.
Tip: You can quickly find the Developer Settings by pressing
win + S
and type “Developer Settings”.
Setting up a MAC Environment
When developing for XRTK on a Mac, you simply need the default requirements needed for building any Unity project on a Mac, including (but not limited to):
- Unity
- XCode - For Mac/iOS builds
- Android SDK/NDK - For Android builds
Adding the Mixed Reality Toolkit to your project
First download the Mixed Reality Toolkit via one of the delivery mechanisms into your Unity project.
Our preferred deployment approach is to install using the Unity Package Manager. This is the quickest and safest way to get Mixed Reality Toolkit in your solution and provides new releases as soon as they are published. Using UPM, there are also no asset conflicts in your Unity project.
Note: Some prefabs and assets require TextMesh Pro, meaning you have to have the TextMesh Pro package installed and the assets in your project
Window -> TextMeshPro -> Import TMP Essential Resources
.
It all starts with the SDK
We recommend installing the XRTK.SDK first to ensure you have the smoothest setup with the XRTK, which also gives you access to the Quickstart configurations.
Configure your base scene
The Mixed Reality Toolkit has been designed so that there is a base scene with all of the required GameObjects. This base scene provides support for the core configuration and runtime.
Note: As more scenes are required in your project you'll need to additively load and unload each individually at runtime while keeping the configured base scene loaded at all times.
Configuring your scene is extremely simple by simply selecting the following from the Editor menu:
Mixed Reality Toolkit -> Configure...
Configuring the toolkit will set up the camera rig, creates the MixedRealityToolkit
, and adds additional components to the Main Camera
. Once this completes, you will see the following in your project's scene hierarchy:
Which contains the following:
MixedRealityToolkit
- The toolkit object itself, providing the main entry point for the framework into the Unity event loop. This object references aConfiguration Profile
which defines all the settings and customizable options for your application.MixedRealityPlayspace
- The parent object for the camera rig, which ensures the headset, controllers, and other spatially tracked objects are positioned correctly in the scene relative to the player's local frame of reference.- The
Main Camera
is moved to be a child to theMixedRealityPlayspace
, Which allows the playspace to move the whole camera rig without interfering with any camera driven movement from the native SDKs. - The
PlayerBody
is positioned at the same x/z position as theMain Camera
, but placed at the player's feet. Rotation of the body doesn't always match theMain Camera
's rotation, but is an approximation of the player's body rotation.
- The
Warning! While working on your scene in the editor, DO NOT move the Main Camera or the Playspace from the scene origin (0,0,0). This is controlled by the Mixed Reality Toolkit and the active platform's
Camera Data Provider
, and most platforms expect the camera to start at this location.If you need to move the player's start point, then either:
- Move the scene content and NOT the camera.
- Move the Playspace after the scene has started.
From here your project should be ready to build and play on the platform you are targeting, or you can take an in depth look on configuring your project for any specific requirements.
From here, you can install any additional platforms you need to deploy to other platforms.
Adding additional Platforms
Once you have your initial scene setup with the Unity Standalone platform, you are ready to install additional platforms to build and deploy to.
To add a new platform, simply return to the Unity Package Manager (Window -> Package Manager
) and selecting My Registries
from the source drop down, select the package to install (for example XRTK.WindowsMixedReality) and click Install as shown below:
Once installed, the default for that platform will be copied into the XRTK.Generated
folder in your project assets and a prompt will appear to automatically register the platforms configuration with your scene, as shown below:
If you click Later
, please refer to the Configuration Guide for how to manually add the configuration
Build and Play
You are now ready to start building your Mixed Reality Solution, just start adding content and get building!
You will need to enable the Unity XR SDK Loaders in the project settings to be able to launch the application in XR Mode for each respective platform.
Note: Where possible use the Mock HMD Loader, as the XRTK already talks directly to the native apis. We only need the XR SDK display subsystems to get the XR Mode to correctly render to the screen.
Once you are ready to build, open the Unity Build settings, and switch to the target platform you wish to build on, then open the Mixed Reality Toolkit's build window and build from there.
Note: Depending on the platform's simulation support, you should be able to run in the editor by pressing play.
Please check the FAQ for any difficulties.
Building for Windows Standalone (OpenVR/Oculus Rift-Link)
When targeting Windows Standalone there should be no special setup and the Mixed Reality Toolkit will work as configured. Builds should be able to target OpenVR and Oculus Quest (via Oculus Link).
Please ensure either the OpenVR or Oculus Camera and Controller providers are configured.
Building for Windows Mixed Reality (UWP)
See the Windows Mixed Reality Platform documentation for more details on the platform.
Building for Oculus Quest / Android
See the Oculus Platform documentation for more details on the platform.
Building for Magic Leap
See the Magic Leap Platform documentation for more details on the platform.
Related Articles
Raise an Information Request
If there is anything not mentioned in this document or you simply want to know more, raise an RFI (Request for Information) request here.


We optimize solutions!
- leverage 24/365 supply-chains
- e-enable dot-com functionalities
- scale front-end e-services
- synergize holistic paradigms
- deploy intuitive methodologies
- whiteboard value-added supply-chains
- empower cross-platform deliverables
- repurpose best-of-breed niches
- streamline clicks-and-mortar models
- engage cross-platform metrics
- engage mission-critical content


Category:Reference Manual
reference
compilation_unit = { toplevel_declaration }
A Nemerle program consists of one or more compilation units. Compilation
units are text files (conventionally with the .n extension). A
compilation unit consists of namespace-related declarations and types
within them.
toplevel_declaration =
'using' Expressions_(ref):qualified_identifier ';'
| 'using' Lexical_structure_(ref):IDENTIFIER '=' qualified_identifier ';'
| 'namespace' qualified_identifier '{' { toplevel_declaration } '}'
| Type_declarations_(ref):type_declaration
The first form adds the specified namespace (which, unlike in C#,
can also be a type name) to the symbol search path. Every symbol till
end of current namespace or compilation unit (if not within namespace)
will be searched also in location specified by this path.
The second form defines an alias for a namespace or type. After
using Foo = Bar.Baz; any reference to Foo.bar will be
expanded to Bar.Baz.bar .
The namespace declarations puts entities defined inside it within
the specified namespace. Namespaces can be nested, creating a tree
of namespaces.
|


--- title: Focus on How You Work, Not Why excerpt: Start with Why, but the "How" is equally important ;) date: '2019-01-28 17:18:38 +0100' categories: - Motivation - Mindfulness - Teams ---
Start with Why, but the "How" is equally important. Be mindful, go for a walk, and do small changes that improve your and your team's well-being and efficiency.


Next: Grammar methods, Previous: Static methods, Up: Top [Contents][Index]
The configuration object is intended for future extensions.
Currently, the only function of the Marpa_Config
class is to give
marpa_g_new()
a place to put its error code.
Marpa_Config
is Libmarpa’s only “major”
class which is not a time class.
There is no constructor or destructor, although
Marpa_Config
objects do need to be initialized
before use.
Aside from its own accessor,
Marpa_Config
objects are only used by
marpa_g_new()
and no reference to their location is kept
in any of Libmarpa’s time objects.
The intent is that it be convenient
to have Marpa_Config
objects
in memory that might be deallocated
soon after
marpa_g_new()
returns.
For example, they could be put on the stack.
Initialize the config information to “safe” default values. An irrecoverable error will result if an uninitialized configuration is used to create a grammar.
Return value: Always succeeds. The return value is unspecified.
Error codes are usually kept in the base grammar,
which leaves
marpa_g_new()
no place to put
its error code on failure.
Objects of
the Marpa_Config
class provide such a place.
p_error_string is reserved for use by
the internals.
Applications should set it to NULL
.
Return value: The error code in config.
Always succeeds, so that
marpa_c_error()
never requires an error code
for itself.