This is a migrated thread and some comments may be shown as answers.

AspNetDevelopmentServer40 local web server and BaseUrl not working as expected

3 Answers 87 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
seanwic
Top achievements
Rank 1
seanwic asked on 07 Jul 2011, 06:29 AM

Hi,

I have recently come across the WebAii Testing Framework and as a proof of concept wanted to implement some tests using NUnit against one of our projects (ASP.NET MVC 2).

The following config is set:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="WebAii.Settings" type="ArtOfTest.WebAii.Core.SettingsConfigSectionHandler, ArtOfTest.WebAii" />
    <section name="WebAii.Settings.Web" type="ArtOfTest.WebAii.Core.WebSettingsConfigSectionHandler, ArtOfTest.WebAii" />
  </configSections>
  
  <WebAii.Settings.Web
    aspNetDevServerPort="1234"
    localWebServer="AspNetDevelopmentServer40"
    defaultBrowser="InternetExplorer"
    enableScriptLogging="true"
    enableSilverlight="false"
    enableUILessRequestViewing="false"
    killBrowserProcessOnClose="false"
    recycleBrowser="false"
    silverlightApplicationPath=""
    silverlightConnectTimeout="30000"
    useHttpProxy="false"
    verboseHttpProxy="false"
    webAppPhysicalPath="C:\mysite\mysite.Web"
    />
  
  <WebAii.Settings
    annotateExecution="false"
    annotationMode="All"
    clientReadyTimeout="30000"
    createLogFile="true"
    enableUILessRequestViewing="false"
    executionDelay="200"
    executionTimeout="20000"
    logAnnotations="false"
    logLocation="C:\WebAiiLog\"
    queryEventLogErrorsOnExit="false"
    simulatedMouseMoveSpeed="0.3"
    unexpectedDialogAction="HandleAndFailTest"
    waitCheckInterval="500"
    xMultiMgr="false"
  />
  
</configuration>

And the code in my unit test looks is:
// Launch a browser instance
Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
// The active browser
ActiveBrowser.NavigateTo(@"~/Home");

I am expecting to navigate to: http://localdev.mydomain:1234/mysite/Home
But get: http://localhost:1234/Home instead

I have the following mapping in my hosts file:
127.0.0.1       localdev.mydomain

I'm not sure if I have my settings wrong? I would appreciate any help with this issue.

Thanks

3 Answers, 1 is accepted

Sort by
0
Accepted
Cody
Telerik team
answered on 07 Jul 2011, 05:33 PM
Hi Seanwic,

This setting:

localWebServer="AspNetDevelopmentServer40"

tells the framework you want to launch the ASP.NET development server on your local machine and run tests against the web application located at the path specified by webAppPhysicalPath running on that development server. This means we're always going to use "localhost" and the port number specified in aspNetDevServerPort instead of the baseUrl value i.e. baseUrl is ignored in this configuration for NavigateTo steps.

If you want to use the baseUrl instead of the ASP.NET development server (or manually launch your application via the development server before running your test) then leave localWebServer set to "None" or remove the setting all together (it will default to None then).

All the best,
Cody
the Telerik team
Register today for a live 'What's New in Test Studio R1 2011 SP2' event on Tuesday, July 19 at 2pm EST!

Have you looked at the new Online User Guide for Telerik Test Studio?
0
seanwic
Top achievements
Rank 1
answered on 08 Jul 2011, 01:33 AM
Hi Cody,

Thanks for the reply. I thought that this might be the case. 

I have resolved this by kicking off WebDev.WebServer40 via a batch file and specifying the relevant virtual path using the /vpath: parameter in the command line. 

Having the ability to specify the vpath when using AspNetDevelopmentServer40 as a local webserver would be of great benefit as this should allow me to use the dev webserver in my scenario without having to call a batch file.

Thanks
0
Cody
Telerik team
answered on 08 Jul 2011, 04:52 PM
Hi Seanwic,

We very much appreciate the feedback! I have entered a feature request for this.

Greetings,
Cody
the Telerik team
Register today for a live 'What's New in Test Studio R1 2011 SP2' event on Tuesday, July 19 at 2pm EST!

Have you looked at the new Online User Guide for Telerik Test Studio?
Tags
General Discussions
Asked by
seanwic
Top achievements
Rank 1
Answers by
Cody
Telerik team
seanwic
Top achievements
Rank 1
Share this question
or