Created
August 3, 2011 10:07
-
-
Save Stuk/1122315 to your computer and use it in GitHub Desktop.
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
import com.opera.core.systems.*; | |
import org.openqa.selenium.*; | |
import org.openqa.selenium.remote.RemoteWebDriver; | |
import java.util.*; | |
import org.openqa.selenium.interactions.*; | |
class Example { | |
static RemoteWebDriver driver; | |
public static void main(String[] args) { | |
driver = new OperaDriver(); | |
driver.get("http://localhost:8080/opera/pages/index.jsf"); | |
// click modal panel | |
// Remove this line and the XPaths work | |
driver.findElementById("baseForm:cbShowPanel").click(); | |
try { Thread.sleep(3000); } catch (Exception e) {} | |
// get user types | |
System.out.println(driver.findElementsById("stammdatenForm")); | |
System.out.println(driver.findElementsByXPath("//*[@id='stammdatenForm']")); | |
System.out.println(driver.findElementsByXPath("//*[@id='stammdatenForm:userTypeInput']")); | |
System.out.println(driver.findElementsByXPath("//*[@id='stammdatenForm:userTypeInput']/option")); | |
System.out.println(driver.findElementsByXPath("//select[@id='stammdatenForm:userTypeInput']/option")); | |
driver.quit(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment