Package ghostdriver.server

Examples of ghostdriver.server.HttpRequestCallback


    }

    @Test
    public void handleClickWhenOnClickInlineCodeFails() {
        // Define HTTP response for test
        server.setHttpHandler("GET", new HttpRequestCallback() {
            @Override
            public void call(HttpServletRequest req, HttpServletResponse res) throws IOException {
                res.getOutputStream().println("<html>" +
                        "<head>" +
                        "<script>\n" +
View Full Code Here


    }

    @Test
    public void shouldSwitchBetweenNestedFrames() {
        // Define HTTP response for test
        server.setHttpHandler("GET", new HttpRequestCallback() {
            @Override
            public void call(HttpServletRequest req, HttpServletResponse res) throws IOException {
                String pathInfo = req.getPathInfo();
                ServletOutputStream out = res.getOutputStream();
View Full Code Here

    }

    @Test
    public void shouldSwitchBetweenNestedFramesPickedViaWebElement() {
        // Define HTTP response for test
        server.setHttpHandler("GET", new HttpRequestCallback() {
            @Override
            public void call(HttpServletRequest req, HttpServletResponse res) throws IOException {
                String pathInfo = req.getPathInfo();
                ServletOutputStream out = res.getOutputStream();
View Full Code Here

        new WebDriverWait(d, 5).until(ExpectedConditions.titleIs("definition_lists"));
    }

    @Test
    public void shouldBeAbleToSwitchToIFrameThatHasNoNameNorId() {
        server.setHttpHandler("GET", new HttpRequestCallback() {
            @Override
            public void call(HttpServletRequest req, HttpServletResponse res) throws IOException {
                res.getOutputStream().println("<html>" +
                        "<body>" +
                        "   <iframe></iframe>" +
View Full Code Here

    @Test(expected = TimeoutException.class)
    public void shouldTimeoutWhileChangingIframeSource() {
        final String iFrameId = "iframeId";

        // Define HTTP response for test
        server.setHttpHandler("GET", new HttpRequestCallback() {
            @Override
            public void call(HttpServletRequest req, HttpServletResponse res) throws IOException {
                String pathInfo = req.getPathInfo();
                ServletOutputStream out = res.getOutputStream();
View Full Code Here

import static org.junit.Assert.*;

public class ElementFindingTest extends BaseTestWithServer {
    @Test
    public void findChildElement() {
        server.setHttpHandler("GET", new HttpRequestCallback() {
            @Override
            public void call(HttpServletRequest req, HttpServletResponse res) throws IOException {
                res.getOutputStream().println("<div id=\"y-masthead\">" +
                        "<input type=\"text\" name=\"t\" />" +
                        "<input type=\"hidden\" name=\"h\" value=\"v\" />" +
View Full Code Here

        assertNotNull(parent.findElement(By.name("t")));
    }

    @Test
    public void findChildElements() {
        server.setHttpHandler("GET", new HttpRequestCallback() {
            @Override
            public void call(HttpServletRequest req, HttpServletResponse res) throws IOException {
                res.getOutputStream().println("<div id=\"y-masthead\">" +
                        "<input type=\"text\" name=\"t\" />" +
                        "<input type=\"hidden\" name=\"h\" value=\"v\" />" +
View Full Code Here

        assertEquals(2, children.size());
    }

    @Test
    public void findMultipleElements() {
        server.setHttpHandler("GET", new HttpRequestCallback() {
            @Override
            public void call(HttpServletRequest req, HttpServletResponse res) throws IOException {
                res.getOutputStream().println("<div id=\"y-masthead\">" +
                        "<input type=\"text\" name=\"t\" />" +
                        "<input type=\"hidden\" name=\"h\" value=\"v\" />" +
View Full Code Here

    }

    @Test
    public void findElementViaXpathLocator() {
        // Define HTTP response for test
        server.setHttpHandler("GET", new HttpRequestCallback() {
            @Override
            public void call(HttpServletRequest req, HttpServletResponse res) throws IOException {
                ServletOutputStream out = res.getOutputStream();
                out.println("<html><body>" +
                        "<button class='login main btn'>Login Button</button>" +
View Full Code Here

        assertTrue(locationBeforeScroll.y >= locationAfterScroll.y);
    }

    @Test
    public void getTextFromDifferentLocationsOfDOMTree() {
        server.setHttpHandler("GET", new HttpRequestCallback() {
            @Override
            public void call(HttpServletRequest req, HttpServletResponse res) throws IOException {
                res.getOutputStream().println("<html><body>" +
                        "<div class=\"item\">\n" +
                        "    <span class=\"item-title\">\n" +
View Full Code Here

TOP

Related Classes of ghostdriver.server.HttpRequestCallback

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.