Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Finally I found the solution for those who are using windows Machine for running the Tests using any method. Well, implementation is not in Java, but you can do it very easily.</p> <p>Use <code>AutoIt</code> tool. It has all the capability to handle windows. It is a free tool.</p> <ol> <li><p>Install AutoIt: <strong><a href="http://www.autoitscript.com/site/autoit/downloads/" rel="nofollow noreferrer">http://www.autoitscript.com/site/autoit/downloads/</a></strong></p></li> <li><p>Open the Editor and write below code for Hiding any window.</p> <pre><code>AutoItSetOption("WinTitleMatchMode", 2) WinSetState("Title Of Your Window", "", @SW_HIDE) </code></pre></li> <li><p>To Unhide it, you can use below line of code.</p> <pre><code>AutoItSetOption("WinTitleMatchMode", 2) WinSetState("Title Of Your Window", "", @SW_SHOW) </code></pre> <p><code>WinTitleMatchMode</code> has different options which can be used to match Windows title.</p> <pre><code>1 = Match the title from the start (default)` 2 = Match any substring in the title 3 = Exact title match 4 = Advanced mode, see Window Titles &amp; Text (Advanced) </code></pre></li> </ol> <p>So, what I've done is: I have created an .exe file of a small program and passed a parameter as a command line argument as below.</p> <pre><code>Runtime.getRuntime().exec("C:/Diiinnovation/HideNSeek.exe 0 \"" + "Mozilla Firefox" + "\""); </code></pre> <p><strong>in <code>HideNSeek.exe</code> - I have below AutoIt Code:</strong></p> <pre><code>AutoItSetOption("WinTitleMatchMode", 1) if $CmdLine[0] &gt; 0 Then if $CmdLine[1] == 0 Then WinSetState($CmdLine[2], "", @SW_HIDE) ElseIf $CmdLine[1] == 1 Then WinSetState($CmdLine[2], "", @SW_SHOW) Else EndIf EndIf </code></pre> <p><code>$CmdLine[]</code> is an array, which will have all command line parameters...</p> <pre><code>$CmdLine[0] = number of Parameter $CmdLine[1] = 1st Parameter after Exe Name ... </code></pre> <p>If there is any space in the Window Title, then you have to use double quotes to pass it as a command line parameter like above.</p> <p>Below Line of code will execute AutoIt exe and if I pass <strong>'0'</strong> in 1st parameter then it will hide the window and if I will pass <strong>'1'</strong> then it will unhide windows matching the title.</p> <pre><code>Runtime.getRuntime().exec("C:/Diiinnovation/HideNSeek.exe 0 \"" + "Mozilla Firefox" + "\""); </code></pre> <p>I hope this will help you. Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload