Tabnine Logo
FirefoxDriver.findElement
Code IndexAdd Tabnine to your IDE (free)

How to use
findElement
method
in
org.openqa.selenium.firefox.FirefoxDriver

Best Java code snippets using org.openqa.selenium.firefox.FirefoxDriver.findElement (Showing top 17 results out of 315)

origin: stackoverflow.com

 FirefoxDriver driver = new FirefoxDriver();

driver.get("http://localhost:8080/page");

File file = null;

try {
  file = new File(YourClass.class.getClassLoader().getResource("file.txt").toURI());
} catch (URISyntaxException e) {
  e.printStackTrace();
}

Assert.assertTrue(file.exists()); 

WebElement browseButton = driver.findElement(By.id("myfile"));
browseButton.sendKeys(file.getAbsolutePath());
origin: org.openqa.selenium.webdriver/webdriver-firefox

public WebElement findElementByPartialLinkText(String using) {
  return findElement("selectElementUsingPartialLinkText", using);
}
origin: org.openqa.selenium.webdriver/webdriver-firefox

public WebElement findElementByLinkText(String using) {
 return findElement("selectElementUsingLink", using);
}
origin: org.openqa.selenium.webdriver/webdriver-firefox

public WebElement findElementByTagName(String using) {
 return findElement("selectElementUsingTagName", using);
}
origin: org.openqa.selenium.webdriver/webdriver-firefox

public WebElement findElementByXPath(String using) {
 return findElement("selectElementUsingXPath", using);
}
origin: org.openqa.selenium.webdriver/webdriver-firefox

public WebElement findElementById(String using) {
  return findElement("selectElementById", using);
}
origin: org.openqa.selenium.webdriver/webdriver-firefox

public WebElement findElementByName(String using) {
  return findElement("selectElementByName", using);
}
origin: org.openqa.selenium.webdriver/webdriver-firefox

public WebElement findElementByClassName(String using) {
 if (using == null)
  throw new IllegalArgumentException("Cannot find elements when the class name expression is null.");
 if (using.matches(".*\\s+.*")) {
  throw new IllegalLocatorException(
    "Compound class names are not supported. Consider searching for one class name and filtering the results.");
 }
 return findElement("selectElementUsingClassName", using);
}
origin: stackoverflow.com

 FirefoxDriver driver = new FirefoxDriver();
driver.findElement(By.tagName("body")).sendKeys(Keys.CONTROL,"t");
origin: stackoverflow.com

 static WebElement searchbox;
public static void main(String[] args) { 

FirefoxDriver driver = new FirefoxDriver();
 driver.get("http://www.amazon.in");

searchbox = driver.findElement(By.xpath("//*[@id='twotabsearchtextbox']"));
 }
origin: stackoverflow.com

 static WebElement searchbox;

public static void main(String[] args)
{ 

  FirefoxDriver driver = new FirefoxDriver();
  driver.get("http://www.amazon.in");

  searchbox = driver.findElement(By.xpath("//*[@id='twotabsearchtextbox']"));
}
origin: stackoverflow.com

public class demo {
   public static void main(String[] args) throws IOException, InterruptedException {
   FirefoxDriver driver = new FirefoxDriver();
   //OPEN SPECIFIC URL IN BROWSER
   driver.get("http://www.toolsqa.com/automation-practice-form/");
   //SELECT SPECIFIC VALUE FROM DROPDOWN
   Select sel = new Select(driver.findElement(By.id("continents")));
   sel.selectByVisibleText("Australia");
   }
 }
origin: stackoverflow.com

 FirefoxDriver wd=new FirefoxDriver();
  wd.get("https://irctc.co.in/");

  wd.manage().timeouts().implicitlyWait(5000,TimeUnit.SECONDS);

  WebElement wb=wd.findElement(By.linkText("Cabs"));
  wb.click();  //Now 2 Windows are open

  wd.manage().timeouts().implicitlyWait(5000,TimeUnit.SECONDS); //Wait for the complete page to load

  Set<String> sid=wd.getWindowHandles(); //getWindowHandles() method returns the ids of all active Windows and its return type will be a Collection Set.

  Iterator<String> it=sid.iterator(); //Using iterator we can fetch the values from Set.

String parentId=it.next();
System.out.println(parentId);
String childId=it.next();
System.out.println(childId);

wd.switchTo().window(childId);  //swtiching control to child Window
origin: stackoverflow.com

 By hiddenLocator = By.id("csi");
FirefoxDriver driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.get("http://www.google.com");
WebElement hiddenEle = driver.findElement(hiddenLocator);
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.presenceOfElementLocated(hiddenLocator));
System.out.println("done");
origin: stackoverflow.com

 FirefoxDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
// display starting tab URL
System.out.println(driver.getCurrentUrl()); // expected output: google.com
WebElement body = driver.findElement(By.cssSelector("body"));
// open new tab
if(System.getProperty("os.name").contains("Mac")) {
  body.sendKeys(Keys.COMMAND + "t");
}
else {
  body.sendKeys(Keys.CONTROL + "t");
}
//navigate in new tab
driver.get("http://www.yahoo.com");
// display new tab URL
System.out.println(driver.getCurrentUrl()); // expected output: yahoo.com
//navigate back to previous tab
body = driver.findElement(By.cssSelector("body"));
body.sendKeys(Keys.CONTROL +""+Keys.SHIFT +""+ Keys.TAB);
// refresh driver view
driver.switchTo().defaultContent();
// display starting tab URL
System.out.println(driver.getCurrentUrl()); // expected output: google.com
driver.close();
origin: stackoverflow.com

searchbox = driver.findElement(By
    .xpath("//*[@id='twotabsearchtextbox']"));
origin: stackoverflow.com

WebElement emailField=driver.findElement(By.id("ap_email"));
WebElement passwordField=driver.findElement(By.id("ap_password"));
passwordField.sendKeys(auser.getPassword()); 
WebElement signinButton=driver.findElement(By.id("signInSubmit-input"));
signinButton.click();
org.openqa.selenium.firefoxFirefoxDriverfindElement

Popular methods of FirefoxDriver

  • <init>
  • manage
  • get
  • getTitle
  • quit
  • connectTo
  • findElementByCssSelector
  • findElements
  • ExecuteScript
  • FindElement
  • FindElementByXPath
  • Manage
  • FindElementByXPath,
  • Manage,
  • Quit,
  • close,
  • convertToJsObject,
  • convertToJsObjects,
  • dropCapabilities,
  • execute,
  • executeScript

Popular in Java

  • Making http requests using okhttp
  • onCreateOptionsMenu (Activity)
  • getSystemService (Context)
  • scheduleAtFixedRate (Timer)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now