Skip to content

Instantly share code, notes, and snippets.

@andreastt
Created June 27, 2011 13:33
Show Gist options
  • Save andreastt/1048856 to your computer and use it in GitHub Desktop.
Save andreastt/1048856 to your computer and use it in GitHub Desktop.
package com.opera.core.systems;
import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebDriverException;
public class EcmaScriptTest extends TestBase {
@Before
public void setUp() {
driver.navigate().to("data:text/html;charset=utf-8,%3Cinput%20id%3D%22wrong%22%20class%3D%22foo%22%20%2F%3E%3Cinput%20id%3D%22correct%22%20class%3D%22foo%22%20%2F%3E");
}
@Test
public void testXPath() {
Exception exception = null;
try {
driver.findElementsByXPath(".//input[(not(@type) or (@type!=\"file\" and @type!=\"radio\" and @type!=\"checkbox\" and @type!=\"submit\" and @type!=\"reset\" and @type!=\"image\" and @type!=\"button\" and @type!=\"hidden\" and @type!=\"url\" and @type!=\"datetime\" and @type!=\"date\" and @type!=\"month\" and @type!=\"week\" and @type!=\"time\" and @type!=\"datetime-local\" and @type!=\"range\" and @type!=\"color\")) and @class='foo'] | .//textarea[@class='foo']");
} catch (WebDriverException e) {
exception = e;
}
Assert.assertNull(exception);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment