title,body,link,tags,view_count,is_answered,score,answer_count
Pure Gui testing using VNC,"<p>I need to test complex gui interface, with many widgets written in I think Qt.
Now I use opencv, vnc, vncdotool, pytesseract and some other tools.
It works but it's not easy to write the test and I cannot include anyone who is not very good in the tools above. It is also not easy to update the code if something changes in gui.
I searched for some convenient tool, but it's all same heavily web browser based tools that are searching for objects.
Is there a user friendly automation tool, where I could grab an image via VNC, verify that is expected, read some ocr, send key strokes, move/drag the mouse etc.. ?</p>
",https://stackoverflow.com/questions/66694130/pure-gui-testing-using-vnc,"['user-interface', 'automated-tests', 'ui-testing', 'vnc']",543,True,0,3
Reinitializing a PyQt5 App without restarting (for GUI testing with squish),"<p>Is it possible to reinitialize (reset) a pyqt5 GUI App without needing to be closed and restarted? I mean to bring the Pyqt5 App to the original status (like deleting all entries that the user made after running it).</p>
<p>My problem: I'm using squish for Qt for testing. My ApplicationUnderTest (AUT) is used here as AttachedApp. Now when I run a test case and do some recording and then colse it, the AUT still have the modified state of the App (with all entries made in the previous testcase). Now when I want to record a new test case it will not work as I want, because I want that every test case shall be recorded and replayed without any kind of dependency on other test cases. I know that it's possible to let squish restart the AUT for every test case and thus it will be correctly reinitialized, but that's not what I want in this case. I want to let squish run the AUT only one time at the beginning and then attaching the AUT as used and then bring the AUT to original status for every test case without to restart it.</p>
",https://stackoverflow.com/questions/68191542/reinitializing-a-pyqt5-app-without-restarting-for-gui-testing-with-squish,"['user-interface', 'pyqt', 'pyqt5', 'squish']",153,False,0,1
Pyinstaller to OpenCV problem. Facial Emotion Recognition,"<p>Ok so, I'm developing a facial expression recognition app using Python. I was exporting the Python backend in a Tkinter GUI. Testing the app using the cmd and the python app.py it all works.
The issue happens when I convert the app.py in an exe file using Pyinstaller. When I run the app I get this error:</p>
<pre><code>cv2.error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-i1s8y2i1\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'
</code></pre>
<p>I don't understand why I get this problem only in the exe file :/</p>
",https://stackoverflow.com/questions/67466732/pyinstaller-to-opencv-problem-facial-emotion-recognition,"['python', 'opencv']",87,False,0,0
Azure GUIX automated testing specifically for languages,"<p>I was checking the feasibilty of Automated testing using Azure GUIX using win32 simulation executable.
I have checked using Inspect but could only find window title bar,close ,maximise, minimise on logs</p>
<p>I also tried recording and play back of macro in GUIX sudio and understood that recorded file is a binary and can't be modified for automation</p>
<p>Please let me know a way to automate GUI.</p>
<p>When I checked Embedded Wizard they have extensive documntation on GUI testing</p>
",https://stackoverflow.com/questions/67102338/azure-guix-automated-testing-specifically-for-languages,"['automated-tests', 'azure-rtos']",78,True,1,1
Is it possible to run UNIT TEST with Cypress standalone version similar to how Jasmine does it? (in browser),"<p>Cypress allows for GUI testing in browser as well as Unit Testing using the NodeJS installation version.
But I was wondering if the standalone version, aside for UI testing, it also allows for Unit testing.
I don't seem to find any information in regards.</p>
<p>I am working on a website project that uses <strong>plain HTML + JS</strong>, meaning that there is <strong>no NodeJS involved</strong> nor anything similar.
I need to write some Unit tests for it.</p>
<p>If I was to use Jasmine, that provides a simple inline script linking such as <code>&lt;script type=&quot;text/javascript&quot; src=&quot;lib/jasmine-{#.#.#}/jasmine.js&quot;&gt;&lt;/script&gt;</code>.</p>
<p>But I'm not sure how it is done in Cypress, or if it is even possible.
It would be handy to be able to do Unit test and UI test with the same testing library.</p>
",https://stackoverflow.com/questions/67152773/is-it-possible-to-run-unit-test-with-cypress-standalone-version-similar-to-how-j,"['unit-testing', 'jasmine', 'cypress']",247,False,1,0
How to automate MacOS OS user interaction tests?,"<p>At work I am setting up a product that sets up and manages security policies on MacOs systems among others. Unfortunately I could not find in the documentation of this product exactly which OS mechanism is used for the application and local management of the policies, but I think for my question this knowledge is not essential.
I am looking for a solution to test the policy itself. Currently, I have to manually log in to the test system and manually call various apps and services to check if the policy blocks or allows the correct actions. Are there any tools/libraries in the Mac world to automate this task?
For GUI testing I found this library by a quick google <a href=""https://github.com/google/EarlGrey/tree/earlgrey2"" rel=""nofollow noreferrer"">https://github.com/google/EarlGrey/tree/earlgrey2</a>. But I don't know if it is suitable for testing any apps/services in the sense of my use case. For example, would I have to find all the window ID's etc. by hand before I can write the test? Can I use them in my scenario at all?
Are there any other Swift/Objective-C libraries for this kind of tests? Or maybe even some in Ruby?
It would be ideal if this solution could also be integrated into a CI/CD pipeline.</p>
<p>Thanks a lot for your help!</p>
",https://stackoverflow.com/questions/70382405/how-to-automate-macos-os-user-interaction-tests,"['swift', 'objective-c', 'macos', 'operating-system', 'automated-tests']",107,False,0,1
How to get all ComboBox ListItem values in a .NET 4.8 WinForms application with UIAutomation?,"<p>I am hoping this is not a silly question with a very obvious solution I'm just not seeing, but with some GUI testing my functional test team is responsible for at work for a software project, I'm encountering a change in behavior with ComboBoxes while updating our GUI automation library's behavior with how we interact with GUI elements using UIAutomation. The newest development version WinForms application that our software product is using .NET 4.8. With this update, I am noticing changes with the behavior of elements.</p>
<p>For example, with menu bar items, in order to get the children elements of a menu selection, the item needs to be expanded before any children are visible. <strong>Inspect</strong> observes the same behavior. We were able to overcome this hurdle fairly easily with a slight code modification to our GUI library. I can understand to a degree why Microsoft made this change with .NET 4.8.<br />
Searching through all descendants of a top level window can be disastrous on test time.</p>
<p>With comboboxes, however, it seems the behavior is slightly different. With comboboxes, there are two children when not expanded:</p>
<pre><code> -Combobox
   |-Text item
   |-button item
</code></pre>
<p>The ComboBox has an <code>ExpandCollapsePattern</code>. Intuition tells me that much like the menu bar items, if I expand it and then try to get a list of children, or even descendants, I should see more than 2 elements in the collection. Even with a decent delay after performing an Expand() on the <code>ExpandCollapsePattern</code> for the ComboBox and refocusing on the ComboBox (I've read that is sometimes necessary for certain children items), I still only see 2 elements, even if I'm searching for descendants.</p>
<p>When I look at the ComboBox when expanded with <strong>Inspect</strong>, I see the following:</p>
<pre><code> -Combobox
   |-List item
   |   |-List item
   |   |-List item
   |   |-List item
   |   |-List item
   |   |-List item
   |   |-List item
   |-Text item
   |-button item
</code></pre>
<p>The updated method for handling comboboxes with this new behavior currently looks like this:</p>
<pre><code>public List&lt;AutomationElement&gt; GetComboBoxEntries(AutomationElement parentElement)
{
    List&lt;AutomationElement&gt; items = new List&lt;AutomationElement&gt;();

    try
    {
        var expandCollapsePattern = (ExpandCollapsePattern)parentElement.GetCurrentPattern(ExpandCollapsePatternIdentifiers.Pattern);
        expandCollapsePattern.Expand();

        //Slight delay
        DelayFor(1000);

        //Set focus to the combobox
        parentElement.SetFocus();

        //perform a FindAll() searching all descendants of the parentElement
        var collection = FindAllListItems(parentElement);

        //Add every element to the list
        foreach (AutomationElement element in collection)
        { items.Add(element); }
    }
    catch (Exception e)
    {
        Console.WriteLine(&quot;There was an error performing the operation.&quot;);
        Console.WriteLine(&quot;Error: &quot; + e.Message);
        Console.WriteLine(&quot;Stack Trace: &quot; + e.StackTrace);
    }
    return items;
}
</code></pre>
<p>A solution I perceive, although not practical when a significant number of items is present in the ComboBox, that I foresee to fix our problem is to use keyboard/click input to iterate through every member of a ComboBox and capture the current value pattern for the element. We have had to do some dirty voodoo under the hood before, but I really don't like that kind of code. I prefer to be clean with UIA where possible. Additionally, it just seems quite tedious.</p>
<p>Before this .NET 4.8 change, we were able to get the child list item elements, examine the value for each one to verify nothing invalid as a part of our GUI smoke test. Now, it seems there are a lot of hoops you have to jump through just to get the end result.</p>
<p>Am I missing something here that is obvious? I'd prefer to keep whatever solution within the realm of UIA. Much like coming to the realization of how the behavior changed with menu bar items, I am sure there is a solution with ComboBoxes.</p>
<p>I'm just not seeing it. Hopefully one of you with a little more UIA expertise can point me in the right direction. Thank you.</p>
",https://stackoverflow.com/questions/67979152/how-to-get-all-combobox-listitem-values-in-a-net-4-8-winforms-application-with,"['c#', 'winforms', 'combobox', 'ui-automation', '.net-4.8']",496,False,1,1
"Java Selenium Potential Chrome Cookies, Driver, ExpectedConditions API Issue?","<p><strong>INTRO</strong>:</p>
<p>I am a student using Java Selenium for GUI testing. I cannot get test cases to run on my desktop but other members of my team are able to.</p>
<p><strong>WHAT TECH/SOFTWARE IS BEING USED</strong></p>
<p>We are using JDK 14, IntelliJ Community Edition, BitBucket for our repo, and JUnit 4.</p>
<p><strong>WHAT AM I TESTING</strong></p>
<p>I am testing a sample single page application. I add a task, use a date picker to add a date, and then I click the &quot;Add Item&quot; button. However the click to the button isn't registered and the task isn't added to the list. If I restart my computer the first @Test works but the second one fails to clear the cookies and the second @Test fails.</p>
<p><strong>DETAILED VERSION:</strong></p>
<p>I am coming from a Surface Book 2 to a Alienware R10 desktop. My team was able to pull the project and run all of the test cases with no problem. However, I was unable to. The same program works on my SB2 but not on the Alienware R10 (AMD 3900 Processor).</p>
<p><strong>WHAT I HAVE TRIED:</strong></p>
<ul>
<li><p>I used both a locally stored Chrome Driver and I used Boni Garcia's
WebDriverManager.</p>
</li>
<li><p>The project is built using Maven so I have tried to use both
dependencies and also add the selenium files directly to my project
structure with no success.</p>
</li>
<li><p>I reformatted my new R10 and tried to install everything again. I
carefully added the JAVA_HOME and MAVEN_HOME to my system path.</p>
</li>
<li><p>I tried to use ChromeOptions after seeing some posts on SOF and none
of those worked either.</p>
</li>
<li><p>The QA dev who leads us tried to help me for about 40 minutes and
couldn't figure it out. He said the problem isn't with my IDE but it
is with the Chrome cookies. I will have to clear the cookies every
time I want to run a JUnit Selenium test. However, other members of
my team do not have to do this and this doesn't always work.</p>
</li>
</ul>
<p><strong>EXTRA DETAILS:</strong></p>
<ul>
<li><p>I got a new Alienware R10 with the AMD Ryzen 3900 chip. I have added
JAVA_HOME and MAVEN_HOME to my Path and environmental variables.</p>
</li>
<li><p>I may be adding to the project structure or dependencies incorrectly.</p>
</li>
<li><p>This is my first post so please let me know if I should format the
question better or if I left any important details out.</p>
</li>
</ul>
<p><strong>CONCLUSION</strong></p>
<p>I am pretty worried I wanted to study and practice over the weekend but I have put a lot of time into fixing this. My next idea is to use Eclipse instead of IntelliJ and see if I can get it running there. Any advice here would be helpful.</p>
<p><strong>EDIT</strong></p>
<p>Eclipse is not working either and has the same problem. This tells me the problem is definitely not related to the IDE. It is likely a CPU or Browser related issue. I also tried using other drivers through the WebDriverManger dependency.</p>
<p>Upon further research it seems to register clicks and actually add to the Tasks if I add a few Thread.sleep() functions into my code instead of the ExpectedConditions and element visability. <strong>The problem may be stemming from using the ExpectedConditions API but again this is working for my teammates and not for me. Could this potentially be a AMD chipset issue?</strong></p>
<p>The element visibility may be the wrong function to use here but it did work on my teammates machines so that is why I didn't try to look for an alternative there. The function we are using looks at the DOM tree and we may instead want to see the visibility on the browser instead. I had difficulty testing this out as I didn't have a laptop to work with.</p>
<p>I reformatted my old laptop so it could be sold since I had this new PC set up but I will use it to try another function to see if it brings a different result.</p>
<p><strong>EDIT2:</strong></p>
<p><strong>Observation/Guess</strong></p>
<p>I  am going to guess the problem is with the AMD 3900 CPU. The Thread.sleep() changes the behaviour to at least click my 'Add Item' button. It still does fail the tests I put it through and the ExpectedConditions API still doesn't work.</p>
<p>I am going to be returning the Alienware R10 and going to get an intel CPU R10 or build my own PC.</p>
<p>This is <strong>just an educated guess</strong> based on the difference in the behavior seen between my and myteammates' machines they have intel I have AMD.</p>
<p>If you are facing a similar issue please confirm whether you are using AMD or Intel in this thread. It will help others as well. I'm sure there are work arounds but they did not work for me. I also tried using ChromeOptions to disable the GPU and a few other options.</p>
<p>However there was no success and unless there is a better answer I'm blaming the AMD 3900 CPU.</p>
<p>Thanks and please contribute to this thread if you are facing a similar issue or have found a better answer. Any speculation could be helpful too.</p>
",https://stackoverflow.com/questions/67351982/java-selenium-potential-chrome-cookies-driver-expectedconditions-api-issue,"['java', 'selenium', 'junit4']",66,False,1,1
