I wonder if I can get a little direction on a problem:
I have a text_field that has an onBlur event that produces a popup window.
Without a 'set_no_wait' for the text_field I don't know how to handle this.
Could you point me in the right direction.
I don't want to avoid the popup, I want to handle it.
Thank you for your time.
Sample web page additem1.htm.
<body>
<form name="aspnetForm" method="post" action="additem1.htm" id="aspnetForm">
<script language="javascript">
function OnBlur()
{
var i;
var txtAdjQty = document.getElementById('a1');
var maxValue = 30;
i = parseInt(txtAdjQty.value);
if(i > maxValue)
{
alert("Quantity entered is larger than allowed.");
txtAdjQty.value = maxValue;
}
}
</script>
<table ><tr><td rowspan="2"><input name="na1" type="text" value="1" id="a1"
OnBlur="JavaScript:OnBlur();" /></td></tr></table>
</form></body></html>
Sample script that will cause the popup.
require 'watir'
require 'watir/testcase'
include Watir
class TC_00 < Watir::TestCase
def test_textfield_popup
testFolder = "C:\\WTR\\Wtr-HTMLTest\\"
ie = IE.start(testFolder + "AddItem1.htm")
ie.text_field(:id, "a1").set("200")
end
end
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6683&messageID=19178#19178
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general