Re: [wtr-general] Javascript created div elements
No, it's not in a frame, but it doesn't exist if you do view source because the javascript and ajax did a document.write to create it after the first save. On Thu, Oct 7, 2010 at 4:14 AM, Željko Filipin < zeljko.fili...@wa-research.ch> wrote: > On Wed, Oct 6, 2010 at 7:13 PM, CJ wrote: > > I did an if test to see if it exists using this: > > if b.div(:id, "ta_1").exists? > > It says it doesn't. > > Is it in a frame? > > http://wiki.openqa.org/display/WTR/Frames > > Željko > -- > watir.com - community manager > watirpodcast.com - host > testingpodcast.com - audio podcasts on software testing. all of them > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > watir-general@googlegroups.com > http://groups.google.com/group/watir-general > watir-general+unsubscr...@googlegroups.com > -- CJ Romberger Wildwood Interactive http://www.wildwoodinteractive.com/ 512.732.9916 PLEASE NOTE: I only check this email address about once a day! If you're a client, the fastest way to reach me is to login to Basecamp, OR email supp...@wildwoodinteractive.com. If you're NOT a client? Why not become one!? :) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Javascript created div elements
It's several layers down. Are you saying to use a parent element that's visible to access it? What would the syntax look like on that? Say the parent element is another div with an id of wide_right_1 for example. On Thu, Oct 7, 2010 at 12:00 AM, Rajiv Nanduani < rajivkumarnandv...@gmail.com> wrote: > use first parent element of the div like it could be form /table then find > ur div element :) > > On Wed, Oct 6, 2010 at 1:13 PM, CJ wrote: > >> I have a page whose submit button uses ajax to create a record in a >> database, and then modify the form to make clickable div elements. >> When you click on the div element, it opens a new window. >> >> Those div elements are visible using Chrome or Firefox and choosing >> Inspect Element, but they are NOT available if I use watir to >> show_all_objects. >> >> I need to access those elements and then click on them. >> >> The code that's visible in Inspect Element through Firefox Firebug or >> Chrome looks like this: >> >> >> >> I did an if test to see if it exists using this: >> >> if b.div(:id, "ta_1").exists? >> >> It says it doesn't. >> >> I tried firing an event anyway, using this: >> b.div(:id, "ta_1").fire_event("onClick") >> >> Says it doesn't exist. >> >> Is this possible to do? >> >> I'm stuck. :( >> >> -- >> Before posting, please read http://watir.com/support. In short: search >> before you ask, be nice. >> >> watir-general@googlegroups.com >> http://groups.google.com/group/watir-general >> watir-general+unsubscr...@googlegroups.com<http://groups.google.com/group/watir-general%0awatir-general+unsubscr...@googlegroups.com> >> > > > > -- > RAJIV KUMAR > > <http://rajivkumarnandvani.wordpress.com/> > <http://learnqtphelp.blogspot.com/> > > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > watir-general@googlegroups.com > http://groups.google.com/group/watir-general > watir-general+unsubscr...@googlegroups.com > -- CJ Romberger Wildwood Interactive http://www.wildwoodinteractive.com/ 512.732.9916 PLEASE NOTE: I only check this email address about once a day! If you're a client, the fastest way to reach me is to login to Basecamp, OR email supp...@wildwoodinteractive.com. If you're NOT a client? Why not become one!? :) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Difficulty typing into textfield
I have it working like this: password = 'abc123' b.text_field(:name, "mock_password").set password If that doesn't work, you might want to just test to see if watir can even see that element. if b.text_field(:name, "mock_password").exists? puts "Password field exists" else puts "Password field missing" end On Wed, Oct 6, 2010 at 8:54 PM, Eric Mathiesen wrote: > Could also try .flash to ensure you are calling the right element from > orb. Css has given me some challenges in the past.. also try emwith > (;index, #).set > > On Oct 6, 2010 6:35 PM, "blkjk" wrote: > > I am trying to type text to a Login textfield. And when I use this > code to access it: > > $b.text_field(:name, 'mockPassword').set('abc123')No > password actually gets typed into the textfield and used for login. > > Here is what Firebug caught to identify the textfield: > > onfocus="jQuery('#mockPassword').hide();jQuery('#password').show();jQuery('#password').focus();" > value="password" name="mockPassword" id="mockPassword" style="width: > 150px; color: rgb(204, 204, 204);" class="input"> > > Any thoughts on how to make the code type the password into that > field? And yes, I wish to make it work on both IE8 & FF3.5 in Win7. > Thanks for any help on this. > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > watir-general@googlegroups.com > http://groups.google.com/group/watir-general > watir-general+unsubscr...@googlegroups.com<http://groups.google.com/group/watir-generalwatir-general+unsubscr...@googlegroups.com> > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > watir-general@googlegroups.com > http://groups.google.com/group/watir-general > watir-general+unsubscr...@googlegroups.com > -- CJ Romberger Wildwood Interactive http://www.wildwoodinteractive.com/ 512.732.9916 PLEASE NOTE: I only check this email address about once a day! If you're a client, the fastest way to reach me is to login to Basecamp, OR email supp...@wildwoodinteractive.com. If you're NOT a client? Why not become one!? :) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Javascript created div elements
I'll give the wait a try! Thank you for sending me this information! On Thu, Oct 7, 2010 at 10:07 AM, Željko Filipin < zeljko.fili...@wa-research.ch> wrote: > On Thu, Oct 7, 2010 at 5:05 PM, CJ Romberger > wrote: > > No, it's not in a frame, but it doesn't exist if you do view source > because the javascript and ajax did a document.write to create it after the > first save. > > That should not be a problem for Watir. Maybe the element it not (yet) > there when you check for it, but it is created later. See this: > > http://wiki.openqa.org/display/WTR/How+to+wait+with+Watir > > Željko > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > watir-general@googlegroups.com > http://groups.google.com/group/watir-general > watir-general+unsubscr...@googlegroups.com > -- CJ Romberger Wildwood Interactive http://www.wildwoodinteractive.com/ 512.732.9916 PLEASE NOTE: I only check this email address about once a day! If you're a client, the fastest way to reach me is to login to Basecamp, OR email supp...@wildwoodinteractive.com. If you're NOT a client? Why not become one!? :) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Manipulate Keystrokes on a MAC
Ozzi, you're using this on your Mac? What browser environment? I have Firefox and Chrome on my Mac, and I'm dead stuck on dismissing Javascript alert boxes. CJ On Wed, Oct 13, 2010 at 10:11 AM, Ozzi wrote: > thanks for your help guys but i kinda cheated in the end... I kinda > wrote some javascript to disable the popup that appears when clicking > on one of the button... > i wrote: > @browser.execute_script('window.alert = function () {};') > > this then turns off the alert boxes for the window... > it works for me and now i can run my scripts on all environments that > are available to me... > > Thanks for all the help guys, > > Usman Hussain > > On Oct 12, 1:06 pm, ayan wrote: > > You can try using Apple Script. > > > > On Mon, Oct 11, 2010 at 2:01 PM, Željko Filipin < > > > > > > > > zeljko.fili...@wa-research.ch> wrote: > > > On Thu, Oct 7, 2010 at 6:35 PM, Eric Mathiesen > > > wrote: > > > > DONT BUY A MAC. > > > > > As far as I know, a lot of Watir developers use a Mac. (But it looks > like > > > nobody has to send keystrokes.) > > > > > Željko > > > > > -- > > > Before posting, please readhttp://watir.com/support. In short: search > > > before you ask, be nice. > > > > > watir-general@googlegroups.com > > >http://groups.google.com/group/watir-general > > > watir-general+unsubscr...@googlegroups.com > > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > watir-general@googlegroups.com > http://groups.google.com/group/watir-general > watir-general+unsubscr...@googlegroups.com > -- CJ Romberger Wildwood Interactive http://www.wildwoodinteractive.com/ 512.732.9916 PLEASE NOTE: I only check this email address about once a day! If you're a client, the fastest way to reach me is to login to Basecamp, OR email supp...@wildwoodinteractive.com. If you're NOT a client? Why not become one!? :) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Unclickable DIV in GWT project
I got this to work by making it wait for a little bit after the save. I don't have time to put any code in here now, but you might want to try that. Someone else here suggested that, and it worked like a charm. On Tue, Oct 26, 2010 at 7:41 PM, jpapa wrote: > I'm attempting to use Watir to test a site developed on GWT. All > elements of the page are drawn by GWT and hence it relies very heavily > on Ajax. > > I have managed to click most elements,but there is a GWT tree widget > (which is basically a table with many nested divs) that simply won't > respond. > > I am able to locate the element I wish to click without issue. I've > tried it by :id, and :xpath and I know I am arriving at the correct > element. I've also confirmed with WatirMaker.rb that the element is > what I think it is. > > I've tried three ways of clicking on it - > > browser.div(:xpath, "//d...@id='DEVICES_GATEWAY']/div").click > > browser.div(:xpath, "//d...@id='DEVICES_GATEWAY']/ > div").fire_event('onclick') > > and a hack that worked elsewhere - > > browser.div(:xpath, "//d...@id='DEVICES_GATEWAY']/ > div").fire_event("onmouseover") > browser.div(:xpath, "//d...@id='DEVICES_GATEWAY']/ > div").fire_event("onmousedown") > browser.div(:xpath, "//d...@id='DEVICES_GATEWAY']/ > div").fire_event("onmouseup") > > However, none of these produce the click and there is no error > reported. I just fails silently. > > Other divs on the site can be clicked. Some using just .click and some > using the fire_events hack above. > > I'm totally stumped. > > I am using Windows 7 and IE 8. > > This tree widget is a significant UI element, so if I can't drive it I > think I'm sunk. (No pun intended.) > > > > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > watir-general@googlegroups.com > http://groups.google.com/group/watir-general > watir-general+unsubscr...@googlegroups.com<http://groups.google.com/group/watir-general%0awatir-general+unsubscr...@googlegroups.com> > -- CJ Romberger Wildwood Interactive http://www.wildwoodinteractive.com/ 512.732.9916 PLEASE NOTE: I only check this email address about once a day! If you're a client, the fastest way to reach me is to login to Basecamp, OR email supp...@wildwoodinteractive.com. If you're NOT a client? Why not become one!? :) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com