diff --git a/remote.go b/remote.go index 2f8da45..9235678 100644 --- a/remote.go +++ b/remote.go @@ -779,6 +779,18 @@ func (wd *remoteWD) MaximizeWindow(name string) error { } func (wd *remoteWD) MinimizeWindow(name string) error { + if !wd.w3cCompatible { + if name != "" { + var err error + name, err = wd.CurrentWindowHandle() + if err != nil { + return err + } + } + url := wd.requestURL("/session/%s/window/%s/minimize", wd.id, name) + _, err := wd.execute("POST", url, nil) + return err + } return wd.modifyWindow(name, "POST", "minimize", map[string]string{}) } diff --git a/selenium.go b/selenium.go index 1c6020e..80d1c4d 100644 --- a/selenium.go +++ b/selenium.go @@ -271,6 +271,7 @@ type WebDriver interface { // MaximizeWindow maximizes a window. If the name is empty, the current // window will be maximized. MaximizeWindow(name string) error + MinimizeWindow(name string) error // ResizeWindow changes the dimensions of a window. If the name is empty, the // current window will be maximized. ResizeWindow(name string, width, height int) error