Re: [Wtr-general] VBScript Fails with Watir
Hi Paul, Thank you for your reply. The problem i'm facing are not the expected end of statement errors. These do not appear with Watir and my application. The problem is a VBScript error where the document.all does not support the value property. In my two examples I was able to reproduce this were you not able to reproduce it? I've narrowed down the problem to the document.all call during one of Watir's click function sending an DispHTMLElementCollection with only one HTMLInputElement in it. the DispHTMLElementCollection does not have a value property and thus the error. Were you able to reproduce this problem? Thank you. FV - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6554messageID=18983#18983 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] VBScript Fails with Watir
Could you please post your fixed html + watir? What exactly did you fix? Could this be an environmental problem? Maybe i'm using a different IE (6) or OS (W2K3) ?? Did you fix the error in both examples i posted? This is error will completely shut down any Watir use at my company, and I am so excited to use such a cool tool... I really need to know how you fixed it!!! Thank you very much. FV - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6554messageID=18924#18924 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] VBScript Fails with Watir
Hi Paul, just ignore it, the other error happens anyway... i have this error in over 8 pages. Thanks! - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6554messageID=18898#18898 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
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;titleMy Pagelt;/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=#66lt;/td lt;td align=middle width=30% bgcolor=#66lt;font color=white size=3 face=Verdana, ariallt;strongReportslt;/stronglt;/fontlt;/td lt;/tr lt;/tablelt;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=#66 align=center lt;TR bgcolor=#66 lt;TD width=20% lt;P align=leftlt;font ID=idMenuTitle1 CLASS=clsMenuTitle color=#FFIniciolt;/fontlt;/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=4lt;ult;font color=#66lt;blt;font color=#66Reportes de Mantenimientonbsp;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;/fontlt;/blt;/fontlt;/ult;/td lt;/tr lt;tr lt;td colspan=4lt;font face=Tahoma size=2 color=#66Digite un rango de fecha y haga clic sobre la imagen para visualizar el reporte.lt;/fontlt;/td lt;/tr lt;tr lt;td colspan=4lt;font face=Tahoma size=2 color=#66nbsp;lt;/fontlt;/td lt;/tr lt;tr lt;td width=25% colspan=2 rowspan=5 lt;div align=centerlt;A name=MaintenanceReport id=MaintenanceReport style=cursor:handlt;IMG height=98 src=images/j0269256.wmf style=HEIGHT: 98px; WIDTH: 180px width=153 ALT=Haga clic para ver el reportelt;/Alt;/div lt;/td lt;td width=25%lt;font face=Tahoma size=2 color=#66lt;bFecha Inicial:lt;/blt;/fontlt;/td lt;td rowspan=5 width=25% lt;div align=centernbsp;lt;/div lt;/td lt;/tr lt;tr lt;td width=24%lt;font face=Tahoma size=2 color=#66lt;b lt;input type=text name=txtInitialDate id=txtInitialDate value=2/16/2007 maxlength=10 size=10nbsp;(mm/dd/)lt;/blt;/fontlt;/td lt;/tr lt;tr lt;td width=24%lt;font face=Tahoma size=2 color=#66lt;bFecha Final:lt;/blt;/fontlt;/td lt;/tr lt;tr lt;td width=24% lt;div align=leftlt;font face=Tahoma size=2 color=#66lt;b lt;input type=text name=txtFinalDate id=txtFinalDate value=2/16/2007 maxlength=10 size=10nbsp;(mm/dd/)lt;/blt;/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=24nbsp;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: hiddenlt;/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
Re: [Wtr-general] clicking on popup after selecting an item in select list
This worked great for me, thank you vikashkumar051. The only difference is that i hardcoded the path to my clickJSDialog since i was getting errors when building the path dinamically. def jsAlert(button, waitTime = 3) w = WinClicker.new c = start ruby C:\\ruby\\lib\\ruby\\gems\\1.8\\gems\\watir-1.5.1.1145\\watir\\clickJSDialog.rb #{button} #{waitTime} puts Starting #{c} w.winsystem(c) w=nil end THank you for this great function - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5857messageID=18797#18797 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] VBScript Fails with Watir
Hi Bret, This is not specific to the page, i have it happening in other pages without date text fields, in a form with only names, emails addresses, clicking on a link also causes the error. Therefore i do not think it is directly related to the date format. Maybe i'll post another reproducible example where this error also happens. Thanks for your reply!!! - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6554messageID=18819#18819 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] VBScript Fails with Watir
Here's another case where it fails, although this html was making an expected end of statement error that i was not able to be rid of (after switching from the asp to just html), the document.all error is also reproduced. HTML: lt;htmllt;head lt;titlemy page 2lt;/title lt;SCRIPT LANGUAGE=vbscript lt;!-- Sub chkZeroDecimals_OnClick frmInsert.chkTwoDecimals.status = false End Sub Sub chkTwoDecimals_OnClick frmInsert.chkZeroDecimals.status = false End Sub Sub hplTwo_OnClick dim intSearch dim intInitialPosition dim intFinalPosition dim intAuxiliaryCount dim strValuesP23 dim strFields dim intDecimals if document.all(txtIdentification).value lt; and IsNumber(trim(document.all(txtIdentification).value)) = true then if len(trim(document.all(txtIdentification).value))=8 then document.all(txtCheckDigit).value = CheckDigit(document.all(txtIdentification).value) frmFields.action = ClearingEntityP2C.asp frmFields.submit else window.alert Por favor, digite una Identificación válida (8 dígitos). end if end if End Sub -- lt;/SCRIPT lt;/head lt;body lt;table width=100% border=0 lt;tr lt;td align=middle valign=top colspan=2 width=68%lt;hr color=#66 lt;/td lt;td align=middle width=32% bgcolor=#66lt;font color=white size=3 face=Verdana, ariallt;strongPage Titlelt;/stronglt;/fontlt;/td lt;/tr lt;/tablelt;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=#66 align=center lt;TR bgcolor=#66 lt;TD width=20% lt;P align=leftlt;font ID=idMenuTitle1 CLASS=clsMenuTitle color=#FFIniciolt;/fontlt;/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 width=100% border=0 lt;tr style=BORDER-BOTTOM: black lt;td colspan=6 bordercolor=#00 bgcolor=#ff lt;plt;ult;font color=#66lt;blt;font color=#66 face=Tahoma Informacioacute;nlt;/fontlt;/blt;/fontlt;/ult;/p lt;/td lt;/tr lt;form action=ClearingEntityI.asp method=post id=frmInsert name=frmInsert onSubmit=return CheckData() lt;tr lt;td colspan=3lt;font size=2 face=Tahomalt;blt;font color=#66Identificacioacute;n:lt;/fontlt;/blt;/fontlt;/td lt;td colspan=3 width=50%lt;font size=2 face=Tahomalt;blt;font color=#66Digito de Chequeo:lt;/fontlt;/blt;/fontlt;/td lt;/tr lt;tr lt;td colspan=3 lt;font size=2 face=Tahoma lt;input name=txtIdentification size=8 maxlength=8 id=txtIdentification value= onBlur=VerifyIdentification(this.value); lt;Script language=JavaScript function VerifyIdentification(ValueSet){ if (ValueSet.replace(' ', '') != '') { if (98989898.indexOf(ValueSet) -1){ alert(La Identification que está queriendo utilizar, \nestá siendo utilizada por otra Camara de Compensación.\nPor favor cambie la identificación.); document.frmInsert.txtIdentification.value = ''; document.frmInsert.txtIdentification.focus(); } } } lt;/script lt;IMG alt = height=14 src=images/required.gif width=18 lt;/fontlt;/td lt;td colspan=3 width=50% lt;font size=2 face=Tahoma lt;input name=txtCheckDigit size=1 maxlength=1 disabled style=BACKGROUND-COLOR: silver id=txtCheckDigit value= lt;/fontlt;/td lt;/tr lt;input type=hidden name=txtDistributeInternationalTransactions id=txtDistributeInternationalTransactions value=0 lt;input type=hidden name=txtItemLevelReject id=txtItemLevelReject value=0 lt;tr lt;td colspan=3lt;font size=2 face=Tahomalt;blt;font color=#66Nombre:lt;/fontlt;/blt;/fontlt;/td lt;td colspan=3 width=50%lt;font size=2 face=Tahomalt;blt;font color=#66Fax:lt;/fontlt;/blt;/fontlt;/td lt;/tr lt;tr lt;script language=JavaScript function VerifyName(ValueSet){ if (ValueSet.replace(' ', '') != '') { if (OPERADOR,.toUpperCase().indexOf(ValueSet.toUpperCase()) -1){ alert(El nombre que está queriendo utilizar, \nestá siendo utilizado por otra Camara de Compensación.\nPor favor cambie
Re: [Wtr-general] VBScript Fails with Watir
Hi Bret, Thanks so much for your reply and sorry for not posting that code initially. mainFrame.link(:url,%r{Report\.asp}).click mainFrame.button(:name,cmdGo).click mainFrame.text_field(:name,txtInitialDate).set(2/10/2006) mainFrame.link(:id,ViewReport).click #previous step should open a new window but makes a VB script error reportWindow = IE.attach(:url,%r{ReportV}) The error is: c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:1510:in `attach_browser_window': Unable to locate a window with url of (?-mix:ReportV) (Watir::Exception::NoMatchingWindowFoundException) from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:1387:in `attach_init' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:1380:in `attach' from Client.rb:259 Thanks for your help - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6554messageID=18715#18715 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] VBScript Fails with Watir
I've just discovered another place where the same error comes up, however this error does not disable the script like the other. (maybe because in the previous the navigation occurs with a window.open whereas here a button is clicked and the form is posted.) the vbscript code is: if len(trim(document.all(txtOldPassword).value)) = 0 then //tell user to enter data The Watir code is: mainFrame.link(:url,%r{ChangePassword}).click mainFrame.text_field(:name,txtOldPassword).set(user_password) txtRandomPassword = random_string(12) mainFrame.text_field(:name,txtNewPassword).set(txtRandomPassword) mainFrame.text_field(:name,txtConfirmPassword).set(txtRandomPassword) mainFrame.button(:name,cmdSave).click #above line generates the error (so i suppose data is not validated), but still navigates correctly to next page mainFrame.button(:name,cmdReturn).click Just more data. Thanks for reading!!! - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6554messageID=18717#18717 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] VBScript Fails with Watir
Bret, thank you for your reply. Well yes, the error is in that IE.attach, however the cause comes from the previous line, because it did not execute a window.open vbscript command. The window.open did not get to execute because of an error when getting the value property out of a [document.all(suchandsuch).value] vbscript call. So the cause for the error in 259 is in the previous line. After looking at it a bit more, it seems that Watir has issues with the document.all call, since this performs fine when clicking on it by hand. Perhaps the OLE object behaves different when executing that document.all call??? Again, thanks for your time and consideration, Bret. FV - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6554messageID=18722#18722 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] VBScript Fails with Watir
Hello, I'm in dire need to solve this issue, I might have to dump Watir altogether if it is not resolved soon :(( I've definetly narrowed it down to some sort of type mismatch within the vbscript engine. When i break the VBscript debugger, i cannot evaluate simple vbscript dim variables, because i get type-mismatch. MAybe the fact that they have no type has something to do with this? i.e.: Dim strInitialDate Dim strFinalDate strInitialDate = document.all(txtInitialDate).value strFinalDate = document.all(txtFinalDate).value One of my coworkers suggested that maybe Watir was instantiating an older version of internet explorer. Is this possible? could a certain kind of comand set the OLE engine to behave in a backwards compatible way (i.e. like a previous version of IE)??? I've tried accessing the IE.ie object, but i cannot find an api reference to the OLE object InternetExplorer. Does anyone know where there might be some API documentation of the raw IE object? Please help!!! thank you. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6554messageID=18742#18742 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] VBScript Fails with Watir
Thank you for your reply and the helpful links Paul, Yes, i reckon i am one of the few, nevertheless, i must auto-test the application as it is, since we cannot afford any changes to the application other than the ones we're already making. I sure appreciate your time and patience. Thank you very much. Best regards, fedevela. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6554messageID=18749#18749 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] VBScript Fails with Watir
Hello, With the help of my coworkers, I've made some progress in identifying the problem. [b]It is definitely a type conversion error.[/b] I should clarify that this is an intranet web application that only supports IE, that is the reason why VBScript is acceptable. Anyway, i changed my vbscript to test it in the following way: Dim strInitialDate Dim strFinalDate window.alert(TypeName(document.all(txtInitialDate))) strInitialDate = document.all(txtInitialDate).value strFinalDate = document.all(txtFinalDate).value The first time I run the page with Watir, and the window.alert produces the following: DispHTMLElementCollection Without closing the browser window, i wait for Watir to fail and shutdown. then i manually click on the image and i get: HTMLInputElement Therefore Watir is producing a DispHTMLElementCollection when performing the click, but when clicking manually the correct HTMLInputElement is generated. Any way around this with this new information??? Thank you. Best regards, fedevela - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6554messageID=18753#18753 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] VBScript Fails with Watir
Thank you all s much for your replies, i'll post what i'm doing in the hope that you can replicate the error, Here's my HTML 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 and the vbscript SCRIPT LANGUAGE=vbscript !-- dim intValuesPos intValuesPos = 0 Function MaintenanceReport_onClick() Dim strInitialDate Dim strFinalDate strInitialDate = document.all(txtInitialDate).value --ERROR 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 - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6554messageID=18757#18757 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] VBScript Fails with Watir
Thank you for your reply Paul. I've doubled and tripled checked and there is not another element with the same name, txtInitialDate HOWEVER. there is a hidden input with the name txtInitialDatePost so maybe watir is matching with a regex? that would explain. Is it possible to enumerate the elements in the collection and get their types? I'm a total newbie to vbscript and the documentation has confused me a lot. THANK you Thank you... seems like we are finally narrowing it down. Thank you again, Paul Bret and John - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6554messageID=18759#18759 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] [NEWBIE] can't convert WIN32OLE into
Thank you Bret for your accurate answer, I will upgrade to watir 1.5, but in the meanwhile i will comment out the add_checker( navigation_checker ) line. What exactly does this function do? Actually my question is, how safe is it to uncomment? Thank you Bret For the others, thank you for your reply. However those others were not helpful. If you check the console output i pasted, you will realize that puts cmdButton actually works fine and prints the properties of the button. Furthermore the error is in a match function, not in the puts function. More careful reading next time people!!! - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6525messageID=18634#18634 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] [NEWBIE] can't convert WIN32OLE into
Bret, I've updated to latest version of 1.5.1 and the problem has gone away. Thank you so much for your help, it is the good community feedback that allows companies like mine be able to rely on open products!!! I really appreciate your time. Thank you. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6525messageID=18653#18653 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general