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.
>
> <html>
> <head>
> <title>My Page</title>
> <SCRIPT LANGUAGE=vbscript>
> <!--
> 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
> -->
> </SCRIPT>
> <meta name="VI60_DefaultClientScript" Content="VBScript">
> <meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
> </head>
> <body>
> <table width="100%" border="0">
> <tr>
> <td align="middle" valign="top" colspan="2" width="70%"><hr
> color="#000066"></td>
> <td align="middle" width="30%" bgcolor="#000066"><font
> color="white" size="3" face="Verdana,
> arial"><strong>Reports</strong></font></td>
> </tr>
> </table><meta HTTP-EQUIV="REFRESH" CONTENT="1860; URL=LoginC.asp"
> target="mainFrame">
> <input type="hidden" name="txtProcessControl" id="txtProcessControl"
> value="0">
> <TABLE border=0 cellPadding=1 cellSpacing=1 width="100%"
> bgcolor="#000066" align="center">
> <TR bgcolor="#000066">
>
> <TD width="20%">
> <P align=left><font ID="idMenuTitle1" CLASS="clsMenuTitle"
> color="#FFFFFF">Inicio</font></P>
> </TD>
> </tr>
> </TABLE>
> <SCRIPT LANGUAGE=vbscript>
> <!--
> Sub idMenuTitle1_Onclick
> location.href = "HomeC.asp"
> End Sub
> -->
> </SCRIPT>
> <Script Language="JavaScript">
> <!--
> if (document.all && window.print) {
> document.oncontextmenu = right;
> }
> function right(e) {
> return false;
> }
>
> //-->
> </Script>
> <table id=frmMaintenance name="frmMaintenance" width="100%" border="0">
> <tr>
> <td colspan="4"><u><font color="#000066"><b><font
> color="#000066">Reportes de
> Mantenimiento </font></b></font></u></td>
> </tr>
> <tr>
> <td colspan="4"><font face="Tahoma" size="2"
> color="#000066">Digite un rango de fecha y haga clic sobre la imagen para
> visualizar el reporte.</font></td>
> </tr>
> <tr>
> <td colspan="4"><font face="Tahoma" size="2"
> color="#000066"> </font></td>
> </tr>
> <tr>
> <td width="25%" colspan="2" rowspan="5">
> <div align="center"><A name="MaintenanceReport"
> id="MaintenanceReport" style="cursor:hand"><IMG height=98
> src="images/j0269256.wmf" style="HEIGHT: 98px; WIDTH: 180px" width=153
> ALT="Haga clic para ver el reporte"></A></div>
> </td>
> <td width="25%"><font face="Tahoma" size="2"
> color="#000066"><b>Fecha Inicial:</b></font></td>
> <td rowspan="5" width="25%">
> <div align="center"> </div>
> </td>
> </tr>
> <tr>
> <td width="24%"><font face="Tahoma" size="2"
> color="#000066"><b>
> <input type="text" name="txtInitialDate" id="txtInitialDate"
> value="2/16/2007" maxlength="10"
> size="10"> (mm/dd/aaaa)</b></font></td>
> </tr>
> <tr>
> <td width="24%"><font face="Tahoma" size="2"
> color="#000066"><b>Fecha Final:</b></font></td>
> </tr>
> <tr>
> <td width="24%">
> <div align="left"><font face="Tahoma" size="2"
> color="#000066"><b>
> <input type="text" name="txtFinalDate" id="txtFinalDate"
> value="2/16/2007" maxlength="10"
> size="10"> (mm/dd/aaaa)</b></font>
> </div>
> </td>
> </tr>
> <tr>
> <td width="24%">
> <div align="center">
>
> </div>
> </td>
> </tr>
> <tr>
> <td width="24%"> </td>
> </tr>
> <tr>
> <td width="24%"> </td>
> </tr>
> <tr>
> <td width="24%" height="24"> </td>
> </tr>
> <tr>
> <td width="20%">
> <div align="center">
>
> </div>
> </td>
> <form action="MaintenanceReportP0.asp" method="post" id=frmCancel
> name=frmCancel>
> <td width="20%">
> <div align="Left">
> <input type="submit" name="cmdCancel" value="Cancelar">
> </div>
> </td>
> </form>
> <td width="20%"><INPUT id=txtUpperLimit
> name=txtUpperLimit size=5 value="" style="VISIBILITY:
> hidden"></td>
> <form method="post" id="frmExecute" name="frmExecute">
> <td width="40%"><INPUT id=txtQ name=txtQ size=1
> style="VISIBILITY: hidden">
> <input type="hidden" name="txtInitialDatePost" id="txtInitialDatePost">
> <input type="hidden" name="txtFinalDatePost" id="txtFinalDatePost">
> </td>
> </form>
> </tr>
> </table>
> </body>
> </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