Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(Watir webdriver) How to move Browser to another screen when using multiple display in OSX 10.9

I know there is a function called browser.window.move_to(0, 0) to move the browser into different position, but the OSX 10.9 is completely new for it.

Are there any methods can be used to move the browser to another desktop? E.g. Console to trigger command in "Desktop 2", but I want the browser appear in "Desktop 1".

Many thanks!

like image 707
George Jor Avatar asked Feb 24 '14 02:02

George Jor


1 Answers

Ha, I was about to say this probably isn't possible before I tried this:

browser.window.move_to(-1200,0)

My second monitor is oriented to the left of my main screen. It worked. Nice question.

You'll need to fool around with it to get it right but watir appears to be able to use the entire canvas of monitors. If your monitor was above your main screen for example you'd move it there using something like

browser.window.move_to(0,-1000)
like image 154
boulder_ruby Avatar answered Oct 07 '22 23:10

boulder_ruby