WATIR: Error to find all most object on a Java Script driven html page

S

sunkids

WATIR command:=============================
$ie.text_field:)name,/initiativeName/).set('WebActivity1')
==========================================
Error Exception:==============================
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists': Unable
to locat
e object, using name and (?-mix:initiativeName)
(Watir::Exception::UnknownObject
Exception)
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3382:in `set'
from webactivity.rb:36
==========================================
Html source code:=============================
<p/><label for="initiativeName">Name (required)</label><br/>
<script language="JavaScript">
<!-- hide script from old browsers
var newInitiative = true;
if (initiativeDataBean != null && initiativeDataBean.id != "" && "" !=
"true") {
newInitiative = false;
}
if (newInitiative) {
document.writeln('<input name="initiativeName" tabindex="1"
type="text" size="50" maxlength="64"
id="WC_InitiativePanel_FormInput_initiativeName_In_initiativeForm_1"/>');
}
else {
document.writeln('<input name="initiativeName" tabindex="1"
type="text" size="50" maxlength="64"
id="WC_InitiativePanel_FormInput_initiativeName_In_initiativeForm_1"
style="border-style:none" readonly="readonly" />');
}
//-->
</script>
==================================================
Object printout by WATIR:IE show_all_objects
command:=======================
-----------Objects in page -------------
text/css id=
text/javascript id=
src=/wcs/javascript/tools/common/Util.js
text/javascript id=
src=/wcs/javascript/tools/common/URLParser
..js
text/javascript id= src=
text/javascript id=
src=/wcs/javascript/tools/common/NumberFor
mat.js
text/javascript id= src=
HTML Document name=mccbanner id=
src=ToolsUIBanner
HTML Document name=mccmenu id=
src=ToolsUIMenu
HTML Document name=mccmain id=
src=ToolsUIMain
=================================================================

Could anyone help me to solve this problem? Or maybe WATIR has not yet
support this kind java script object?

Thanks in advance!

Regards,
Jonathan Ni
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,296
Messages
2,571,535
Members
48,281
Latest member
DaneLxa72

Latest Threads

Top