Select Page
Codoid Blog

Maximizing Browser using DOM

Being a leading QA Company, we write blogs on all prominent software testing topics and tools using our real-world experience. So stay sharp by subscribing to our Newsletter.

This article explains how to maximize a browser window using HTML DOM. Actually, it is not maxmizing the browser, it resizes browser to the size what we get from maximize.

Code

Dim oPage,inScreenWidth,inScreenHeight

Set oPage=Browser("name:=Google").Page("title:=Google")

'Getting Screen Width
inScreenWidth=oPage.Object.parentWindow.screen.width

'Getting Screen Height
inScreenHeight=oPage.Object.parentWindow.screen.height

'Moving Browser to (0,0) position
oPage.Object.parentWindow.moveTo 0, 0

'Resizing Window using resizeTo method with Screen Width and Screen Height values
oPage.Object.parentWindow.resizeTo inScreenWidth,inScreenHeight
  

Comments(0)

Submit a Comment

Your email address will not be published. Required fields are marked *

Talk to our Experts

Amazing clients who
trust us


poloatto
ABB
polaris
ooredo
stryker
mobility