Sha256: 1f105f5175e6d998e21220be5b3be6f7a826cc2ded8d6ed826b924f47826e23b

Contents?: true

Size: 838 Bytes

Versions: 65

Compression:

Stored size: 838 Bytes

Contents

if (locator == '*') {
  return selenium.browserbot.locationStrategies['xpath'].call(this, "//input[@type='submit']", inDocument, inWindow)
}
var buttons = inDocument.getElementsByTagName('button');
var inputs = inDocument.getElementsByTagName('input');
var result = $A(inputs).concat($A(buttons)).find(function(candidate){
	var type = candidate.getAttribute('type');
	if (type == 'submit' || type == 'image'  || type == 'button') {
		var matches_id = PatternMatcher.matches(locator, candidate.id);
		var matches_value = PatternMatcher.matches(locator, candidate.value);
		var matches_html = PatternMatcher.matches(locator, candidate.innerHTML);
		var matches_alt = PatternMatcher.matches(locator, candidate.alt);
		if (matches_id || matches_value || matches_html || matches_alt) {
			return true;
		}
	}
	return false;
});
return result;

Version data entries

65 entries across 65 versions & 27 rubygems

Version Path
aslakhellesoy-webrat-0.4.4.1 lib/webrat/selenium/location_strategy_javascript/button.js
davidtrogers-webrat-0.4.4.2 lib/webrat/selenium/location_strategy_javascript/button.js
dbrady-webrat-0.4.4.2 lib/webrat/selenium/location_strategy_javascript/button.js
diabolo-webrat-0.4.4.2 lib/webrat/selenium/location_strategy_javascript/button.js
diabolo-webrat-0.5.1 lib/webrat/selenium/location_strategy_javascript/button.js
dstrelau-webrat-0.5.1 lib/webrat/selenium/location_strategy_javascript/button.js
emipair-webrat-0.0.1 lib/webrat/selenium/location_strategy_javascript/button.js
garnierjm-webrat-0.4.5 lib/webrat/selenium/location_strategy_javascript/button.js
hardbap-webrat-0.5.1 lib/webrat/selenium/location_strategy_javascript/button.js
hardbap-webrat-0.5.2 lib/webrat/selenium/location_strategy_javascript/button.js
jwilger-webrat-0.4.4.3 lib/webrat/selenium/location_strategy_javascript/button.js
jwilger-webrat-0.4.4.4 lib/webrat/selenium/location_strategy_javascript/button.js
jwilger-webrat-0.4.4.5 lib/webrat/selenium/location_strategy_javascript/button.js
raldred-webrat-0.4.4.2 lib/webrat/selenium/location_strategy_javascript/button.js
sr-webrat-0.4.4.1 lib/webrat/selenium/location_strategy_javascript/button.js
winton-sum-0.1.0 vendor/webrat/lib/webrat/selenium/location_strategy_javascript/button.js
winton-sum-0.1.1 vendor/webrat/lib/webrat/selenium/location_strategy_javascript/button.js
radiant-1.0.0 ruby-debug/ruby/1.8/gems/webrat-0.7.3/lib/webrat/selenium/location_strategy_javascript/button.js
indirect-webrat-0.7.5 lib/webrat/selenium/location_strategy_javascript/button.js
indirect-webrat-0.7.4 lib/webrat/selenium/location_strategy_javascript/button.js