/*
 * Copyright 2000-2014 Vaadin Ltd.
 * 
 * Licensed 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 com.vaadin.tests.integration;

import java.io.IOException;

import org.junit.Test;
import org.openqa.selenium.WebElement;

/**
 * Base class for servlet integration tests. Automatically prepends "/demo" to
 * the deployment path
 * 
 * @author Vaadin Ltd
 */
public abstract class AbstractServletIntegrationTest extends
        AbstractIntegrationTest {

    @Test
    public void runTest() throws IOException, AssertionError {
        openTestURL();
        compareScreen("initial");

        WebElement cell = vaadinElement(getTableCell(getTable(), 0, 1));
        testBenchElement(cell).click(51, 13);

        compareScreen("finland");
    }

    private String getTableCell(String tableLocator, int row, int col) {
        return tableLocator
                + "/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild["
                + row + "]/domChild[" + col + "]/domChild[0]";
    }

    protected String getTable() {
        return "/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]";
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.vaadin.tests.tb3.AbstractTB3Test#getDeploymentPath()
     */
    @Override
    protected String getDeploymentPath() {
        return "/demo" + super.getDeploymentPath();
    }

}

@@ -687,38 +687,51 @@
 st;%0A
+%0A
 import 
-org.openqa.selenium.Web
+com.vaadin.testbench.elements.Table
 Elem
@@ -1098,25 +1098,24 @@
 tial%22);%0A
-%0A
         
 WebEleme
@@ -1110,110 +1110,58 @@
     
-WebElement cell = vaadinElement(getTableCell(getTable(), 0, 1));%0A        testBenchElement(cell
+$(TableElement.class).first().getCell(0, 1
 ).click(
 51, 
@@ -1160,18 +1160,11 @@
 ick(
-51, 13
 );%0A
-%0A
     
@@ -1204,493 +1204,8 @@
  %7D%0A%0A
-    private String getTableCell(String tableLocator, int row, int col) %7B%0A        return tableLocator%0A                + %22/domChild%5B1%5D/domChild%5B0%5D/domChild%5B1%5D/domChild%5B0%5D/domChild%5B%22%0A                + row + %22%5D/domChild%5B%22 + col + %22%5D/domChild%5B0%5D%22;%0A    %7D%0A%0A    protected String getTable() %7B%0A        return %22/VVerticalLayout%5B0%5D/ChildComponentContainer%5B0%5D/VScrollTable%5B0%5D%22;%0A    %7D%0A%0A    /*%0A     * (non-Javadoc)%0A     * %0A     * @see com.vaadin.tests.tb3.AbstractTB3Test#getDeploymentPath()%0A     */%0A
     

Convert test to TB4 to be compatible with Tomcat proxy test