This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = scope; | |
enum STPType | |
{ | |
COMMAND = 1; | |
RESPONSE = 2; | |
EVENT = 3; | |
ERROR = 4; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assume driver is a WebDriver instance, | |
// and element is a WebElement instance. | |
Actions actionsProvider = new Actions(driver); | |
actionsProvider.moveToElement(element).perform(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'selenium-webdriver' | |
profile = Selenium::WebDriver::Firefox::Profile.new | |
caps = Selenium::WebDriver::Remote::Capabilities.firefox | |
caps.firefox_profile = profile | |
caps = Selenium::WebDriver.for :remote, :url => "http://localhost:4444/wd/hub", :desired_capabilities => caps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool HtmlDialog::Wait() { | |
// If the window handle is no longer valid, the window is closing, | |
// the wait is completed, and we must post the quit message. | |
if (!::IsWindow(this->GetTopLevelWindowHandle())) { | |
this->is_navigating_ = false; | |
this->set_is_closing(true); | |
this->PostQuitMessage(); | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'selenium-webdriver' | |
def wait_for_new_handle(original_handles, driver) | |
handles = nil | |
wait = Selenium::WebDriver::Wait.new(:timeout => 10) | |
wait.until do | |
handles = driver.window_handles | |
handles.size == original_handles.size + 1 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assume driver is a valid IWebDriver instance. | |
IWebElement buttonsetElement = driver.FindElement(By.ClassName("ui-dialog-buttonset"); | |
IList<IWebElement> buttons = buttonsetElement.FindElements(By.TagName("button")); | |
buttons[0].Click(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Modal dialog launcher</title> | |
</head> | |
<body> | |
<p>This launches the test page using showModalDialog: | |
<a href="#" | |
id="dialog" | |
onclick="showModalDialog('click_test.html', null, 'dialogHeight:768px;dialogWidth:1024px;resizable:yes')"> | |
launch test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Wait until "Processing" objects goes away | |
DateTime endTime = DateTime.Now.Add(TimeSpan.FromSeconds(10)); | |
while (driver.FindElement(By.CssSelector("div[id*='processing']")).Displayed && DateTime.Now < endTime) | |
{ | |
Thread.Sleep(100); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.document.__webdriver_script_fn = (function() { return function(){var e = arguments[0]; | |
var p = e.parentNode; | |
var x = e.offsetLeft + (e.clientWidth / 2); | |
var y = e.offsetTop + (e.clientHeight / 2); | |
var s = window.getComputedStyle ? window.getComputedStyle(p, null) : p.currentStyle; | |
// Condition changed. It was: while (p != null && s.overflow != 'auto' && | |
// s.overflow != 'scroll' && s.overflow != 'hidden') | |
while (p != null && | |
s != null && | |
s.overflow && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Determine the outer size of the window. | |
* | |
* @param {!Window=} opt_win Window to determine the size of. Defaults to | |
* bot.getWindow(). | |
* @return {!goog.math.Size} The calculated size. | |
*/ | |
bot.window.getSize = function(opt_win) { | |
var win = opt_win || bot.getWindow(); |
OlderNewer