title,body,link,tags,view_count,is_answered,score,answer_count
Spring Boot GUI Testing Selenium WebDriver,"<p>I developped a Spring Boot / Angular JS app. Now I'm trying to implement some GUI interface tests.</p>

<p>I tryed to use the Selenium ChromeDriver, so I added the Selenium dependency :</p>

<pre><code>&lt;dependency&gt;
    &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
    &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
    &lt;version&gt;3.4.0&lt;/version&gt;
&lt;/dependency&gt;
</code></pre>

<p>And I created my first test :</p>

<pre><code>@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = MyMainClass.class)
public class SeleniumTest {
    private WebDriver driver;

    @Before
    public void setup() {
        System.setProperty(""webdriver.chrome.driver"", ""my/path/to/chomedriver"");
        driver = new ChromeDriver();
    }

    @Test
    public void testTest() throws Exception {
        driver.get(""https://www.google.com/"");
    }
}
</code></pre>

<p>This works fine. But now I want to get my app pages with :</p>

<pre><code>driver.get(""http://localhost:8080/"");
</code></pre>

<p>But I get an ""ERR_CONNECTION_REFUSED"" in the chrome browser.</p>

<p>I think it's because I need to set up my test to run my web app before to run the test but I don't find how to achieve this ?</p>
",https://stackoverflow.com/questions/44072400/spring-boot-gui-testing-selenium-webdriver,"['angularjs', 'spring', 'selenium', 'spring-boot', 'gui-testing']",5636,TRUE,2,1
C++ desktop GUI testing on Travis CI,"<p>I enjoy Travis CI a lot for continuous integration testing. I test most of my C++ console, desktop (Qt, SFML) and web (using Wt) applications with it. It is great for testing browser-based applications <a href=""https://docs.travis-ci.com/user/gui-and-headless-browsers/"" rel=""nofollow noreferrer"">and has documented this nicely</a>.</p>

<p>One thing I cannot do is test the GUI of a desktop application on Travis CI. </p>

<p>I need basic things like 'get a window with a certain title/name its size', 'click left mouse button in the center' of the window' and 'send a space to the window'. </p>

<p>I can already do this locally, but only locally, with xdotools, LDTP2 and Sikuli. On Travis CI, however, I cannot get those tools to run successfully. I have been trying to write a <a href=""https://github.com/richelbilderbeek/testing_cpp_gui_applications_tutorial"" rel=""nofollow noreferrer"">tutorial</a> about it (<a href=""https://github.com/richelbilderbeek/testing_cpp_gui_applications_tutorial/tree/master/scripts"" rel=""nofollow noreferrer"">these are my scripts</a>), I have <a href=""https://github.com/travis-ci/travis-ci/issues/6006"" rel=""nofollow noreferrer"">contacted the folks at Travis</a> and even <a href=""https://github.com/richelbilderbeek/testing_cpp_gui_applications_tutorial/issues/3"" rel=""nofollow noreferrer"">set a bounty here</a>, all without success.</p>

<p>Because this is a complex process (setting up a windows manager on Travis, writing desktop applications to test, writing scripts to test these in bash) I think it is not useful to post those little individuals errors here (most have answers here already). </p>

<p><strong>My question is</strong>: does anyone have a working example of</p>

<ul>
<li>a non-web C++ GUI application</li>
<li>that has its GUI tested both locally and on Travis</li>
<li>these tests consist out of sending key presses and mouse clicks</li>
</ul>

<p>I do not care about the exact tools (xdotools or some other window manager tool, Qt or some other C++ GUI library, bash or any other scripting language). All I want is to have Travis CI check my GUI upon a <code>git push</code>.</p>
",https://stackoverflow.com/questions/42595612/c-desktop-gui-testing-on-travis-ci,"['c++', 'user-interface', 'travis-ci', 'desktop-application', 'xdotool']",689,FALSE,2,2
Headless exception while GUI testing (java swing) with gitlab-ci,"<p>I've a virtual server running a gitlab runner.
I've now added some GUI unit tests which run nicely on my pc but not on the virtual server.</p>

<p>It always exits with:</p>

<pre><code>java.awt.HeadlessException: 
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
</code></pre>

<p>Any idea how to get this running with gitlab-ci?</p>

<p>Edit:</p>

<p>My virtual server is running centos 7</p>

<p>This im my current .gitlab-ci.yml</p>

<pre><code>image: kaiwinter/docker-java8-maven
#maven:3-jdk-7

before_script:
  - ""Xvfb :99 &amp;""
  - ""export DISPLAY=:99""

maven_build:
  stage: build
  script:
  - ""mvn clean package""
  - ""cat target/site/jacoco/index.html""
</code></pre>

<p>Now, the headlessexception is gone but basically all unit tests are failing due to awt exceptions like:
Could not initialize class java.awt.image.IndexColorModel</p>

<p>Edit2:
I've added the headless option as suggested:</p>

<pre><code>image: kaiwinter/docker-java8-maven
#maven:3-jdk-7

before_script:
  - ""Xvfb :99 &amp;""
  - ""export DISPLAY=:99""

maven_build:
  stage: build
  script:
  - ""mvn clean package -Djava.awt.headless=true""
  - ""cat target/site/jacoco/index.html""
</code></pre>

<p>Now I get the headless exceptions again...</p>
",https://stackoverflow.com/questions/47575673/headless-exception-while-gui-testing-java-swing-with-gitlab-ci,"['java', 'swing', 'unit-testing', 'gitlab-ci', 'headless']",1965,TRUE,1,3
what tools use for GUI/functional testing of Eclipse RCP apps?,"<p>We are developing RCP Eclipse based application,currently for functional/GUI tests we use RCPTT tool although we are not fully satisfied with it.</p>

<p>What are the other options beside SwtBot for GUI testing (on multiplatform Linux/Windows)? Abby,TFTP,Jubula are discontinued or not maintained any more. </p>
",https://stackoverflow.com/questions/47924455/what-tools-use-for-gui-functional-testing-of-eclipse-rcp-apps,"['eclipse', 'eclipse-rcp']",259,FALSE,1,1
Running tests on VM does not work unless window is open,"<p>We are attempting to do our testing remotely, so we set up some Virtual Machines to run our GUI tests and to free up our local machines. What we were hoping for was to have the tests run just like they would on a physical machine, however they seem to require an active Remote Desktop Connection up in order to run properly. These tests are written using LeanFT and it is a windows app so this is not mobile GUI testing. </p>

<p>Is there a certain way to configure this VM to set it up properly for automated GUI testing that does not require an active Remote Desktop Connection? It seems as if its sharing the controls on our physical machine.. </p>

<p>Or am I completely wrong here.. Is a Remote Machine different than a Virtual Machine? Thanks!</p>
",https://stackoverflow.com/questions/47421426/running-tests-on-vm-does-not-work-unless-window-is-open,"['automation', 'virtual-machine', 'remote-desktop', 'leanft']",1434,TRUE,2,2
Find new window dialogs automatically,"<p>Let's say that I open up some word file with a macro that opens up a dialog with some buttons.</p>

<p>Is there a way to find those buttons automatically and press them (when having only the PID)?<br>
Currently, I'm using pywinauto to automate the GUI testing. If there's a way to do it with pywinauto that would be great.</p>

<p>Thanks.</p>
",https://stackoverflow.com/questions/45140434/find-new-window-dialogs-automatically,"['python', 'windows', 'pywinauto', 'gui-testing']",2105,TRUE,3,1
JAVA GUI automation tool for eclipse RCP application,"<p>I need a better suggestion from u all. </p>

<p>I have an application where  eclipse RCP (JAVA) is used for the GUI.</p>

<p>Now i want to automate the GUI testing in java.</p>

<p>I have created a project where i have used </p>

<pre><code>""sikuli"" to create test for image comparison
 and 
""testng"" to run the test cases .
</code></pre>

<p>But i am facing problem  using sikuli because it needs to take a lots of pictures as there are lots of buttons, checkbox in the gui.</p>

<p>So, it would be better if i get a </p>

<pre><code>java tool which can perform ""recording"" to write test cases 
and i can also be able to integrate the ""sikuli api for image comparison"" and 
""testng"" to it.
</code></pre>

<p>Is there any such kind of java tool? 
I am looking for suggestion from you.</p>

<p>Thanks</p>
",https://stackoverflow.com/questions/47471944/java-gui-automation-tool-for-eclipse-rcp-application,"['java', 'eclipse', 'testng', 'ui-automation', 'gui-testing']",630,FALSE,1,0
Espresso access view id,"<p>we build an App where the most view's are created programmatically. Now I like to build some Espresso GUI test's. To find and access this view I like to set the view ID (view.setId( Unique Number)).</p>

<p>In my Espresso Test :
<code>
UiObject appViews = mDevice.findObject(new UiSelector().**resourceId**(id))
</code></p>

<p>I am only able to access Real Android Resource ID (not set with setId() ).</p>

<p>Is there a way to get find objects with programmatically view ID ?</p>

<p>the usage of the view setContentDescription is also not a solution, because this is used for Accessible :
<a href=""https://developer.android.com/guide/topics/ui/accessibility/apps.html"" rel=""nofollow noreferrer"">https://developer.android.com/guide/topics/ui/accessibility/apps.html</a> 
and not for GUI Testing !</p>

<p>Regards
Stephan</p>
",https://stackoverflow.com/questions/45956204/espresso-access-view-id,"['android', 'automated-tests']",658,FALSE,0,0
Run is slow between components in Test Lab,"<p>I'm using UFT/BPT for API and GUI Testing, everything works fine, I have business components which are in flows which are used in Business-Process, I run the Business-Process from Test Lab - ALM, here I have a problem with big times on runs.</p>
<p><strong>EX: Business-Process Test</strong></p>
<p><strong>Component 1:</strong></p>
<p>Start: 18:17:48</p>
<p>End: 18:17:48</p>
<p><strong>Component 2:</strong></p>
<p>Start: 18:18:00</p>
<p>End: 18:18:01</p>
<p><strong>Component 3:</strong></p>
<p>Start: 18:18:12</p>
<p>End: 18:18:13</p>
<p><strong>Component 4:</strong></p>
<p>Start: 18:18:24</p>
<p>End: 18:18:24</p>
<p><strong>Conclusion:</strong></p>
<p>After Component 1 it's ended and Component 2 it's started are 12 seconds between.</p>
<p><strong>Component 2 and Component 3:</strong> 11 seconds</p>
<p><strong>Component 3 and component 4:</strong> 11 seconds</p>
<p>Why it's stay so much between components?</p>
",https://stackoverflow.com/questions/42344426/run-is-slow-between-components-in-test-lab,"['hp-uft', 'alm']",194,FALSE,1,1
What is best Test Automation tool/approach for automating GTK GUIs on windows,"<p>I want to automate the GUI testing of our application.
(windows app with GTK GUI running on Linux back-end).
Problem is conventional tools are not useful for automating GTKs.</p>

<p>This application's GUI is developed in GTK and I launch that app on windows OS.
Application is developed in C++ mostly. It is connected to Linux server back-end.</p>

<p>As of now I am using AutoIt which but  but it is not 100% reliable I want better solution.
I am thinking about using  'dogtail (Python)' but do not know how to use it for 
windows apps with GTK GUI running on Linux back-end.</p>

<p>Any tool/Programming language solution for this problem will be appreciated.</p>

<p>I use QTP for windows apps and selenium for web apps mostly,
but both of them are useless for GTKs(Correct me if I am wrong).</p>
",https://stackoverflow.com/questions/45605632/what-is-best-test-automation-tool-approach-for-automating-gtk-guis-on-windows,"['python', 'gtk', 'automated-tests', 'ui-automation', 'gtk3']",1528,FALSE,3,0
How can I display GUI while testing PyQt5 app with pytest-qt?,"<p>I am new to <code>PyQt</code>, but I am going to use <code>pytest</code> with <code>pytest-qt</code> plugin to test my <code>PyQt5</code> application. I had some GUI testing experience in Java with <code>SWTBot</code> and <code>RCPTT</code>, where I could see what happens with controls and whole GUI during the test in real-time. I'd like to have such behavior with my new python tools, but it seems that <code>pytest-qt</code> tests GUI in some background way. All code works as I expect, but during testing I can't see the GUI. The code is simple as in tutorials:</p>

<pre><code>from tests.test import MyApp
from time import sleep
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *


def test_myapp(qtbot):
    app = QApplication([])
    window = MyApp()
    # window.show()
    # app.exec_()
    qtbot.addWidget(window)
    qtbot.mouseClick(window.buttonBox.buttons()[0], Qt.LeftButton)
    sleep(5)
    assert window.label.text() == 'accept'
</code></pre>

<p>If I uncomment the <code>window.show()</code> line (they do so in the <a href=""http://pytest-qt.readthedocs.io/en/latest/tutorial.html"" rel=""noreferrer"">tutorial</a>), I can see a strange window, that contains frozen background:</p>

<p><a href=""https://i.stack.imgur.com/wclqq.png"" rel=""noreferrer""><img src=""https://i.stack.imgur.com/wclqq.png"" alt=""strange window""></a></p>

<p>I suppose that it is theoretically possible to show the interface because I know that PyQt5 works from the python shell (<a href=""http://pyqt.sourceforge.net/Docs/PyQt5/python_shell.html#using-pyqt4-from-the-python-shell"" rel=""noreferrer"">more</a>):</p>

<blockquote>
  <p>you can, for example, create widgets from the Python shell prompt, interact with them, and still being able to enter other Python commands</p>
</blockquote>

<p>But I don't know how to achieve it with pytest-qt</p>
",https://stackoverflow.com/questions/47802375/how-can-i-display-gui-while-testing-pyqt5-app-with-pytest-qt,"['python', 'user-interface', 'pyqt5', 'pytest']",3279,TRUE,5,1
Programmatic Method of Handling Matlab Dialog Windows,"<p>I have a rather large Matlab program that is GUI based. I am looking into creating automated tests for it, as the current way of checking for bugs before a release is simply using all its functionality like a user would.</p>

<p>I would rather not use a GUI testing program that just records clicks and what not, so I was thinking of adding testing code that would call the button callbacks directly. The problem that I have run into with this is that we have a lot of <code>warndlg</code> and <code>msgbox</code> popups, and I would like my tester code to be able to see these.</p>

<p>Is there any way for Matlab code to tell if a function it called created a <code>warndlg</code> or <code>msgbox</code>? If so, is there any way to click 'ok' on these popups?</p>

<p>In a similar vein, is it possible to handle popups that block code execution (using <code>uiwait</code> or an <code>inputdlg</code>)?</p>

<p>If it matters I didn't use GUIDE, and all the GUI elements are created programmatically</p>
",https://stackoverflow.com/questions/46838251/programmatic-method-of-handling-matlab-dialog-windows,"['matlab', 'testing', 'matlab-gui']",93,TRUE,0,2
