ok, I'll take a look sometime today. Might not be till this evening though

Paul
----- Original Message ----- 
From: "Federico Vela" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, February 16, 2007 5:06 AM
Subject: Re: [Wtr-general] VBScript Fails with Watir


> Hi Paul, thank you for your offering, here's the html and watir with which 
> i was able to reproduce the error. The thing i dont understand is why 
> would the watir click wrap a single object with a collection, whereas the 
> manual click does not.
>
> &lt;html>
> &lt;head>
> &lt;title>My Page&lt;/title>
> &lt;SCRIPT LANGUAGE=vbscript>
> &lt;!--
> dim intValuesPos
>
> intValuesPos = 0
>
>
> Function MaintenanceReport_onClick()
> Dim strInitialDate
> Dim strFinalDate
>
> 'NEXT LINE PRODUCES AN ERROR WITH WATIR
> strInitialDate = document.all("txtInitialDate").value
> strFinalDate = document.all("txtFinalDate").value
>
>
> window.open "MaintenanceReportV.asp?ID=" & CDate(strInitialDate) & "&FD=" 
> & CDate(strFinalDate), "AdminMaintenaceReport", "width=800, height=600, 
> left=" & (screen.width - 800)/2 & ", top=" & (screen.height - 600)/2 & ", 
> resizable=yes, scrollbars=yes"
>
> end function
> -->
> &lt;/SCRIPT>
> &lt;meta name="VI60_DefaultClientScript" Content="VBScript">
> &lt;meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
> &lt;/head>
> &lt;body>
> &lt;table width="100%" border="0">
>  &lt;tr>
>    &lt;td align="middle" valign="top" colspan="2" width="70%">&lt;hr 
> color="#000066">&lt;/td>
>    &lt;td align="middle" width="30%" bgcolor="#000066">&lt;font 
> color="white" size="3" face="Verdana, 
> arial">&lt;strong>Reports&lt;/strong>&lt;/font>&lt;/td>
>  &lt;/tr>
> &lt;/table>&lt;meta HTTP-EQUIV="REFRESH" CONTENT="1860; URL=LoginC.asp" 
> target="mainFrame">
> &lt;input type="hidden" name="txtProcessControl" id="txtProcessControl" 
> value="0">
> &lt;TABLE border=0 cellPadding=1 cellSpacing=1 width="100%" 
> bgcolor="#000066" align="center">
>  &lt;TR bgcolor="#000066">
>
>    &lt;TD width="20%">
> &lt;P align=left>&lt;font ID="idMenuTitle1" CLASS="clsMenuTitle" 
> color="#FFFFFF">Inicio&lt;/font>&lt;/P>
> &lt;/TD>
> &lt;/tr>
> &lt;/TABLE>
> &lt;SCRIPT LANGUAGE=vbscript>
> &lt;!--
> Sub idMenuTitle1_Onclick
> location.href = "HomeC.asp"
> End Sub
> -->
> &lt;/SCRIPT>
> &lt;Script Language="JavaScript">
> &lt;!--
> if (document.all && window.print) {
>   document.oncontextmenu = right;
> }
> function right(e) {
>  return false;
> }
>
> //-->
> &lt;/Script>
> &lt;table id=frmMaintenance name="frmMaintenance" width="100%" border="0">
>  &lt;tr>
>    &lt;td colspan="4">&lt;u>&lt;font color="#000066">&lt;b>&lt;font 
> color="#000066">Reportes de 
> Mantenimiento&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/font>&lt;/b>&lt;/font>&lt;/u>&lt;/td>
>  &lt;/tr>
>  &lt;tr>
>    &lt;td colspan="4">&lt;font face="Tahoma" size="2" 
> color="#000066">Digite un rango de fecha y haga clic sobre la imagen para
>    visualizar el reporte.&lt;/font>&lt;/td>
>  &lt;/tr>
>  &lt;tr>
>    &lt;td colspan="4">&lt;font face="Tahoma" size="2" 
> color="#000066">&nbsp;&lt;/font>&lt;/td>
>  &lt;/tr>
>  &lt;tr>
>    &lt;td width="25%" colspan="2" rowspan="5">
>      &lt;div align="center">&lt;A name="MaintenanceReport" 
> id="MaintenanceReport" style="cursor:hand">&lt;IMG height=98 
> src="images/j0269256.wmf" style="HEIGHT: 98px; WIDTH: 180px" width=153 
> ALT="Haga clic para ver el reporte">&lt;/A>&lt;/div>
>    &lt;/td>
>    &lt;td width="25%">&lt;font face="Tahoma" size="2" 
> color="#000066">&lt;b>Fecha Inicial:&lt;/b>&lt;/font>&lt;/td>
>    &lt;td rowspan="5" width="25%">
>      &lt;div align="center">&nbsp;&lt;/div>
>    &lt;/td>
>  &lt;/tr>
>  &lt;tr>
>    &lt;td width="24%">&lt;font face="Tahoma" size="2" 
> color="#000066">&lt;b>
>    &lt;input type="text" name="txtInitialDate" id="txtInitialDate" 
> value="2/16/2007" maxlength="10" 
> size="10">&nbsp;(mm/dd/aaaa)&lt;/b>&lt;/font>&lt;/td>
>  &lt;/tr>
>  &lt;tr>
>    &lt;td width="24%">&lt;font face="Tahoma" size="2" 
> color="#000066">&lt;b>Fecha Final:&lt;/b>&lt;/font>&lt;/td>
>  &lt;/tr>
>  &lt;tr>
>    &lt;td width="24%">
>      &lt;div align="left">&lt;font face="Tahoma" size="2" 
> color="#000066">&lt;b>
>        &lt;input type="text" name="txtFinalDate" id="txtFinalDate" 
> value="2/16/2007" maxlength="10" 
> size="10">&nbsp;(mm/dd/aaaa)&lt;/b>&lt;/font>
>      &lt;/div>
>    &lt;/td>
>  &lt;/tr>
>  &lt;tr>
>    &lt;td width="24%">
>      &lt;div align="center">
>        &nbsp;
>      &lt;/div>
>    &lt;/td>
>  &lt;/tr>
>  &lt;tr>
>    &lt;td width="24%">&nbsp;&lt;/td>
>  &lt;/tr>
>  &lt;tr>
>    &lt;td width="24%">&nbsp;&lt;/td>
>  &lt;/tr>
>  &lt;tr>
>    &lt;td width="24%" height="24">&nbsp;&lt;/td>
>  &lt;/tr>
>  &lt;tr>
>    &lt;td width="20%">
>      &lt;div align="center">
>        &nbsp;
>      &lt;/div>
>    &lt;/td>
>    &lt;form action="MaintenanceReportP0.asp" method="post" id=frmCancel 
> name=frmCancel>
>    &lt;td width="20%">
>      &lt;div align="Left">
>        &lt;input type="submit" name="cmdCancel" value="Cancelar">
>      &lt;/div>
>    &lt;/td>
>    &lt;/form>
>    &lt;td width="20%">&lt;INPUT id=txtUpperLimit
>      name=txtUpperLimit size=5 value="" style="VISIBILITY: 
> hidden">&lt;/td>
>    &lt;form method="post" id="frmExecute" name="frmExecute">
>    &lt;td width="40%">&lt;INPUT id=txtQ name=txtQ size=1 
> style="VISIBILITY: hidden">
> &lt;input type="hidden" name="txtInitialDatePost" id="txtInitialDatePost">
> &lt;input type="hidden" name="txtFinalDatePost" id="txtFinalDatePost">
>    &lt;/td>
>    &lt;/form>
>  &lt;/tr>
> &lt;/table>
> &lt;/body>
> &lt;/HTML>
>
>
> And the Watir Code
>
> require "Watir"
> include Watir
>
> mainFrame = IE.new
> mainFrame.goto("http://192.168.1.24/watirReproduce.html";)
>
> mainFrame.text_field(:name,"txtInitialDate").set("2/10/2006")
> mainFrame.link(:id,"MaintenanceReport").focus
> mainFrame.link(:id,"MaintenanceReport").click
> #VB script error
> reportWindow = IE.attach(:url,%r{MaintenanceReportV})
> reportWindow.close
>
>
> Thank you so much!
> ---------------------------------------------------------------------
> Posted via Jive Forums
> http://forums.openqa.org/thread.jspa?threadID=6554&messageID=18785#18785
> _______________________________________________
> Wtr-general mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-general
> 


_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to