Skip to content

Instantly share code, notes, and snippets.

@Stuk
Created August 3, 2011 10:07
Show Gist options
  • Save Stuk/1122315 to your computer and use it in GitHub Desktop.
Save Stuk/1122315 to your computer and use it in GitHub Desktop.
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