Ignore:
Timestamp:
08/16/12 16:26:46 (8 years ago)
Author:
sjm84
Message:

Added a util function that performs a quick search

Location:
gs3-extensions/testing/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/testing/trunk/src/src/org/greenstone/gsdl3/testing/GSTestingUtil.java

    r26108 r26117  
    107107    }
    108108
     109    public static void performQuickSearch(WebDriver driver, String query, String index)
     110    {
     111        if (index != null)
     112        {
     113            WebElement requestedIndex = findElementByXPath(driver, "//div[@id='quicksearcharea']//select[@name='s1.index']//option[@value='" + index + "' or descendant::text()='" + index + "']");
     114            requestedIndex.click();
     115        }
     116
     117        WebElement quickSearchInput = findElementByXPath(driver, "//div[@id='quicksearcharea']//input[@name='s1.query']");
     118        WebElement quickSearchSubmitButton = findElementByXPath(driver, "//input[@id='quickSearchSubmitButton']");
     119
     120        quickSearchInput.clear();
     121        quickSearchInput.sendKeys(query);
     122        quickSearchSubmitButton.click();
     123    }
     124
    109125    public static WebElement findElementByXPath(WebDriver driver, String xpath)
    110126    {
Note: See TracChangeset for help on using the changeset viewer.