Skip to content

Instantly share code, notes, and snippets.

@Stuk
Created July 29, 2011 09:14
Show Gist options
  • Save Stuk/1113494 to your computer and use it in GitHub Desktop.
Save Stuk/1113494 to your computer and use it in GitHub Desktop.
import com.opera.core.systems.*;
import com.opera.core.systems.settings.OperaDriverSettings;
import org.openqa.selenium.*;
import java.util.*;
import org.openqa.selenium.interactions.*;
class Example {
public static void main(String[] args) {
OperaDriver driver = new OperaDriver();
driver.get("/tmp/fixtures/issue12.html");
String xpathExpression = "//select[@id='stammdatenForm:userTypeInput']/option";
final List<WebElement> elements = driver.findElementsByXPath(xpathExpression);
for (WebElement el : elements) {
System.out.println(el.getText());
}
driver.quit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment