The way the browsers treat frames is almost like a completely seperate web page, and the way it's handled in the DOM is such that nothing inside the frame is 'visible' unless you specifically tell it to look for the element inside the frame.
http://wiki.openqa.org/display/WTR/Frames In cases like this, instead of looking at the HTML, I strongly recommend using something like firebug, or the IE Developer toolbar, which will let you click on the object and show you all the DOM (Document Object Model) information on it, which would include if it's in a frame etc. Most ofthe time I work with Watir, I get the info on the objects via tools like that, and rarely do I actually try to view the source (mosty to look for javascript interaction etc) The thing is that the source only shows you what you are starting out with, there's a lot of things (CSS, javascript, etc) that can manipute those objects as the page is built, and interacted with. without having direct access to the page, he's hard for anyone here to give you the exact code needed On Dec 16, 8:42 am, abhibolg123 <[email protected]> wrote: > Hi , > > yes, there is a iframe on the page just above this code. > No, there is not any other field with same id. > And Kay, i tried with "gem install watir- webdriver"but it did not > work,even showed previous error that i was getting like - > > "Unable to connect to machine : 127.0.0.1 on port 9997. Make sure that > JSSh > is properly installed and Firefox is running with '-jssh' option" > so i unistalled firewatir and then reinstall it with > http://wiki.openqa.org/display/WTR/FireWatir+Installationpage help > and also installed JSSH firefox extension for FF3.6 as i am using > FF3.6. > But still i am getting same error in main thread . > > thanks > Abhirevo > > On Dec 16, 5:28 am, Chuck van der Linden <[email protected]> wrote: > > > > > I'm wondering is this is perhaps a firebug problem?? > > > when I search the group for "(JsshSocket JSSyntaxError) I find some > > other threads where people are trying to do much the same thing > > > browser.div(how,what).text_field(:id,something).set("somevalue") and > > getting an error similar to yours. > > > a few things to check. Is the page using frames? > > if you search the page source for that ID value ("usernameinput") do > > you find it anywhere else on the page? > > Does the script work if run against IE instead of firefox? > > > On Dec 15, 11:46 am, abhibolg123 <[email protected]> wrote: > > > > <div class="gadget default" > > > <div class="view"> > > > <div id="content" class=""> > > > <form id="loginform" class="aui gdt" name="loginform" action="#" > > > method="POST"> > > > <fieldset> > > > <div> > > > <label id="usernamelabel" accesskey="u" for="usernameinput"> > > > <input id="usernameinput" class="text medium- > > > field" type="text" tabindex="1" name="os_username"> > > > <span id="usernameerror" class="error"></span> > > > > this is code for page ,where i am unable to access to username text > > > field.Please help me out .I am using firewatir with firefox version > > > 3.6.6 and Windows 7. > > > > thanks > > > Abhirevo > > > > On Dec 14, 11:15 pm, abhirevo1 <[email protected]> wrote: > > > > > Hi Friends, > > > > > I tried to access to an HTML element through div .I wrote it as > > > > *ie.div(:class,"gadget > > > > default").text_field(:id,"usernameinput").set("xyz")*becuase system > > > > showed me error: > > > > *Unable to locate element* via . > > > > *ie.text_field(:id,"usernameinput").set("xyz")* > > > > but still I am getting following error . > > > > Please help. > > > > > *C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/jssh_socket.rb:19:in > > > > `js_eval': missing ; before statement (JsshSocket::JSSyntaxError) > > > > from > > > > C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/jssh_socket.rb:27:in > > > > `js_eval_method' > > > > from > > > > C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:936:in > > > > `enabled?' > > > > from > > > > C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:922:in > > > > `assert_enabled' > > > > from > > > > C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/elements/text_field.rb:150:in > > > > `set'* > > > > > I want to make confirm that now Watir is able to access to username > > > > field or > > > > not because now "*Unable to locate element*"error is not coming although > > > > some new errors are produced. > > > > And also if somebody has idea why these new errors are coming, it would > > > > be a > > > > great help for me. > > > > > Thanks > > > > Abhirevo- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
