Search This Blog

Wednesday, August 4, 2010

Selenium Commands - Part 5

O



open(url)
Arguments:
• url - the URL to open; may be relative or absolute
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.


openWindow(url, windowID)
Arguments:
• url - the URL to open, which can be blank
• windowID - the JavaScript window ID of the window to select
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").


openWindowAndWait(url, windowID)
Generated from openWindow(url, windowID)
Arguments:
• url - the URL to open, which can be blank
• windowID - the JavaScript window ID of the window to select
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").






P

pause(waitTime)
Arguments:
• waitTime - the amount of time to sleep (in milliseconds)
Wait for the specified amount of time (in milliseconds)