Hello and welcome back to a second chapter of the QF-Test Java Tutorial.
In the first chapter we have worked with a sample test suite and
in this second chapter, we will start creating our own test-suite from scratch.
What are the steps we will see?
The first is we will learn how to start the application, what is necessary for that?
Then we will do recording actions, we will do recording of checks.
We will organize our test-suite and
then we'll learn how to create a stop sequence for the demo.
And at last we will run the whole test-suite.
Okay here I've already created a new test-suite which can be done simply by this toolbar button top left.
Now we want to go through the steps necessary for creating a setup sequence for your application,
which can be done by the Quickstart Wizard.
That is available via the "Extras" menu.
After it has come up and has welcomed us and shows a little bit of explanation,
we can directly press the "Next" button to be able to select the kind of application that needs to get tested.
There's the option for Java application, for web applications in a browser,
which is explained in another tutorial,
and there is also the option to test PDF documents, but we will stay with a Java application.
In the next step then there is an information needed in which way the application is to be started.
The typical way is that you will have an Excel file or a command file something like that.
But there are also options for Java Web Start, for Java applets in a browser or to launch a Java archive or a Java class.
We will stay again with the first option and press "Next".
Then we will have to provide the actual file to be launched and
I have already put that here in the clipboard.
So, to have that available fast and it's the CarConfig command script,
which is located inside our QF-Test distribution inside the demo
and CarConfig directory here so I will select that and open it.
And yeah, then we can already press the "Finish" button.
There would be additional options to set in the following steps, but in our example everything is fine.
And so the "Finish" button is perfect here.
Here we will see a short summary of all the data, we have provided.
So press "Finish" again and now our setup sequence has been created.
We already know that kind of sequence from the first chapter and
see that the data we have provided within the Quickstart Wizard is now inserted in the respective nodes to have the sequence.
Ok, we can launch the setup sequence by simply pressing the "Run" button and
after a few seconds the CarConfigurator demo shows up.
And here as last step in this section let's save the test-suite which as is a new one.
And for this I can press the "Save" button and here provide a respective directory.
I have created here a directory within the personal documents folder.
Simply call it QF-Test Java Tutorial and inside this I can save my suite.
For instance let's call it MyFirstTests.
Okie-dokie, so this was the first part here.
Let's go on by recording some actions on the CarConfigurator for this we can press the "Record" button here.
And then let's record a small sequence. For instance select the "I5" model, change to the "Specials" tab,
select the "Jazz" specials model and go back to the "Vehicles" tab.
Then to stop the recording, I press the stop "Button" here and get a new sequence
within the "Extras" which is our kind of playground for us.
This sequence has just a time stamp as default name
Within this sequence we see the respective mouse clicks we have just performed and
Let's provide a better name here for instance let's call the sequence "Select Model I5 Jazz"
And as a final step we can try to execute this recorded sequence.
As we can see it performs quite well. No error occurred.
Okay, the next step would be to also have verification points as
within testing of course, you don't just want to control actions,
But you also want to verify that the effects and the results within your application are correct.
And for this there's another mode to record checks as well.
When having activated this and then switching to your application window, you can see that components are highlighted.
The component below the cursor and that is the one,
which is the one you can record a check for.
Let's do that for the price value here.
When pressing the right mouse button, you can see that there is the number of checks shown,
which are typically the relevant checks for that kind of component
And for a text label like that you can have a text check.
You can check, whether the component is visible, whether it is enabled or editable, whether it is focus
Image checks are possible. You can record the geometry or tooltip, if it's available.
But let's go for the text check here and again press "Stop".
And we have another sequence recorded and it contains a check text node to the calculated price field
and you can see that the value that is used for the check is the one from the application.
You see a double dollar symbol here that is just a special syntax, because the dollar is also used for variable syntax, just as a side note here.
So also let's execute the check. It also works. Of course, we have not changed anything and
so let's also have a better name for that sequence.
And let's call it "Check final price".
Ok, perfect so far.
Possibly, let's save the suite.
Okay, so far we have just worked within the "Extras" which means in a kind of sandbox.
But for having a real test-suite, we need to restructure our recordings and organize that in another way.
To have real tests and real test cases, there are these nodes here.
Test sets which means there are groups of similar tests or tests, which belong to the same part can be put in here.
There are also test cases.
There are other nodes in the test-suite, there's a space for procedures, for reusable parts,
the extras, we have already explained and there's also one node for windows and components and
there is information stored by QF-Test, which represents the components of your application.
So to prepare our tests and our test set. Let's give it a better name here for instance.
Let's call our test set "Demo tests".
When changing this name we are asked whether we want to possibly update respective references that used already the test set.
We have no references so far and so I can say simply "No" here.
Then what I can do to reorganize, I can put the set up node up here to have it as a set up for our test case.
Also our test case we can give it a better name, let's call it simply "First" and
Okay, the dialog comes again. Still no references here.
Then we have our two sequences and before moving them up, I would like to transform those nodes into real test steps.
So far there are just sequences but I would say these are real test steps.
This can be done by this transform node action from the context menu.
It's also helpful that these test steps later on will appear in our report. So the reports will get better and have more information.
So but now let's move these two steps up here in this test case
and so now we have a real test case "First".
Now to finalize our first test suite we need a clean up sequence to stop the demo at the end
This can either be done as it has been done in the first chapter
to use some kind of processing node to terminate the CarConfigurator process.
But we can also create another simple clean up sequence simply
by recording the normal exit procedure via "File" → "Exit".
Of course the CarConfigurator disappears and what you can also see that the record button gets deactivated,
because the CarConfigurator is already gone.
But you can still press the "Stop" button and get a respective sequence recorded file exit here.
Let's call it "Stop demo".
We can also transform this node into a real clean up sequence node
After that, just move it upwards and by that we have our full test-suite done.
Let's save it and
also, we can execute it and see whether it now runs well.
And as expected everything works fine. Finished, no errors. Okay, that's it.
By this we've finished the second chapter here.
And now please feel free to take your time, get used to the recording functionality.
Try a little bit, play a little bit around with checks, with records and...
Yeah, have fun and we will be back with the third chapter and then we will see how to write a procedure.
Bye, have a good time.
No comments:
Post a Comment