Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.FrameWindow


   * @return <code>null</code> if no frame found with this id
   */
  private static WebWindow getFrameByName(final HtmlPage htmlPage, final String name) {
    final List subFrames = htmlPage.getFrames();
    for (final Iterator iter = subFrames.iterator(); iter.hasNext();) {
      final FrameWindow elt = (FrameWindow) iter.next();
      LOG.debug("looking at frame \"" + elt.getName() + "\": " + elt);
      if (elt.getName().equals(name)) {
        LOG.debug("it's the right one");
        return elt;
      }
    }
    return null;
View Full Code Here


        String responseText = page.asText();
        //System.out.println("page html-->\n" + responseText);
        //check page header
        assertTrue(-1 != responseText.indexOf("Tuscany DAS Web Sample"));

        FrameWindow menuFrame = page.getFrameByName("fixed");
        HtmlPage menuPage = (HtmlPage)menuFrame.getEnclosedPage();
        String menuResponseText = menuPage.asText();
        //System.out.println("menu html-->\n" + menuResponseText);
        //check main menu and sub menu
        assertTrue(-1 != menuResponseText.indexOf("Advanced Features"));
        assertTrue(-1 != menuResponseText.indexOf("OCC"));
View Full Code Here

    public void testDBRefresh() throws Exception{
        final String TEST_CASE = "DBRefresh";
        System.out.print("Running:" + TEST_CASE + "\t\t");

        final HtmlPage page = (HtmlPage) _webClient.getPage(_url);
        FrameWindow menuFrame = page.getFrameByName("fixed");
        HtmlPage menuPage = (HtmlPage)menuFrame.getEnclosedPage();
        HtmlButtonInput commandButton = (HtmlButtonInput)menuPage.getFormByName("MenuForm").getHtmlElementById("refreshButton");
        HtmlPage commandResult = null;
        if(commandButton != null){
          //System.out.println("command button text:"+commandButton.asText());
          commandButton.focus();
View Full Code Here

    public void testAllCompanies_Adhoc() throws Exception{
        final String TEST_CASE = "AllCompanies_Adhoc";
        System.out.print("Running:" + TEST_CASE + "\t\t\t");

        final HtmlPage page = (HtmlPage) _webClient.getPage(_url);
        FrameWindow menuFrame = page.getFrameByName("fixed");
        HtmlPage menuPage = (HtmlPage)menuFrame.getEnclosedPage();

        //basic content
        HtmlAnchor adhocAnchor = menuPage.getAnchorByHref("./indexAdhoc.jsp");
        HtmlPage adhocPage = (HtmlPage)adhocAnchor.click();
        String adhocText = adhocPage.asText();
View Full Code Here

    public void testAllCompaniesDepartments_Command() throws Exception{
        final String TEST_CASE = "AllCompaniesDepartments_Command";
        System.out.print("Running:" + TEST_CASE + "\t\t");

        final HtmlPage page = (HtmlPage) _webClient.getPage(_url);
        FrameWindow menuFrame = page.getFrameByName("fixed");
        HtmlPage menuPage = (HtmlPage)menuFrame.getEnclosedPage();

        //basic content
        HtmlAnchor commandAnchor = menuPage.getAnchorByHref("./indexCommand.jsp");
        HtmlPage commandPage = (HtmlPage)commandAnchor.click();
        String commandText = commandPage.asText();
View Full Code Here

    public void testInsertCompanies_Adhoc() throws Exception{
        final String TEST_CASE = "InsertCompanies_Adhoc";
        System.out.print("Running:" + TEST_CASE + "\t\t\t");

        final HtmlPage page = (HtmlPage) _webClient.getPage(_url);
        FrameWindow menuFrame = page.getFrameByName("fixed");
        HtmlPage menuPage = (HtmlPage)menuFrame.getEnclosedPage();

        //basic content
        HtmlAnchor adhocAnchor = menuPage.getAnchorByHref("./indexAdhoc.jsp");
        HtmlPage adhocPage = (HtmlPage)adhocAnchor.click();
        String adhocText = adhocPage.asText();
View Full Code Here

    public void testDeleteDepartment_Command() throws Exception{
        final String TEST_CASE = "DeleteDepartment_Command";
        System.out.print("Running:" + TEST_CASE + "\t\t");

        final HtmlPage page = (HtmlPage) _webClient.getPage(_url);
        FrameWindow menuFrame = page.getFrameByName("fixed");
        HtmlPage menuPage = (HtmlPage)menuFrame.getEnclosedPage();

        //basic content
        HtmlAnchor commandAnchor = menuPage.getAnchorByHref("./indexCommand.jsp");
        HtmlPage commandPage = (HtmlPage)commandAnchor.click();
        String commandText = commandPage.asText();
View Full Code Here

    public void testOCC() throws Exception{
        final String TEST_CASE = "OCC";
        System.out.print("Running:" + TEST_CASE + "\t\t");

        final HtmlPage page = (HtmlPage) _webClient.getPage(_url);
        FrameWindow menuFrame = page.getFrameByName("fixed");
        HtmlPage menuPage = (HtmlPage)menuFrame.getEnclosedPage();

        //basic content
        HtmlAnchor commandAnchor = menuPage.getAnchorByHref("./occ.jsp");
        HtmlPage commandPage = (HtmlPage)commandAnchor.click();
        String commandText = commandPage.asText();
View Full Code Here

    public void testRSS() throws Exception{
        final String TEST_CASE = "RSS";
        System.out.print("Running:" + TEST_CASE + "\t\t");

        final HtmlPage page = (HtmlPage) _webClient.getPage(_url);
        FrameWindow menuFrame = page.getFrameByName("fixed");
        HtmlPage menuPage = (HtmlPage)menuFrame.getEnclosedPage();

        //basic content
        HtmlAnchor commandAnchor = menuPage.getAnchorByHref("./rss.jsp");
        HtmlPage commandPage = (HtmlPage)commandAnchor.click();
        String commandText = commandPage.asText();
View Full Code Here

    public void testConverter() throws Exception{
        final String TEST_CASE = "Converter";
        System.out.print("Running:" + TEST_CASE + "\t\t");

        final HtmlPage page = (HtmlPage) _webClient.getPage(_url);
        FrameWindow menuFrame = page.getFrameByName("fixed");
        HtmlPage menuPage = (HtmlPage)menuFrame.getEnclosedPage();

        //basic content
        HtmlAnchor commandAnchor = menuPage.getAnchorByHref("./converter.jsp");
        HtmlPage commandPage = (HtmlPage)commandAnchor.click();
        String commandText = commandPage.asText();
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.html.FrameWindow

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.