Quantcast
Channel: froglogic blog » Squishfroglogic blog
Viewing all 87 articles
Browse latest View live

Squish tip of the week: Clipboard Access

$
0
0

With the clipboard function in Squish Version 6.1 there will be an option to write text to the system clipboard and to get text from the system clipboard back into your automated test suite.

This feature will work on all platforms & languages and will help users solving issues getting access to the system clipboard. Furthermore it enhances the functionality of BDD in a time- and script efficient approach.

Snippet

Writing text to the system clipboard:
setClipboardText()
Getting text from the system clipboard:
getClipboardText()

Example 1:

In the following Address book example we assume that we have two (or more) entries with the same surname but different forenames. With the clipboard feature we can use the given surname across the whole test case without changing every entry in the code.

Furthermore if the surname is changing during the test we can set the new name into the clipboard with setClipboardText and get it back with getClipboardText in a efficient way.

def main():
    startApplication("Addressbook")
    mouseClick(waitForObjectItem(":Address Book - Unnamed_Menubar", "File"))
    mouseClick(waitForObjectItem(":File_MenuItem", "New"))
    mouseClick(waitForObject(":New_ToolbarItem"))
    mouseClick(waitForObject(":Add_ToolbarItem"))
    type(waitForObject(":Address Book - Add.Forename:_Edit"), "Peter")
    type(waitForObject(":Address Book - Add.Surname:_Edit"), "Mueller")
    type(waitForObject(":Address Book - Add.Email:_Edit"), "pm@gmail.com")
    type(waitForObject(":Address Book - Add.Phone:_Edit"), "007")
    clickButton(waitForObject(":Address Book - Add.OK_Button"))
    setClipboardText(waitForObject(":1_2_TableCell").text)
    mouseClick(waitForObject(":Add_ToolbarItem"))
    type(waitForObject(":Address Book - Add.Forename:_Edit"), "Dirk")
    type(waitForObject(":Address Book - Add.Surname:_Edit"), getClipboardText())
    type(waitForObject(":Address Book - Add.Email:_Edit"), "dm@gmail.com")
    type(waitForObject(":Address Book - Add.Phone:_Edit"), "006")
    clickButton(waitForObject(":Address Book - Add.OK_Button"))
    mouseClick(waitForObjectItem(":Address Book - Unnamed_Menubar", "File"))
    mouseClick(waitForObjectItem(":File_MenuItem", "Quit"))
    clickButton(waitForObject(":Address Book.No_Button"))

Example 2:

Another useful implementation is to verify values written by the AUT to the clipboard.

def main():
    startApplication("squishide")
    mouseClick(waitForObjectItem(":Window", "Run"))
    mouseClick(waitForObjectItem(":Menu", "Launch AUT"))
    mouseClick(waitForObjectItem(":Tree", "Address_Book___Unnamed_Window_0"), MouseButton.SecondaryButton)
    mouseClick(waitForObjectItem(":ContextMenu", "Copy Real Name"))
    mouseClick(waitForObjectItem(":MenuBar", "Run"))
    mouseClick(waitForObjectItem(":Menu", "Quit AUT"))
    test.compare(getClipboardText(), "{text='Address Book - Unnamed' type='Window'}");
    test.log(getClipboardText())

Example test results after running the test case (click image to enlarge)


How would you use the clipboard function? Please let us know in the comments bellow.

Related topics

Exhibition & Conference: froglogic at Embedded World 2016

$
0
0

froglogic will be present again after last year’s huge success at the Embedded World Conference in Nuremberg, this time from February 23th – 25th, 2016.

You will find us at Hall 4 / 4-306 next to Qt showing live demos of testing BDD and embedded HMIs with the Squish GUI Tester.

Floor plan:
Froglogic at Embedded World 2016 - Hall 4 / 4-306

If you would like to schedule a meeting at the Embedded World Conference 2016 with a representative of Froglogic, please contact us.

To meet us at the Exhibition & Conference you can register for a free day ticket with the code ew16web. For more information and to redeem the voucher, see Embedded World – Redeem a Voucher.

Related topics

Squish tip of the week: Error debugging with StackTrace

$
0
0

A StackTrace is a very helpful debugging tool. It shows you the call stack (meaning, the stack of functions that were called up to that point) at the time an uncaught exception was thrown or the time the stacktrace was generated manually. This is very useful because it doesn’t only show you where the error happened, but also how the program ended up in that place of the code.

In other words, a stack trace allows tracking the sequence of nested functions called up to the point where the stack trace is generated. In a post-mortem scenario this extends up to the function where the failure occurred but was not necessarily caused.

Snippet

Error debugging with StackTrace
test.stackTrace()

The function test.stackTrace() returns a list of stack frames representing active function calls.

Example:

Error debugging with StackTrace

The first element (0) in the list contains information about the location of the test.stackTrace call itself. The second element (1) contains information about it’s caller and so on. The last element (2) in the list is usually the main function call.

Each stack frame value in the returned list features following fields:
fileName: The name of the source file in which the function call was done.
line: The line number in the script file in which the function call was done.

Advanced

startFrameIndex and maxFrameCount
test.stackTrace (startFrameIndex, maxFrameCount)

When the startFrameIndex parameter (number) is set, the given number of most recent frames will be skipped. This is especially useful for retrieving stack traces from framework functions in which case, the stack trace should possibly not include the code internal to the framework itself. If the parameter is not given the defaults is zero or in other words, no frames are skipped.

If both startFrameIndex and maxFrameCount are set, the stack trace will also be be limited to maxFrameCount frames. It will not be computed all the way back to the initial call to the main function which can improve performance for deeply nested script frameworks.

How are you using StackTrace? Please let us know in the comments bellow.

Squish tip of the week: How to group test results into sections

$
0
0

Sometimes it can be useful to group comparison results or error logs into specific sections. This simplifies the handling of the evaluation and gives an illustrated insight into the data.

Squish will thereby show results nested and if wanted over several levels. If test run from command-line the log messages are added to the test when a section begins or ends – unless the XML3 report generator is used.

Please note that test.startSection should always be closed with test.endSection to prevent erroneous test reports.

Snippet

Grouping test results into logical units
test.startSection(title);

or

test.startSection(title, description);

and

test.endSection();

Example:

def main():
    startApplication("Addressbook")
    clickButton(waitForObject(":New_Button"))
    clickButton(waitForObject(":Add_Button"))
    test.startSection("Form , Surname & Name")
    type(waitForObject(":_Edit"), "Peter")
    test.log("Peter")
    type(waitForObject(":_Edit_2"), "Lustig")
    test.log("Lustig")
    test.endSection() 
    test.startSection("Form , E-Mail & Telefon")
    type(waitForObject(":_Edit_3"), "peter@lustig.de")
    test.log("peter@lustig.de")
    type(waitForObject(":_Edit_4"), "123")  
    test.log("123")
    test.endSection() 
    clickButton(waitForObject(":Address Book - Add.OK_Button"))
    mouseClick(waitForObject(":File_MenuItem_2"))
    mouseClick(waitForObject(":_Menu"), 91, 110, MouseButton.PrimaryButton)
    mouseClick(waitForObject(":Address Book.No_Button"), 49, 5, MouseButton.PrimaryButton)

Example test results after running the test case

click to enlarge - Test results with test.startSection and test.endSection

Are you using this function in Squish? Please let us know in the comments below.

Related topics

Squish Success at Global Graphics

$
0
0

Global Graphics Homepage

We are proud to publish another success story from Global Graphics a digital printing and document technology company which is using Squish for GUI testing.

Froglogic Squish is a cross-platform UI automation testing tool that has made our lives so much easier when it comes to being ‘agile’” says Ben Gilbert, software developer at Global Graphics.

Read the full review:


PDF

Related topics

Squish tip of the week: How to override the location associated with test results

$
0
0

Ever wondered how to override the location associated with test results?

A function which (temporarily) enforces that test results created by Squish functions, for example test.compare, will have their report entry rewritten such that the location of the result entry is no longer the place where text.compare was called but rather any of the ancestors frames of the current function.

This can be very useful to solve problems with code duplications or where comparisons and verifications are consolidated into separate functions.

Snippet

test.fixateResultContext()

AND

test.restoreResultContext()

The test.fixateResultContext function adjusts the call stack frame which is used when generating test result entries. By default, it will rewrite the location of all result entries such that they seem to stem from the parent stack frame.

Example

Triggered by the call to test.compare the following test result entry will be logged with a location pointing into the main() function, not into the windowcheck() function:

def windowcheck():
    test.fixateResultContext(1)
    waitFor("object.exists(':Address Book - Unnamed_Window')", 20000)
    test.compare(findObject(":Address Book - Unnamed_Window")["class"], "Addressbook.MainWindow")
    test.restoreResultContext()

def main():
    startApplication("Addressbook")
    windowcheck()
    mouseClick(waitForObject(":New_ToolbarItem"))
    windowcheck()
    mouseClick(waitForObject(":Add_ToolbarItem"))
    type(waitForObject(":Address Book - Add.Forename:_Edit"), "Peter")
    type(waitForObject(":Address Book - Add.Surname:_Edit"), "Lustig")
    type(waitForObject(":Address Book - Add.Email:_Edit"), "123")
    type(waitForObject(":Address Book - Add.Phone:_Edit"), "peter@lustig.de")
    windowcheck()
    clickButton(waitForObject(":Address Book - Add.OK_Button"))
    windowcheck()    
    mouseClick(waitForObject(":Remove_ToolbarItem"))
    clickButton(waitForObject(":Address Book - Delete.Yes_Button"))
    windowcheck()

Note how the test.compare function is wrapped in a test.fixateResultContext(1) and test.restoreResultContext() pair. It means that the results generated by test.compare are reported at the location where windowcheck() is called in main().

Example test result (click image to enlarge):

How to override the location associated with test results with test.fixateResultContext and restoreResultContext

Advanced

test.fixateResultContext(ancestorFrameIndex)

By passing an optional argument (ancestorFrameIndex) “1″ you can pass other values to reference other ancestor stack frames, e.g. “2″ would reference the grand-parent stack framer (the caller of the caller).

Note

To avoid misleading test reports always call test.restoreResultContext after calling test.fixateResultContext!

As calls can also be nested, i.e. multiple subsequent calls to fixateResultContext it is required that restoreResultContext gets called multiple times as well.

Are you already using this function in Squish? Please let us know in the comments below.

Related topics

Release of Squish 6.0.2

$
0
0
Squish Release 6.0.2

As announced today on froglogic, we are excited to release Squish 6.0.2.

This version includes various fixes for issues found in last Squish 6.0.1 release. The IDE, the script bindings, result reporting as well as the UI toolkit support have been improved in all of the editions. See the release notes for a complete list.

Customers and product evaluators will find the updated set of packages in their download area.

We hope you take advantage of the new features and as always look forward to your feedback.

Squish tip of the week: Ensuring that functions are always called pairwise

$
0
0

Some functions in Squish need to be called in pairs to work correctly. For example fixateResultContext and restoreResultContext should go always together just like startsection and endSection. This is crucial in order to prevent any malfunctioning script behavior and misleading test results.

In order to ensure this will never happen even when script exceptions are raised or the control flow bypasses one of the statements, it is advisable to wrap the calls to the function pairs into helper functions which ensure that they always go together.

Here is one Javascript examples for how to ensure that fixateResultContext and restoreResultContext always go together. The same can be applied to startSection and endSection:

function withSection(f)
{
    test.fixateResultContext(1);
    try {
        return f();
    } finally {
    test.restoreResultContext();
    }
}

function main()
{
    withSection(function() {
        test.compare("Apples", "Apples");
    });
    
    withSection(function() {
        test.compare("Oranges", "Apples");
    });    
}

Animated result example (click image to enlarge):
Ensuring that functions are always called pairwise

Any thoughts on this topic? Please let us know in the comments below.

Related topics

Squish tip of the week: 10 reasons why using a version control system is awesome!

$
0
0

Why is it important to use a version control system also known as source control or revision control?

Please ask yourself:

1. Have you ever had to maintain multiple versions of a product?
2. Have you ever lost code or had a backup that was too old?
3. Have you ever made a change to code and realized, it was a mistake and wanted to revert back?
4. Have you ever wanted to experiment with a new feature without interfering with working code?
5. Have you ever wanted to see the difference between two, or more, versions of your code?
6. Have you ever wanted to see how much work is being done, where, when and by whom?
7. Have you ever wanted to prove that a particular change broke or fixed a piece of code?
8. Have you ever wanted to share your code or let other people work on your code?
9. Have you ever wanted to submit a change to someone else’s code?
10. Have you ever wanted to review the history of some code?


In these cases and if you have a group developing the same code, version control is necessary so people can edit the same file at the same time – which makes your life easier in every aspect.

And even if you work alone, you can benefit from source control as you will have:

  • A history of all your changes.
  • The ability to go back and forward in your code.
  • The ability to experiment with the source code while still having a working version.
  • A backup copy, especially if you use a different machine as source control server and even if that machine is regularly backed up.
  • No need to comment out code as you can recover it any time.

Which Squish files should be version controlled

It is highly recommended using a version control system for the Squish test suite folders and the files contained in them.

Squish test suites consist of files for data files, shared data files, test scripts, shared scripts, verification point files and the object map file.

Recommended Version Control Software

We at froglogic use version control as well. Our software of choice is GIT, a open source version control system. It can handle everything from small to very large projects with efficiency and speed.

Git Home

You can get Git here and there are even a few GUI Clients for a more platform-specific experience.

What version control system are you using right now? Please let us know in the comments below.

Squish tip of the week: Browser Support in Squish for Web

$
0
0

Did you know that Squish for Web supports all standard web browsers like Firefox, Safari, Google Chrome, Opera and even Internet Explorer?

Browser Support in Squish for Web

This has not always been the case as we had some pain with browser compatibility in the past. However, times have changed and froglogic got ahead with the technology used in Squish. Now we are proud to support cross-platform browser compatibility for your benefit and convenience.

Want to stay up to date? Have a look at our regularly updated Knowledge Base article for Supported Web Browsers.

Which browser are you using in Squish for Web? Please tell us in the comments below.
Related topics

Squish tip of the week: Screenshot Verification Point

$
0
0

The most commonly used verifications in Squish are object property verifications – comparing the object properties values with an expected value. Those verification points can easily be inserted into a test script using the Squish IDE’s point & click interface. This method is sufficient and for most scenarios best practise.

Nevertheless, sometimes it can be useful to have an additional screenshot verification point in place to be able to compare visually how an image (or logo) appears with an expected outcome or image.

How to add a Screenshot Verification Point

We need to provide Squish with an image/screenshot that shows the “original” image which will later be used for the comparison.

This can either be done by inserting a screenshot verification point during recording or by adding a breakpoint and using the picker tool.

Adding a screenshot verification point during recording

Click image to see animation

Drawbacks and Solutions with Screenshot Verification

As screenshot verifications work by comparing pixels, this can sometimes lead to incorrect verifications. For example, if tests are run on a machine that is different from the one on which the original screenshot was taken or when used on different operating systems and different screen resolutions.

Even if tests are run on the same machine, there can sometimes be changes in settings, fonts or themes and the screenshot will differ from its original version. However, if we are careful about these issues, there are circumstances where screenshot verifications make sense and with the advanced settings capability in Squish there are ways to avoid these discrepancies.

For more information, please see the Screenshot Verification Point dialog section in our documentation.

In which cases are you using screenshot verification points?

Related topics

Exhibition & Conference: froglogic at BIOMEDevice 2016 Boston

$
0
0

froglogic is attending BIOMEDevice 2016 in Boston, Massachusetts April 13th & 14th.

Come find us at Booth 120 showing live demos, testing BDD and embedded HMIs using Squish GUI Tester!

Floor plan

froglogic at BIOMEDevice Boston 2016 - Booth 120 (click to zoom)

If you would like to schedule a meeting at BIOMEDevice 2016 with a representative of froglogic, please contact us.

To meet us at the Exhibition & Conference you can register for free Expo Hall Admission using source code invite, or email us your mailing address for a mailed copy. For more information and to register, see BIOMEDevice 2016.

Squish tip of the week: 3 Steps to Mask a Screenshot Verification Point

$
0
0

Did you know that you can set masks on screenshot verification points?

With the masks functionality provided in Squish it is possible to apply positive and negative masks on screenshot verification points to ignore or focus on specific areas of an image comparison which allows us to make screenshot verifications more reliable and robust.

How to use masks on screenshot verification points in 3 steps

The screenshot verification point editor allows us to insert, modify and remove positive and negative masks.


1. In the IDE view “Test Suites” under “Test Case Resources” click on the tab “VPs” and double-click at a previously made screenshot verification point.

Squish Verification Point List


2. In the opened tab click on the most right toolbar icon which looks like a display. (Mouseover: Edit Verification Point)

Edit Verification Point


3. In the next dialog window click on the second icon from the top on the right (Mouseover: Add Positive Mask) then click and drag the mouse over the area of the screenshot that you want to have verified. Click on “Save” and you are all set.

Add Positive Mask

Click image to enlarge


Do you use positive or negative masks on verification points?

Related topics

Squish tip of the week: How to use the Squish Documentation

$
0
0

Are you feeling lost or overwhelmed by the many different functionalities in Squish?

We from froglogic know there are lots of features in Squish, and sometimes you can easily get lost in all the functions and extensions which Squish supports. Nevertheless, we are working hard to make sure that our customers always get what they need or look for and that is why we have an extensive Online Documentation with Search capability.

The easiest way to use the Squish Documentation or Manual is by navigating into the different topics using the Table of Contents on the left of the main Squish Documentation page. There is also an A-Z Index which lists all terms and functions and if you already know what you are looking for there is a great search function in place.

Search box and functionality

When you open the latest Squish Manual there is a Search tab next to the table of content.

Squish Documentation Search Tab

Click at the Search Tab and enter your desired search term. Now all or parts of the word/term that you entered will appear including functions and a list of relevant links.

For example, if you enter the search term “exists” the search result will show three functions: object.exists and testData.exists plus two specific functions waitForContextExists for Web and File.exists for Javascript.

Squish Manual Search Result for Exists

Also, you can enter a module or class name such as “squish.” or “test.” and you will get results of that particular module or class function.

Manual Search Results for Squish. and Test.

Note that for this to work you must end the search term with a period.

To get you started here are some more functions:
applicationcontext.
objectmap.
object.
squishinfo.
squish.
testdata.
test.
testsettings.

Not enough or more specific?

JavaScript
file.
os.
xml.
xmlnode.
sql.
sqlconnection.
sqlresult.

Java™
javaarray.

Web
browser.
html_

Please tell us, how useful do you find our Squish Documentation? We appreciate every feedback and value your opinion.

Related topics

Exhibition & Conference: froglogic at QtDay 2016 in Florence

$
0
0

froglogic will be present again at the QtDay 2016 in Florence, this time from April 29th – 30th 2016.

Schedule

April 29th – Training session with a froglogic representative at QtLab
April 30th – At our booth (right in front of the conference facilities) we are showing live demos, testing BDD and embedded HMIs using Squish GUI Tester!

If you would like to schedule a meeting at QtDay 2016 with a representative of froglogic, please contact us.

More information about QTDay 2016 in Italy.

Last years talk about Qt GUI Testing with Squish

QTDay GUI Testing with Squish

Related topics

Squish tip of the week: The Complete Beginner’s Guide to Support

$
0
0

The Complete Beginner’s Guide to Support
Even with an exceptional GUI regression testing software like Squish there is sometimes need for support.

Support is defined by an after-sales service provided by a software publisher or vendor in solving software conflicts and usability problems and in supplying updates and patches for bugs and security holes in the program.

Many questions and requests reach us every day. The following information will help you to use our support efficiently and to ensure that you receive the best possible response times and quality from our support.

Squish Support Cheat Sheet

Please send one email for each (separate/unrelated) question to

squish@froglogic.com

Subject short description of the issue.
Body description of how to reproduce the issue and
some more specific information which can be found in logs.

Note: What you need to know about Squish Email Support.

We look forward to hearing from you! We will make every effort to process and respond to your request as quickly as possible.


Related topics

Squish tip of the week: How to describe your automated tests

$
0
0

While working on automating test cases, it is important to describe them well. After some time, the number of automated test cases can be enormous. Giving your test suites and test cases self-explaining and meaningful names can help in the future when you try to find a particular test case among hundreds you already automated.

How to provide an additional description of a test case?

Your test cases are scripted programs written in one of scripting languages supported by Squish (Python, JavaScript, Perl, Ruby, Tcl). Therefore, at the beginning of each test case you can always have a comment section with a description. Unfortunately, this description will not be included in test case execution results.

The best solution is to use description functionality provided by Squish IDE.

1. In the IDE View with Test Results click “Test Description” tab

2. Click “Edit Test Description” icon

Edit  Test Description

3. Provide a short Summary and Description for test suite and test cases. Save the changes.

Provide Summary and Description

Where to find the summary and description after implementation?

1. In the IDE View with Test Results in “Test Description” tab

2. In the IDE View with test cases hovering over test case name will display a popup with test case summary

Summary popup

3. In the Web Report with execution results. To display the popup with both summary and description hover over test case name or test suite name.

Web Report

Related topics

Squish tip of the week: 32-bit or 64-bit: Picking the Right Squish Binary Package

$
0
0

32bit vs 64bit squish package

Sometimes we get asked what is the right Squish binary package to download?

To answer this question, we first need to find out what 32-bit and 64-bit is.

The terms 32-bit and 64-bit (the number of bits is called the word size*) refers to the information processing of the processor of a computer processor, also known as Central Processing Unit or CPU. The type of processor a computer has affects not only its overall performance but can also dictate what kind of software it uses.

32-bit versus 64-bit

As the number of bits increases, there are significant benefits. More bits means that data will be processed in larger chunks which also means more accurately as the system can point to or address a greater number of locations in physical memory. Software programs that require many calculations to function smoothly can operate faster and more efficiently.

Squish binary packages can be downloaded for both 32-bit and 64-bit computers. To get the right Squish package the word size* must match for which your application was compiled.

How to determine if you have a 64-bit or 32-bit AUT (Application Under Test)

Windows
Mac
Linux
Java

Windows

win10_taskmanager

1. Open the Windows Task Manager with right click on the Windows Logo > Task Manager OR Ctrl+Alt+Del > Task Manager
2. If necessary click “Mored details”.
3. Locate the desired process/application and check if the process name has a postfix of “(32 bit)” or “(64 bit)”.

Two other options are using the Process Explorer or Dependency Walker Tool to check if a binary is 32- or 64-bit.

Mac

MAC Activitymonitor

1. Press Command+Spacebar to bring up the Spotlight search field
2. Type in “Activity Monitor”
3. Press the Return key when “Activity Monitor” populates in the results
4. In the Activity Monitor locate the desired process/application and check the “Kind” column for denoting a 32-bit or 64-bit process

Linux (Unix-like Systems)

1. Command: $ file squish
2. Output: squish: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, not stripped)

Java

Check if the Java Runtime Environment that executes your application is 32- or 64-bit and use the matching Squish for Java package.

 

*word size
Commonly the word size refers to the size of a processor register. On a 32-bit processor this will be 32 bits and on a 64-bit processor, this will be 64 bits.

The bit size of the processor is somewhat independent of the bit size of the OS. For example, you can run 32-bit Windows on a 64-bit processor. Your word size will still be 64 bits, but programs will not be able to address the entire processor word.

Find out more about word size at Wikipedia.

Related topics

Squish tip of the week: How to automatically update screenshot verification points

$
0
0
Did you know that Squish supports an easy way to deal with screenshot verification points when there are significant changes in the appearance of applications?

As it is quite common that GUI’s of applications change with new releases, features and enhancements, it would be a real pain to retake all screenshots manually.

The solution to this problem is to automatically update all screenshot verification points with one single command:

SQUISH_LEARN_SCREENSHOTS=1

Setting this variable will force Squish to update all the screenshots used in screenshot verification points.

How to automatically update screenshot verification points

Example for Windows: After pressing Win+R and executing “cmd” the command prompt will open, type:

set SQUISH_LEARN_SCREENSHOTS=1 *enter*
“C:\Program Files (x86)\froglogic\squish-6.0.3-windows\squishide.exe” *enter*

Now execute all the tests with screenshot verification points – Squish will retake all the screenshots in the test scripts.

Once it is done, quit Squish and start it again without the set variable above. Squish will now compare screenshot verification points with updated screenshots.

Related topics

Squish Day Munich: Learn from froglogic’s experts about Squish!

Viewing all 87 articles
Browse latest View live