Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jimevans committed Jan 26, 2016
2 parents 75243dd + 2883baf commit f2c0cf5
Show file tree
Hide file tree
Showing 41 changed files with 3,072 additions and 220 deletions.
19 changes: 15 additions & 4 deletions common/src/web/click_tests/overlapping_elements.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,27 @@
<style>
#under {
position: absolute;
top: 20;
left: 20;
top: 20px;
left: 20px;
width: 100px;
height: 100px;
background-color: white;
}

#partially_under {
position: absolute;
top: 20px;
left: 10px;
width: 100px;
height: 100px;
background-color: blue;
opacity: 0.5;
}

#over {
position: absolute;
top: 20;
left: 20;
top: 20px;
left: 20px;
width: 100px;
height: 100px;
background-color: red;
Expand All @@ -30,6 +40,7 @@
</head>
<body id="body">
<div id="under"><p id="contents">Hello</p></div>
<div id="partially_under"><p id="other_contents">Hello</p></div>
<div id="over"></div>
<div id="log">
<p>Log:<p>
Expand Down
12 changes: 8 additions & 4 deletions java/client/src/org/openqa/selenium/htmlunit/HtmlUnitDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -1102,12 +1102,12 @@ public WebElement findElementByName(String name) {
}

@Override
public List<WebElement> findElementsByName(String using) {
public List<WebElement> findElementsByName(String name) {
if (!(lastPage() instanceof HtmlPage)) {
return new ArrayList<>();
}

List<DomElement> allElements = ((HtmlPage) lastPage()).getElementsByName(using);
List<DomElement> allElements = ((HtmlPage) lastPage()).getElementsByName(name);
return convertRawHtmlElementsToWebElements(allElements);
}

Expand All @@ -1126,12 +1126,16 @@ public WebElement findElementByTagName(String name) {
}

@Override
public List<WebElement> findElementsByTagName(String using) {
public List<WebElement> findElementsByTagName(String name) {
if ("".equals(name)) {
throw new InvalidSelectorException("Unable to locate element by xpath for " + lastPage());
}

if (!(lastPage() instanceof HtmlPage)) {
return new ArrayList<>();
}

NodeList allElements = ((HtmlPage) lastPage()).getElementsByTagName(using);
NodeList allElements = ((HtmlPage) lastPage()).getElementsByTagName(name);
List<WebElement> toReturn = new ArrayList<>(allElements.getLength());
for (int i = 0; i < allElements.getLength(); i++) {
Node item = allElements.item(i);
Expand Down
7 changes: 7 additions & 0 deletions java/client/src/org/openqa/selenium/os/ExecutableFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ public String find(String named) {
return named;
}

if (Platform.getCurrent().is(Platform.WINDOWS)) {
file = new File(named + ".exe");
if (canExecute(file)) {
return named + ".exe";
}
}

addPathFromEnvironment();
if (Platform.getCurrent().is(Platform.MAC)) {
addMacSpecificPath();
Expand Down
8 changes: 8 additions & 0 deletions java/client/test/org/openqa/selenium/PageLoadingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ public void testShouldThrowIfUrlIsMalformed() {
driver.get("www.test.com");
}

@Ignore(value = {IE, SAFARI, PHANTOMJS})
@Test(expected = WebDriverException.class)
@NeedsFreshDriver
public void testShouldThrowIfUrlIsMalformedInPortPart() {
assumeFalse("Fails in Sauce Cloud", SauceDriver.shouldUseSauce());
driver.get("http://localhost:3001bla");
}

@Ignore(value = {SAFARI, MARIONETTE}, issues = {4062})
@Test
public void testShouldReturnWhenGettingAUrlThatDoesNotConnect() {
Expand Down
1 change: 1 addition & 0 deletions java/client/test/org/openqa/selenium/TypingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ public void canSafelyTypeOnElementThatIsRemovedFromTheDomOnKeyPress() {
}

@Test
@Ignore(value = {HTMLUNIT}, reason = "Failed with JS enabled, passed otherwise")
@NotYetImplemented({CHROME})
public void canClearNumberInputAfterTypingInvalidInput() {
driver.get(pages.formPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ private void loadFromCommandLine(String[] args) {
configuration.put(CLEAN_UP_CYCLE, Integer.parseInt(helper.getParamValue("-cleanUpCycle")));
}
if (helper.isParamPresent("-timeout")) {
configuration.put(TIME_OUT, Integer.parseInt(helper.getParamValue("-timeout")));
configuration.put(TIME_OUT, Integer.parseInt(helper.getParamValue("-timeout")) * 1000);
}
if (helper.isParamPresent("-browserTimeout")) {
configuration.put(BROWSER_TIME_OUT, Integer.parseInt(helper.getParamValue("-browserTimeout")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public BaseRemoteProxy(RegistrationRequest request, Registry registry) {

maxConcurrentSession = getConfigInteger(RegistrationRequest.MAX_SESSION);
cleanUpCycle = getConfigInteger(RegistrationRequest.CLEAN_UP_CYCLE);
timeOutMs = getConfigInteger(RegistrationRequest.TIME_OUT) * 1000;
timeOutMs = getConfigInteger(RegistrationRequest.TIME_OUT);
statusCheckTimeout = getConfigInteger(RegistrationRequest.STATUS_CHECK_TIMEOUT);

List<DesiredCapabilities> capabilities = request.getCapabilities();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1022,8 +1022,6 @@ public static RemoteControlConfiguration parseLauncherOptions(String[] args) {
configuration.setDebugURL(getArg(args, ++i));
} else if ("-timeout".equalsIgnoreCase(arg)) {
configuration.setTimeoutInSeconds(Integer.parseInt(getArg(args, ++i)));
} else if ("-browserTimeout".equalsIgnoreCase(arg)) {
configuration.setBrowserTimeoutInMs(Integer.parseInt(getArg(args, ++i)));
} else if ("-jettyThreads".equalsIgnoreCase(arg)) {
int jettyThreadsCount = Integer.parseInt(getArg(args, ++i));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public void timeouts() {
RegistrationRequest req = RegistrationRequest.build("-role", "webdriver","-"+RegistrationRequest.REMOTE_HOST, remoteHost,"-"+RegistrationRequest.ID, "abc", "-timeout", "23", "-browserTimeout", "12","-host","localhost");
req.getConfiguration().put(RegistrationRequest.PROXY_CLASS, null);
RemoteProxy p = BaseRemoteProxy.getNewInstance(req, registry);
assertEquals(23, p.getTimeOut());
assertEquals(23000, p.getTimeOut());
}


Expand Down
2 changes: 1 addition & 1 deletion javascript/atoms/test/history_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
}

function setUpPage() {
goog.testing.TestCase.getActiveTestCase().promiseTimeout = 10000; // 10s
goog.testing.TestCase.getActiveTestCase().promiseTimeout = 30000; // 30s
}

function setUp() {
Expand Down
4 changes: 4 additions & 0 deletions javascript/atoms/test/inject_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@

var frame, frameWin, frameDoc;

function setUpPage() {
goog.testing.TestCase.getActiveTestCase().promiseTimeout = 30000; // 30s
}

function setUp() {
frame = goog.dom.$('test-frame');
frameWin = goog.dom.getFrameContentWindow(frame);
Expand Down
1 change: 1 addition & 0 deletions javascript/atoms/test/mouse_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
redDiv = bot.locators.findElement({id: 'red'});
captureDiv = bot.locators.findElement({id: 'capture'});
innerCaptureDiv = bot.locators.findElement({id: 'innerCapture'});
goog.testing.TestCase.getActiveTestCase().promiseTimeout = 30000; // 30s
}

function setUp() {
Expand Down
6 changes: 4 additions & 2 deletions javascript/firefox-driver/js/firefoxDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ FirefoxDriver.prototype.get = function(respond, parameters) {
try {
loadEventExpected = fxdriver.io.isLoadExpected(current, url);
} catch (e) {
var converted = e.QueryInterface(Components.interfaces['nsIException']);
goog.log.warning(FirefoxDriver.LOG_, e);
var converted = e.QueryInterface ?
e.QueryInterface(Components.interfaces['nsIException']) : e;
if ('NS_ERROR_MALFORMED_URI' == converted.name) {
goog.log.warning(FirefoxDriver.LOG_, converted.name);
respond.sendError(new WebDriverError(
Expand Down Expand Up @@ -1182,7 +1184,7 @@ FirefoxDriver.prototype.sendKeysToActiveElement = function(respond, parameters)
useElement = useElement.ownerDocument.getElementsByTagName('html')[0];
}

Utils.type(respond.session.getDocument(), useElement, parameters.value.join(''),
Utils.type(respond.session, useElement, parameters.value.join(''),
this.jsTimer, false /*release modifiers*/, this.modifierKeysState);

respond.send();
Expand Down
Loading

0 comments on commit f2c0cf5

Please sign in to comment.