How to max chrome browser 44 in QTP 11.52

I am able to open chrome browser in the following scripts:

Dim iURL
Dim objShell
iURL = "www.google.ca"
set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", iURL, "", "", 1

But how to opne chrome browser in full screen?

Thanks

Tags:

Parents
  • Verified Answer

    Hi Blair,

     

    You have several options:

     

    1. Modifying the arguments of ShellExecute method:

     

    Dim iURL
    Dim objShell
    iURL = "www.google.ca --start-fullscreen"
    set objShell = CreateObject("Shell.Application")
    objShell.ShellExecute "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", iURL, "", ""

     

    ' OR:

     

    Dim iURL
    Dim objShell
    iURL = "www.google.ca"
    set objShell = CreateObject("Shell.Application")
    objShell.ShellExecute "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", iURL, "", "", 3

     

    Use the first or second option depending if you want to open Chrome in full screen or maximized respectively.

     

    2. Using FullScreen method of Browser test object: In this case you will have to either add the Browser object to the repository or access it programmatically. After opening the browser, you will need to add the following code to enter full screen mode:

     

    Browser("Google").FullScreen ' After having added Browser("Google") object to the repository

    ' OR

    Browser("some property:=some value").FullScreen ' Programmatically accessing the Browser

     

    3. Using SendKeys method or DeviceReplay to send F11 key to enter full screen. For example entering below statements after your code:

     

    Set DeviceReplay = CreateObject("Mercury.DeviceReplay")
    DeviceReplay.PressKey 87
    DeviceReplay = Nothing

     

    Kind Regards,

    Francisca

Reply Children
No Data