[wtr-general] Re: Moving a window
Chaos King, I think you've already been supplied several ways by this group to scroll the window, but as part of your initial question you asked... I need to move the windows To do that just have the browser to goto a URL, for example: require 'rubygems' require 'watir' browser = Watir::Browser.new browser.goto(http://www.google.com;) # Move to x=10, y=20 browser.goto(javascript:window.moveTo(10,20)) # Size to x=1024, y=7768 browser.goto(javascript:window.resizeTo(1024,768) ) These are but two javascripts commands that browsers support. There are many other commands that can be performed on a browser window, so long as that browser (IE, FF, Safair, Chrome, Opera, etc), supports javascript). Here's a nice site to find ind out more javascript commands: http://www.w3schools.com/jsref/obj_window.asp Enjoy, Joe On Apr 21, 3:29 pm, Abe Heward abe.hew...@gmail.com wrote: Done:http://jira.openqa.org/browse/WTR-475 -- 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: Moving a window
On Thu, Apr 21, 2011 at 3:18 AM, Abe Heward abe.hew...@gmail.com wrote: Is scrollIntoView strictly an IE thing? No. Try something like this: browser.element(how, what).scrollIntoView I do not have firewatir installed so I can not test it, but I remember using it. Željko -- watir.com - community manager watir.com/book - author watirpodcast.com - host viaqa.mobi conference on software testing - organizer -- 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: Moving a window
Unfortunately that just fails with an unknown method error. There aren't any text fields in the part of the screen that I want to get to. Perhaps this method only works with text fields? -- 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
[wtr-general] Re: Moving a window
I tried this method after seeing this thread as it got me curious as I'd never seen it before; and got the same error. I dug a little deeper, and found you'll possibly need to add in an extra command. Does this work for you? browser.element(how, what).document.scrollIntoView such as... browser.button(:id, btnSave).document.scrollIntoView On Apr 21, 2:51 pm, Abe Heward abe.hew...@gmail.com wrote: Unfortunately that just fails with an unknown method error. There aren't any text fields in the part of the screen that I want to get to. Perhaps this method only works with text fields? -- 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
[wtr-general] Re: Moving a window
My code: $ff.checkbox(:id, stdOptOut).document.scrollIntoView Error result: test.rb:7:in `main': undefined method `scrollIntoView' for :String (NoMethodError) -- 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
[wtr-general] Re: Moving a window
I use scrollintoview on IE7/8 + WinXP/7 without any errors (usually on div tags to reorient the page above the fold). Example: browser.div(how, what).document.scrollintoview orde On Apr 21, 8:24 am, Abe Heward abe.hew...@gmail.com wrote: My code: $ff.checkbox(:id, stdOptOut).document.scrollIntoView Error result: test.rb:7:in `main': undefined method `scrollIntoView' for :String (NoMethodError) -- 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
[wtr-general] Re: Moving a window
Still get the same error. Oh well. -- 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: Moving a window
My guess, not tested is that you'll have to fire an event on element in Firewatir. This isn't the cleanest api right now, but scrollIntoView on IE is a direct call into the underlying ole object. In Firewatir, it'd be a js call, similar to this: http://www.roseindia.net/javascript/javascript-scrollintoview.shtml on the DOM element. Something we definitely need a common api for, right now it's a leaky abstraction in IE Watir. Can you add a Jira ticket for this? Charley Baker Lead Developer, Watir, http://watir.com On Thu, Apr 21, 2011 at 12:49 PM, Abe Heward abe.hew...@gmail.com wrote: Still get the same error. Oh well. -- 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 -- 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: Moving a window
Done: http://jira.openqa.org/browse/WTR-475 -- 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