wille525 Absent Member.
Absent Member.
4350 views

How to maximize a BrowserWindow in a Oracle Forms application

Jump to solution

How can I maximize a window in a Oracle Forms application. 

The code below doesn't work:

BrowserApplication webBrowser = _desktop.BrowserApplication("WebBrowser");
webBrowser.SetActive();
webBrowser.Maximize();

The highest level of this application is the /OracleFormsContainer object. I can't maximize this.

How should I do this?

0 Likes
1 Solution

Accepted Solutions
wille525 Absent Member.
Absent Member.

RE: How to maximize a BrowserWindow in a Oracle Forms application

Jump to solution

Thanks,

my final solution for this:

using SilkTest.Ntf.Swing;

using System.Windows.Forms;

namespace Silk4NETProject_OHI.Tools

{

   public static class ResizeWindow

   {

       public static void Maximize(this OracleFormsContainer container)

       {

           Screen scrn = Screen.PrimaryScreen;

           var breedte = scrn.WorkingArea.Width;

           var Hoogte = scrn.WorkingArea.Height;

           container.Invoke("resize", breedte, Hoogte);

       }

   }

}

0 Likes
5 Replies
wille525 Absent Member.
Absent Member.

RE: How to maximize a BrowserWindow in a Oracle Forms application

Jump to solution

These key combinations do not work:

_desktop.TypeKeys("<Alt>+<Space>")
Thread.Sleep(1000);
_desktop.TypeKeys("x");

When I press the keys in reallife everything is working fine. In debug or test mode the screen is not maximized

0 Likes
Micro Focus Expert
Micro Focus Expert

RE: How to maximize a BrowserWindow in a Oracle Forms application

Jump to solution

Hi wille525,

Could you elaborate a bit more on what you want to achieve? If you want to maximize the browser window in which the Oracle Forms applet is hosted, you can either use

  var webBrowser = _desktop.Find<BrowserApplication>("//BrowserApplication");
  webBrowser.Maximize();

or the short-hand syntax:

  _desktop.BrowserApplication("//BrowserApplication").Maximize();

Or are you referring to a Oracle Forms specific full-screen mode regardless of the browser?

Thanks,
Ralph

0 Likes
wille525 Absent Member.
Absent Member.

RE: How to maximize a BrowserWindow in a Oracle Forms application

Jump to solution

Hi Ralph, this maximizes the initial (blank) browser window that is by default opened when you start a Oracle Forms application. But the browser instance in which the Oracle Forms application is running is not maximized. This is not a standaard Html page. The graphical objects are Swing SWT objects.

0 Likes
Micro Focus Expert
Micro Focus Expert

RE: How to maximize a BrowserWindow in a Oracle Forms application

Jump to solution

Hi! 

Do you use the “separateFrame=True” option described at https://community.oracle.com/thread/985348 to make your Oracle Forms application appear in a separate window? In that case, I’m afraid that Silk Test currently doesn’t support this out of the box, as the window is only recognized as a generic “OracleFormsContainer”. 

You can however try to implement it yourself using the custom controls support in Silk Test. For me, it worked to create a new custom control with the base class OracleFormsContainer, Silk Test class OracleFormsWindow and the custom control class name oracle.ewt.swing.JBufferedFrame. In the generated partial class OracleFormsWindow.cs you can then add a method that calls the internal “resize” method of the underlying Oracle Forms object to resize it:

public partial class OracleFormsWindow {
  public void Maximize() {
    Invoke("resize", 1024, 768);
  }
}

You can find out about the other methods that you can call via dynamic invoke by calling GetDynamicMethodList() on your OracleFormsWindow object. For additional information on custom controls and dynamic invoke in Silk4NET, see Custom Controls.

Best Regards,
Ralph

0 Likes
wille525 Absent Member.
Absent Member.

RE: How to maximize a BrowserWindow in a Oracle Forms application

Jump to solution

Thanks,

my final solution for this:

using SilkTest.Ntf.Swing;

using System.Windows.Forms;

namespace Silk4NETProject_OHI.Tools

{

   public static class ResizeWindow

   {

       public static void Maximize(this OracleFormsContainer container)

       {

           Screen scrn = Screen.PrimaryScreen;

           var breedte = scrn.WorkingArea.Width;

           var Hoogte = scrn.WorkingArea.Height;

           container.Invoke("resize", breedte, Hoogte);

       }

   }

}

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.