Tag Archives: jQuery

Select element with jQuery where the id contains specific text.

I have needed to do this on occasion with long auto-generated ids.

$j("[id$='logActivitiesCheckbox']");

To get a WebElement object back from WebDriver I use this method:

  public WebElement getWebElementFromJquery(String jQuery) {
    WebElement jqElement = null;
    JavascriptExecutor js = (JavascriptExecutor) driver;
    String query = "return " + jQuery+ ".get(0);";
    try {
      jqElement = (WebElement) js.executeScript(query);
    } catch (Exception e) {
      logger.error("jQuery() " + e.getMessage());
    }
    return jqElement;
  }

Learnings in Webdriver using C#.Net

Webdriver Tips and Techniques

The Automation Tester

My experiance with test automation

Learn WebDriver

This WordPress.com site is the cat’s pajamas

Assert Selenium

Selenium Automation in a Right Way