Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. System Level Testing with Qt
QtWS25 Last Chance

System Level Testing with Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
test automationqjsengineqt test
14 Posts 3 Posters 1.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    itanitarek10
    wrote on last edited by
    #1

    Hello,

    I've been looking around for a built-in Qt framework that allows for system-level testing. I know Qt Test exists, but from what I've gathered that's more for unit tests and not system-level tests. I was told to look into QJSEngine (scripting capabilities), but that doesn't seem to have the ability or be used for testing applications with a GUI. Does Qt provide anything that can support that? I've seen third party software like Squish, but I'm looking for something made by Qt.

    Thank you

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What exactly to do you mean with "System Level Testing" ? Can you give an example ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • I Offline
        I Offline
        itanitarek10
        wrote on last edited by
        #3

        @SGaist said in System Level Testing with Qt:

        Hi,

        What exactly to do you mean with "System Level Testing" ? Can you give an example ?

        Certainly. If we have a GUI that is already made with various widgets, is there something that someone other than the developer can create to test the GUI without having to know the entire functionality of the GUI?

        For example, a basic GUI with a push button, line edit field, and LCD. Enter a value in the field, push the button, and have the output be displayed on the LCD. Is there some way we can automate tests on that GUI and collect data from it? But the tester shouldn't know anything about how the GUI operates (just how it looks).

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Your answer is a bit paradoxal... You want a tester to write tests while knowing nothing about your application.

          Squish is currently the right tool for that and has Qt integration.

          Can you explain how you envision the writing of these tests ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          I 1 Reply Last reply
          2
          • SGaistS SGaist

            Your answer is a bit paradoxal... You want a tester to write tests while knowing nothing about your application.

            Squish is currently the right tool for that and has Qt integration.

            Can you explain how you envision the writing of these tests ?

            I Offline
            I Offline
            itanitarek10
            wrote on last edited by itanitarek10
            #5

            @SGaist said in System Level Testing with Qt:

            Your answer is a bit paradoxal... You want a tester to write tests while knowing nothing about your application.

            Squish is currently the right tool for that and has Qt integration.

            Can you explain how you envision the writing of these tests ?

            We are researching more into Qt and I was given this as a task. I figured I'd ask the question since I couldn't find really anything other than Squish.

            Do you know what QJSEngine/QtScript are used for? I was initially instructed to research those first since they utilized JavaScript and we could possibly write scripts to test the GUIs, but my research bore no fruit.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              QtScript has been deprecated a long time ago so I would not start a new project with it.

              Since you wrote that the test writers shall know nothing about your application structure I do not see how a scripting engine like that would help you since you need to know what you want to manipulate.

              Another possibly could be to use Selenium. There's a webdriver for Qt. I can't comment on it as I have not used it.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              I 1 Reply Last reply
              2
              • SGaistS SGaist

                QtScript has been deprecated a long time ago so I would not start a new project with it.

                Since you wrote that the test writers shall know nothing about your application structure I do not see how a scripting engine like that would help you since you need to know what you want to manipulate.

                Another possibly could be to use Selenium. There's a webdriver for Qt. I can't comment on it as I have not used it.

                I Offline
                I Offline
                itanitarek10
                wrote on last edited by
                #7

                @SGaist said in System Level Testing with Qt:

                QtScript has been deprecated a long time ago so I would not start a new project with it.

                Since you wrote that the test writers shall know nothing about your application structure I do not see how a scripting engine like that would help you since you need to know what you want to manipulate.

                Another possibly could be to use Selenium. There's a webdriver for Qt. I can't comment on it as I have not used it.

                Thanks for the suggestions and info, I really appreciate it. Could you clarify/give more info on what applications I would use QJSEngine for? I'm still struggling a bit to understand it's purpose.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Add scripting support in your application for example.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  I 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Add scripting support in your application for example.

                    I Offline
                    I Offline
                    itanitarek10
                    wrote on last edited by itanitarek10
                    #9

                    @SGaist said in System Level Testing with Qt:

                    Add scripting support in your application for example.

                    So then couldn't I write a script in JS that would test my GUI? Like I'm not sure what capabilities I have once I add scripting support.

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      You are losing me a bit.

                      You want to write test but at the same time, not know the details of the application so it's getting hairy...

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • D Offline
                        D Offline
                        DennisR
                        wrote on last edited by
                        #11

                        Hi, I'm in a similar situation. I am a Selenium test automation engineer, and I've been given the task of using Selenium to launch a browser and test a GUI built with QT.

                        I'm new to the project that I'm on, and, the GUI is being built by a sub-contractor. So, other than knowing it's being built in / with QT, I don't know anything about it. I'm trying to determine if Selenium is even an option.

                        Is it true that QT GUIs do not have HTML elements? Normally I would do something like this (simplified to illustrate a point):

                        String labelText = myWebDriver.findElement(By.xPath("/html/body/label_1")).getText();

                        Selenium is built to test web sites with HTML, CSS, etc. QtWebDriver is the only utility that seems to exist to enable Selenium to interact with QT based GUIs.

                        Is there something that I'm missing?

                        Thanks in advance,
                        Dennis

                        SGaistS D 2 Replies Last reply
                        0
                        • D DennisR

                          Hi, I'm in a similar situation. I am a Selenium test automation engineer, and I've been given the task of using Selenium to launch a browser and test a GUI built with QT.

                          I'm new to the project that I'm on, and, the GUI is being built by a sub-contractor. So, other than knowing it's being built in / with QT, I don't know anything about it. I'm trying to determine if Selenium is even an option.

                          Is it true that QT GUIs do not have HTML elements? Normally I would do something like this (simplified to illustrate a point):

                          String labelText = myWebDriver.findElement(By.xPath("/html/body/label_1")).getText();

                          Selenium is built to test web sites with HTML, CSS, etc. QtWebDriver is the only utility that seems to exist to enable Selenium to interact with QT based GUIs.

                          Is there something that I'm missing?

                          Thanks in advance,
                          Dennis

                          SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          @DennisR Hi and welcome to devnet,

                          Qt is not a web based framework although you can now make use of its WASM implementation to load an application through a browser.

                          In any case, even if it's a subcontractor that implements the UI, its design and screens should be documented somewhere to get you a starting point for your scenarios.

                          That contractor can also provide you with regular builds that will give you the opportunity to make your testing.

                          In the absolute, you should be able to build the application and run the tests completely yourself.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          1
                          • D DennisR

                            Hi, I'm in a similar situation. I am a Selenium test automation engineer, and I've been given the task of using Selenium to launch a browser and test a GUI built with QT.

                            I'm new to the project that I'm on, and, the GUI is being built by a sub-contractor. So, other than knowing it's being built in / with QT, I don't know anything about it. I'm trying to determine if Selenium is even an option.

                            Is it true that QT GUIs do not have HTML elements? Normally I would do something like this (simplified to illustrate a point):

                            String labelText = myWebDriver.findElement(By.xPath("/html/body/label_1")).getText();

                            Selenium is built to test web sites with HTML, CSS, etc. QtWebDriver is the only utility that seems to exist to enable Selenium to interact with QT based GUIs.

                            Is there something that I'm missing?

                            Thanks in advance,
                            Dennis

                            D Offline
                            D Offline
                            DennisR
                            wrote on last edited by
                            #13

                            @SGaist Thanks! Glad to be here.

                            What you say is true, and my understanding is that our users will go through a browser to access the Qt App.

                            My level of test automation starts at the user experience - if you're familiar with Cucumber for Behavior Driven Development and Selenium for automation, then you'll understand where I'm at.

                            I do not expect to have to (or need to) build the app. The Dev team will deliver nightly builds and my job is to test the way that the users will use the system. From a "testing pyramid" perspective, it's closer to User Acceptance / User Functional testing.

                            I am very much NOT a developer :)

                            My understanding of QtWebDriver was that it would run in the background, listen on a specified port, and then Selenium could use that port to interact with the Qt GUI (such as click a button, or type data into a field).

                            Maybe you can tell me, in the world of Qt, how is User Functional testing performed, and automated?

                            Best Regards,
                            Dennis

                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              That's just a wild guess but you might be able to use Selenium as usual if your application is built for WASM.

                              Otherwise, AFAIK, the reference tool is Squish.

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              1

                              • Login

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • Users
                              • Groups
                              • Search
                              • Get Qt Extensions
                              • Unsolved