You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Oliver Pelz <ol...@googlemail.com> on 2013/10/07 14:27:33 UTC

[T5.3] SeleniumTestCase changing server name

Hi everybody,

We are using Selenium for integration testing of our tapestry website.
Since our production server is behind a enterprise proxy and oftentimes
behaves differently than the local maven jetty development version we want
to use Selenium also for using a different server name than 127.0.0.1 to
test our production system as well.
I have tried to change the selenium test case to point to a different
server name using the open() method without any success e.g. using:

open("http://xyz.de/TestPage") instead of open("/TestPage") but this does
not work - it seems I can only use relative pathes here. The testng.xml
file  does not have any parameters to change the server name either:

http://tapestry.apache.org/integration-testing.html

Is there another way to do this?

Cheers Oliver

Re: [T5.3] SeleniumTestCase changing server name

Posted by Dmitry Gusev <dm...@gmail.com>.
If you look at SeleniumTestCase class (#testStartup(...) method) you'll see
that selenium is created for "localhost" -- which is hard-coded:

        CommandProcessor httpCommandProcessor = new HttpCommandProcessor(
"localhost",

                RemoteControlConfiguration.DEFAULT_PORT,
browserStartCommand, baseURL);


        final ErrorReporterImpl errorReporter =
newErrorReporterImpl(httpCommandProcessor, testContext);


        ErrorReportingCommandProcessor commandProcessor =
newErrorReportingCommandProcessor(httpCommandProcessor,

                errorReporter);


        final Selenium selenium = new DefaultSelenium(commandProcessor);


        selenium.start();

and open() method is just this:

    public void open(String url)

    {

        selenium.open(url);

    }

Try subclassing SeleniumTestCase and override #testStartup to change
selenium host name.

Also you will probably want to remove #launchWebServer functionality,
because you want to use remote instance of the app.



On Mon, Oct 7, 2013 at 4:27 PM, Oliver Pelz <ol...@googlemail.com>wrote:

> Hi everybody,
>
> We are using Selenium for integration testing of our tapestry website.
> Since our production server is behind a enterprise proxy and oftentimes
> behaves differently than the local maven jetty development version we want
> to use Selenium also for using a different server name than 127.0.0.1 to
> test our production system as well.
> I have tried to change the selenium test case to point to a different
> server name using the open() method without any success e.g. using:
>
> open("http://xyz.de/TestPage") instead of open("/TestPage") but this does
> not work - it seems I can only use relative pathes here. The testng.xml
> file  does not have any parameters to change the server name either:
>
> http://tapestry.apache.org/integration-testing.html
>
> Is there another way to do this?
>
> Cheers Oliver
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com