Package org.apache.geronimo.testsuite.common.selenium

Source Code of org.apache.geronimo.testsuite.common.selenium.EclipseBrowserLauncher

/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.geronimo.testsuite.common.selenium;

import org.apache.geronimo.testsuite.common.ui.AbbotHelper;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.widgets.Shell;
import org.openqa.selenium.server.browserlaunchers.AbstractBrowserLauncher;

/**
* EclipseBrowserLauncher
*
* @version $Rev: 736695 $ $Date: 2009-01-23 00:36:14 +0800 (Fri, 23 Jan 2009) $
*/
public class EclipseBrowserLauncher extends AbstractBrowserLauncher {

    public EclipseBrowserLauncher(int a, String sessionId) {
        super(sessionId);
    }

    @Override
    protected void launch(String url) {
        try {
            AbbotHelper abbotHelper = EclipseSeleniumServer.INSTANCE.getAHelper();
            Shell workbenchShell = EclipseSeleniumServer.INSTANCE.getShell();

            abbotHelper.clickMenuItem (workbenchShell,
                    new String[] {"&Window", "Web Browser", "&0 Internal Web Browser"});
            Shell openShell = abbotHelper.clickMenuItem (workbenchShell,
                    new String[] {"&Window", "Show &View", "&Other..."}, "Show View");
            abbotHelper.clickTreeItem (openShell,
                    new String[] {"General", "Internal Web Browser"});
            abbotHelper.clickButton (openShell, IDialogConstants.OK_LABEL);
           
            abbotHelper.setCombo (workbenchShell, url);
            abbotHelper.clickToolItem (workbenchShell, "Go to the selected URL");
            abbotHelper.waitTime (AbbotHelper.WAIT_LONG);
        } catch ( Exception e ) {
            e.printStackTrace();
        }
    }

    public void close() {
    }

    public Process getProcess() {
        return null;
    }

}
TOP

Related Classes of org.apache.geronimo.testsuite.common.selenium.EclipseBrowserLauncher

TOP
Copyright © 2018 www.massapi.com. 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.