I am using the dataDriven construct to reach sites through a specialized
proxy, named Proxy in program extracts below.

 

When I give the dataDriven a spreadsheet with a list of URLs with valid
Titles for the target pages good things happen, it works! However, if I
force a bad Title (URL 2 below, eBay), the test fails (as expected) with
a "Wrong Title" message, as it should. BUT after that forced failure,
URLs 3 and 4 fail as in next paragraph but work if line 2 is returned to
a valid Title.

 

After the first failure, all subsequent tests fail, wrongly, with
"Unexpected exception caught: java.net.UnknownHostException."

 

The repeating pattern in the Stack Trace is 
 at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
 at org.apache.tools.ant.Task.perform(Task.java:364)
 at org.apache.tools.ant.Target.execute(Target.java:341)
 at org.apache.tools.ant.Target.performTasks(Target.java:369)
 at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
 at
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleChe
ckExecutor.java:37)
 at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
 at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
 at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
 

The Webtest xml file. Proprietary stuff removed but it works in other
test venues.

<?xml version="1.0"?>

 

<!DOCTYPE project SYSTEM "../dtd/Project.dtd">

 

<project name="Data Driven Test" default="DataDrivenTest">

 

  <!-- Which Proxy to use? -->

  <property name="proxyToVisit"         value='us' />

  <property name="proxyURL"
value='http://${proxyToVisit}.proxy' />

 

  <target name="DataDrivenTest">

 

    <webtest name="Setup Proxy" >

      <scriptStep description="Contact Proxy" language="groovy">

THIS WORKS JUST FINE IN OTHER CASES

                step.setWebtestProperty( 'proxyPortDynamic',
proxyPort.toString() ) ;

      </scriptStep>

 

      <!-- The proxyPortDynamic coming out of Groovy code is a "dynamic"
property. The setproxy tag requires "ant" properties. -->

      <storeProperty

        description="Convert proxyPortDynamic (dynamic property) to
proxyPort (ant property)."

        name="proxyPort"

        propertyType="ant"

        value="#{ proxyPortDynamic }"/>

 

    </webtest>

 

      <!-- Set the Proxy proxy as the way to obtain web pages. -->

    <dataDriven tableContainer="NoProxy_Domain_Pages_Four_Rows.xls" >

      <webtest name="Test Getting http://${URL}"; >

 

         <!-- Set the Proxy proxy as the way to obtain web pages. Does
not work without this reset. -->

        <setproxy proxyhost='${proxyURL}' proxyport='${proxyPort}' />

          <invoke url="http://${URL}"; description="http://${URL}"; />

          <verifyTitle text="${Title}" />

        <setproxy proxyhost='' />

 

      </webtest>

    </dataDriven>

 

    <webtest name="Shutdown Proxy" >

      <!-- Reset to no proxy -->

      <setproxy proxyhost='' />

      

      <scriptStep description='Stop Server' language='groovy'>

THIS WORKS JUST FINE IN OTHER CASES

      </scriptStep>

    </webtest>

  </target>

 

</project>

 

Excel spreadsheet

URL

Title

answers.yahoo.com

Yahoo! Answers - Home

cgi.ebay.com

WRONG TITLE eBay

go.yahoo.com

Yahoo! Go. The best Internet experience for your phone. Period.

home.myspace.com

MySpace

 

 

 

Reply via email to