Example usage for org.openqa.selenium WebElement click

List of usage examples for org.openqa.selenium WebElement click

Introduction

In this page you can find the example usage for org.openqa.selenium WebElement click.

Prototype

void click();

Source Link

Document

Click this element.

Usage

From source file:com.cengage.mindtap.keywords.ATPAppPageActions.java

public void createATest(String QuestionCount) {
    navigateToHomeInATPAppfromAppDock();
    element("CreateANewTestBtn").click();
    elements("ChapterTestCheckBoxes");
    int i = 0;//For Loop Counter
    int quecount = Integer.parseInt(QuestionCount);

    for (WebElement ChapterTestCheckBoxes : elements("ChapterTestCheckBoxes")) {
        ChapterTestCheckBoxes.click();
        /*//from w w  w  .  ja  va  2  s  .  c  o m
        1. Storing all the Selected Chapters in An String Array.
        */
        chaptersName[i] = element("chaptersNames", Integer.toString(i + 1)).getText().toString();

        ReportMsg.info("User Select " + chaptersName[i] + " Chapter");
        ++i;
        if (Integer.parseInt(element("totalSelectedItems").getText()) > quecount) {
            break;
        }
    }
    element("QuestionCount").clear();
    element("QuestionCount").sendKeys(QuestionCount);
    element("takeTestNow_btn").click();

}

From source file:com.cengage.mindtap.keywords.CSMAppIntPageActions.java

public void instructorEditTACapabilities() {
    scrollDown(element("ta_manage_lpn_cap_chkbox"));
    List<WebElement> checkBoxes = new ArrayList();
    checkBoxes = elements("ta_capabilities_allchkboxes");
    for (WebElement box : checkBoxes) {
        box.click();
    }/*from w  w w.  j  a  v  a 2  s. c  o m*/
}

From source file:com.cengage.mindtap.keywords.CSMPageActions.java

public void CoIntructorEditTACapabilities() {
    scrollDown(element("ta_manage_lpn_cap_chkbox"));
    List<WebElement> checkBoxes = new ArrayList();
    checkBoxes = elements("ta_capabilities_allchkboxes");
    for (WebElement box : checkBoxes) {
        box.click();
    }/*from  w  w  w  .j  a v a2 s .c o  m*/
}

From source file:com.cengage.mindtap.keywords.CSMPageActions.java

public void removeCoInstructorAndTA() {
    waitForElementPresent("course_info_header");
    scrollDown(element("add_inst_ta_link"));
    waitTOSync();/* w w w  .  j  a  va 2  s  .c om*/
    List<WebElement> checkBoxes = new ArrayList();
    checkBoxes = elements("remove_coinst_ta_cross_btn");
    for (WebElement box : checkBoxes) {
        box.click();
    }

    scrollDown(element("add_inst_ta_link"));
    waitTOSync();
    clickOnElementUsingActionBuilder(element("save_changes_btn"));
    waitForElementPresent("heading_manage_courses");
}

From source file:com.cengage.mindtap.keywords.DashBoardPageActions.java

void closeAnnouncement() {
    try {//from  ww  w  .  j  av  a2s. co m
        List<WebElement> closeLinks = driver.findElements(By.xpath("//a[contains(@class,'nb_closeIcon')]"));
        for (WebElement link : closeLinks) {
            link.click();
        }
    } catch (Exception e) {
    }
}

From source file:com.cengage.mindtap.keywords.GoogleDriveAppPageActions.java

/**
 * Select g doc document.//from w w  w.j  a  v  a  2  s  .  co m
 */
void selectGDocDocument() {
    for (WebElement gdoc : gdoc_list) {
        gdoc.click();
        break;
    }
}

From source file:com.cengage.mindtap.keywords.MasterPageActions.java

public void launchMasterBook(String bookName) {
    waitTOSync();/*from w  ww  . jav a  2s.c om*/

    for (WebElement searchBookTitle : elements("searchBookResults_list")) {
        if (searchBookTitle.getText().equals(bookName)) {
            System.out.println("Book Title:" + searchBookTitle.getText());
            System.out.println(searchBookTitle.getText());
            searchBookTitle.click();
            break;
        }

    }
}

From source file:com.cengage.mindtap.keywords.MasterPageActions.java

public void verifyStatus(String bookName) {

    for (WebElement searchBookTitle : elements("statusOption_list")) {
        searchBookTitle.click();
        Assert.assertTrue(element("statusVerify_cover").isDisplayed());
        Assert.assertTrue(element("statusVerify_Reader").isDisplayed());
        Assert.assertTrue(element("statusVerify_Media").isDisplayed());
        Assert.assertTrue(element("statusVerify_Metadata").isDisplayed());
        break;/*  www  .  j  a  v a2 s .c  om*/

    }
}

From source file:com.cengage.mindtap.keywords.SVRPageActions.java

/**
 * Launch distinct activity.// ww  w  . ja va 2  s  .c o m
 *
 * @param title the title
 */
public void launchDistinctActivity(String title) {

    WebElement activity;
    //waitForElementToAppear(By.xpath("//a[contains(.,'" + title + "')]"),15);
    waitTOSync();
    activity = driver.findElement(By.xpath("//a[contains(.,'" + title + "')]"));
    activity.click();

}

From source file:com.cengage.mindtap.keywords.SVRPageActions.java

public void studentSubmitsAnswersToActivity(String answer) {

    switchToMediaName(); //switchToMainIFrame();
    switchToActiveServiceCXPFrame();//from   w  w w.  j  a  v  a  2 s  .com
    waitForElementPresent("By.xpath(//li[@heading='Questions'])");
    WebElement answerBox;
    for (int i = 0; i < 3; i++) {
        answerBox = driver
                .findElement(By.xpath("//div[@id='section1_assessment1_question_" + i + "']//nobr/textarea"));
        answerBox.click();
        answerBox.clear();
        answerBox.sendKeys(answer);
        waitTOSync();// for answers to be uploaded on SVR server
    }
    element("submitBtn").click();
    for (int i = 1; i < 5; i++) {
        waitTOSync();
    }
    //waitForElementDisplayed(By.xpath("(//div[@class='ci-feedback-title'])[1]"))
    deselectFrame();
}