Fixed wndow size, clicking set positions

11 views
Skip to first unread message

Max Russell

unread,
Aug 1, 2007, 6:16:53 AM8/1/07
to watir-...@googlegroups.com

Hi-

 

I’ve two questions:

 

Does anyone know of how to set the size of IE to a fixed 1024*768 (regardless of desktop resolution)

 

Has anyone had any experience of clicking fixed positions rather than controls?

 

thanks

 

 

Max Russell
Senior Test Analyst
INPS

 

Paul Rogers

unread,
Aug 1, 2007, 9:58:17 AM8/1/07
to watir-...@googlegroups.com
I did have some code to set the window size, I'll try and find it ( remind ina few days if I dont send anything ;-) )
You can probably use autoit for clicking coordinates, but its also possible with the win32api
 
Paul

Max Russell

unread,
Aug 1, 2007, 10:57:36 AM8/1/07
to watir-...@googlegroups.com

I’m using autoit currently, it’s quite nice, but haven’t yet found out how to do the HWND stuff.

 

ta

Paul Rogers

unread,
Aug 12, 2007, 9:54:01 AM8/12/07
to watir-...@googlegroups.com
 
# this class is used to hold the size and position of the IE window
# it is used by the setWindowPosition of the IEController
class IEWindowPosition
 
    # The height of the window
    attr_accessor :myHeight
 
    # The width of the window
    attr_accessor :myWidth
 
    # The top of the window
    attr_accessor :myTop
 
    # The left edge of the window
    attr_accessor :myLeft
 

    # create an instance of this object
    #  * myHeight   - int - the height of the window in pixels
    #  * myWidth    - int - the width of the window in pixels
    #  * myTop      - int - the top position of the window in pixels
    #  * myleft     - int - the left position of the window in pixels
    def initialize(  myHeight, myWidth, myTop,myLeft)
        @myHeight = myHeight
        @myWidth = myWidth
        @myTop = myTop
        @myLeft = myLeft
        #puts " left = #{@myLeft} top =#{@myTop}"
 
    end
end
 
 
    # set the position of the browser position is a IEWindowPosition object
    def setWindowPosition ( position  )
 
        @ie.top=position.myTop
        @ie.left = position.myLeft
        @ie.height = position.myHeight
        @ie.width = position.myWidth
    end
 

 
Reply all
Reply to author
Forward
0 new messages