title,body,link,tags,view_count,is_answered,score,answer_count
Swing GUI Testing (Jenkins + GitLab),"<p>We currently try to get working our GUI tests on Jenkins and GitLab (Linux + Xvfb). Our current problem is that the tests that passing on Windows, sporadically fails on Jenkins when we use AssertJSwing. Without to use AssertJSwing (we simply search for our components and provide manipulations with them in EDT (button clicks/selections in tables/etc)) we was able to write tests, that stable working with Jenkins but some of them (that passing Jenkins), still fails on GitLab (but no random test fails).</p>
<p>Probably we should to consider something when we writing our GUI tests? Probably somebody had same problem and found a solution?</p>
",https://stackoverflow.com/questions/75375647/swing-gui-testing-jenkins-gitlab,"['java', 'swing', 'jenkins', 'gitlab']",26,False,0,0
Retrieving the Handle of a Windows Native File Browser generated by QFileBrowser,"<p>I am trying to create a GUI testing demo for a QT application. I know I am able to use QTestLib to interact with QT widgets, but I am having issues trying to interact with native popups generated by certain parts of our application.</p>
<p>One such instance is the static <code>QFileBrowser</code> like <code>getOpenFileName()</code>, which generates a browser native to the OS of the machine by default (in this case, it is Windows), and this is what we use for our application's file browsers.</p>
<p>I am having some trouble trying to access the handle of the native file browser generated by the code.</p>
<p>Once I called <code>QFileBrowser::getOpenFileName()</code>, I ran a thread that would find the <code>QFileDialog</code> widget found within the <code>QApplication::topLevelWidgets()</code>, and then get the <code>HWND</code> through the <code>QWidgets::winId()</code> and try to access its child handles like below:</p>
<pre class=""lang-cpp prettyprint-override""><code>QWidgetList popups = QApplication::topLevelWidgets();

for (auto* widget : popups)
{
    if (widget-&gt;inherits(&quot;QFileDialog&quot;))
    {
        QFileDialog* mb = qobject_cast&lt;QFileDialog*&gt;(widget);

        HWND fileDialogHandle = (HWND)mb-&gt;winId();

        // Find the handle to the child buttons
        // Both of these handles return null
        HWND openButtonHandle = FindWindowEx(fileDialogHandle, NULL, L&quot;Button&quot;, L&quot;&amp;Open&quot;);
        HWND cancelButtonHandle = FindWindowEx(fileDialogHandle, NULL, L&quot;Button&quot;, L&quot;&amp;Cancel&quot;);

        // Click the &quot;Open&quot; button
        SendMessage(openButtonHandle, BM_CLICK, 0, 0);

        // Click the &quot;Cancel&quot; button
        SendMessage(cancelButtonHandle, BM_CLICK, 0, 0);;
 
        QApplication::processEvents();
    }
}
</code></pre>
<p>The actual handle of the native file browser that I see via Visual Studio Spy++ is different from the handle in the code. As far as I can tell, they are not related to each other either.</p>
<p>Property of the <code>QFileDialog</code> handle, and the actual file browser's handle:</p>
<p><a href=""https://i.stack.imgur.com/BUoXX.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/BUoXX.png"" alt=""image"" /></a></p>
<p>I wonder if there is a way for me to reliably get the actual handle of the native file browser dialog generated by <code>QFileBrowser</code>? Would I have better luck making my own custom file browser functions?</p>
",https://stackoverflow.com/questions/76213919/retrieving-the-handle-of-a-windows-native-file-browser-generated-by-qfilebrowser,"['c++', 'windows', 'qt', 'winapi', 'handle']",37,False,0,0
