/** Maximize the current window */ protected void _maximize() throws SAFSException { String message = null; // The window can't be resotred if it is maximized by selenium API. // So use the SAFS Robot to maximize the windows firstly try { super._maximize(); return; } catch (SAFSException e) { message = "Can't maximize window by SAFS Robot. Try Selenium API to maximize. Exception=" + e.getMessage(); Log.warn(message); if (!sUtils.maximizeWindow(winObject.getWindowId(), selenium)) { throw new SAFSException("Fail to maximize by Selenium API."); } } }
/** Minimize the current window */ protected void _minimize() throws SAFSException { String message = null; try { sUtils.minimizeWindow(testRecordData.getWindowGuiId()); return; } catch (Throwable se) { message = "Can not minimize window with native function. Exception=" + se.getMessage(); Log.warn(message); // If we fail to minimize window, try the SAFS Robot to do. try { super._minimize(); return; } catch (Exception e) { message = "Fail to minimize window by SAFS Robot. Exception=" + message; Log.error(message); throw new SAFSException(message); } } }
protected void setPosition() throws SAFSException { setFocusToWindow(); super.setPosition(); }
protected void action_verifyGuiImageToFile() throws SAFSException { setFocusToWindow(); super.action_verifyGuiImageToFile(); }
protected void action_getGuiImage() throws SAFSException { setFocusToWindow(); super.action_getGuiImage(); }
protected void minimize() throws SAFSException { setFocusToWindow(); super.minimize(); }
protected void restore() throws SAFSException { setFocusToWindow(); super.restore(); }