Quantcast
Channel: froglogic
Viewing all 398 articles
Browse latest View live

New Video Tutorial: Inspecting Object Properties and the Pick Tool

$
0
0


Learn the various ways to use Squish’s Pick tool to spy objects and their properties in a less than 5 minute video tutorial!



Click here to view more videos in froglogic’s Video Library

More video tutorials added today!

$
0
0

Don’t want miss any new video tutorials?

Subscribe to our YouTube channel:

Video Tutorial Playlist



Webinar Playlist

Squish tip of the week: Picking additional properties for that ‘Hard to Find’ object

$
0
0

When dealing with a non-standard, dynamic or hard to find object, additional or alternate object properties may be required to properly identify the object.

Topics discussed:

  • Using the Pick tool
  • Adding new object properties to an Object Map entry
  • Validating the updated Object Map entry

NOTE

If you haven’t worked with the Pick tool before, I recommend scanning (at minimum) the following documents before proceeding:

Using the Pick tool

  1. Launch your AUT, and navigate to the object of interest
    • Click the Launch AUT button, and manually navigate to the object of interest OR
    • Set a break point just prior to the object of interest, and run your script to the break point
  2. Click the Pick tool, and select the object of interest in your application.

    click to zoom

Adding additional object properties to an Object Map entry

  1. Right-click on the object in the Application Objects list and select Add to Object Map
  2. Right-click the object again, and select Copy Symbolic Name
  3. Click the Object Map button (to the right of the Test Suite drop-down list), and paste the copied symbolic name in the search box
  4. Select the search result to view the object’s Real Name properties and values

    objectMapWithObjectProperties

  5. Identify an object property in the Properties list which may provide additional information when finding the object, right click and select Copy Property Name
  6. Click New in the Real Name section of the Object Map, and paste the copied property name in the Name column
  7. Copy or enter the property’s value from the Properties list, and enter the value in the corresponding row’s Value column.

    realNameProperties

Validating the updated Object Map entry

Use the Check Existence and Highlight Object* buttons to confirm Squish can find the object using the updated real name.

highlightObject

*Highlight Object is not available for Web applications

Further reading




Squish tip of the week: Test Flex Applications

$
0
0

Did you know you can automate testing against your Flex applications?


Watch the video below to learn how to install and configure Squish for Flex to test your Flex applications



Click here to view more videos in froglogic’s Video Library

Additional reading: Installation for Flex applets in web pages

Squish tip of the week: Use Squish IDE functionality from Eclipse

Squish tip of the week: Share Object Map Across Test Suites

$
0
0

Did you know you can share a Squish Object Map with multiple Test Suites?

In Test Suite settings, point to the object map file to share. Do the same in each test suite where you’d like to use the same object map. That’s it!

click to zoom


Read How can I share an Object Map across test suites? to learn more about sharing an Object Map as well as merging Object Maps.




Squish tip of the week: Scripting with the help of the Squish Script Console

$
0
0

When manually scripting or debugging a script, the Squish Script Console provides immediate output and syntax confirmation as well as other valuable data.

Use the Squish Script Console to

Meet with froglogic at Embedded World 2015

$
0
0

Hi,

froglogic will again be present at the Embedded World Conference in Nuremberg from February 24th – February 26th, 2015.

You will find froglogic at Halle 4 / Booth 4-301 and in the partner section at The Qt Company’s booth (Halle 4 / Booth 4-308) showing live demos of testing embedded HMIs with the Squish GUI Tester.

In addition, Reginald Stadlbauer from froglogic will give a talk at the Embedded World Congress with the title Automated testing of Qt and QML applications / Applying Behavior Driven Development and Testing.

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

To meet us at Embedded World you can register for a free day ticket with the code B300759. For more information, see www.embedded-world.de/en.


Behavior Driven GUI Testing

$
0
0

The main feature we are working on for the upcoming Squish release is full-fledged BDD support built directly into Squish.

This includes everything from fully understanding Gherkin, the scripting framework to run BDD tests with step implementations in any of our supported script languages, full IDE support (skeleton generation, code completion, integrated debugging, integrated reporting, …) and advanced reports.

If you are interested to learn more about BDD in general, you can have a look at the slides of a talk I gave about this topic last week: http://www.slideshare.net/ReginaldStadlbauer/behavior-driven-gui-testing.

Squish tip of the week: Working with the Squish Example Test Suites

$
0
0

Did you know every Squish package comes complete with a collection of example Test Suites?

Find Test Suites written in each of the Squish-supported scripting languages (JavaScript, Python, Perl, Tcl and Ruby) along with one or more sample applications to help you get started on your evaluation.

See the three minute video below to learn more:




More Information

Request your free 30 day Squish evaluation
Learn more about Squish
Other Squish Resources (videos, tech articles, user communities and more)

Squish tip of the week: Pass arguments between Test Cases

Squish tip of the week: The power of Symbolic Names

$
0
0

The use of Symbolic Names in scripts is key when creating a maintainable Automated Test Framework.

Imagine the following scenario:
  1. You create a set of 10 tests, or 10,000 tests
  2. A common set of controls (buttons, text fields, etc.) are used through out many of the tests
  3. New release! One (or more) of those commonly used controls changed between releases

What happens next?
  1. Using Symbolic Names: You open the Symbolic Name in the Object Map, update the object reference, click save, and your scripts are off and running again.
  2. Symbolic Names *not* used: You have won the lucky task of locating, modifying and testing every single instance where the changed control was used in your tests.

Tell me more about Symbolic Names

What is a Symbolic Name?

A Symbolic Name is a string or name, which when looked up in an Object Map, points to a Real Name, or a collection of properties and values used to correctly identify an object. The Object Map is available to the entire Test Suite, and can also be shared across multiple test suites. Learn more.

The image below depicts the Object Map View, where the selected Symbolic Name (top) and the corresponding Real Name (bottom) appear:

click to zoom

The lines of script below represent a Symbolic Name and Real Name as they appear within a Test Case:

// Symbolic Name
waitForObject(":addressBookView.listView_ListView");

// Real Name    
waitForObject("{container=':Quick Addressbook.addressBookView_TableView'" +
                    "id='listView' type='ListView' unnamed='1' visible='true'}");

How are Symbolic Names created?
  • Recording a script
    All actions recorded in a script related to objects on which the actions were performed. It is while recording that Object Map entries are created automatically by Squish.
  • Adding an Object to Object Map using Pick tool
  • Manually entering items in the Object Map
    While it is very rarely necessary to manually add items (as they’re added when you interact with the object during recording), using the ‘Pick tool’ approach to at least initiate a new Object Map entry is recommended and easier.

How do Symbolic Names work with Dynamic Objects?

Symbolic Names can point to Object Map entries, or Real Names which use Regular Expressions or Wild Cards to match patterns of dynamic portions of objects.

Further information




Come see froglogic at EclipseCon North America 2015

$
0
0

froglogic will be at the EclipseCon North America 2015 conference in San Francisco, California, Monday, March 9th through Wednesday, March 11th.

Stop by our booth for a live demo of Squish GUI Tester!

If you would like to schedule a meeting at the EclipseCon North America with a representative of froglogic, please contact us.

For more information see https://www.eclipsecon.org/na2015/.

Squish tip of the week: Handling implementation differences between platforms

$
0
0

A great question from our Webinar Q&A session this week: What is the best way to solve implementation differences between platforms (e.g. Windows Vs Unix)?

When dealing with cross-platform applications, for example Java or Qt, the majority of your Squish tests are not impacted by the platform, as your application, and it’s controls/widgets are identical across platforms. Occasionally however differences may exist.

Using Squish there’s an easy way to handle platform differences: Identify and branch for differences

Example working with Java Applications

You can try it using our sample Addressbook application, located in:
<squishDir>\examples\java\addressbook

In the following script (javascript), lines 12 and 13 are valid for Linux and Windows, but not valid for Mac:

function main() {
    startApplication("AddressBookSwing.jar");
    activateItem(waitForObjectItem(":Address Book_javax.swing.JMenuBar", "File"));
    activateItem(waitForObjectItem(":File_javax.swing.JMenu", "New..."));
    activateItem(waitForObjectItem(":Address Book - Unnamed_javax.swing.JMenuBar", "Edit"));
    activateItem(waitForObjectItem(":Edit_javax.swing.JMenu", "Add..."));
    type(waitForObject(":Address Book - Add.Forename:_javax.swing.JTextField"), "jane");
    type(waitForObject(":Address Book - Add.Surname:_javax.swing.JTextField"), "smith");
    type(waitForObject(":Address Book - Add.Email:_javax.swing.JTextField"), "jane@smith.com");
    type(waitForObject(":Address Book - Add.Phone:_javax.swing.JTextField"), "123.123.1234");
    clickButton(waitForObject(":Address Book - Add.OK_javax.swing.JButton"));
    activateItem(waitForObjectItem(":Address Book - Unnamed_javax.swing.JMenuBar", "File"));
    activateItem(waitForObjectItem(":File_javax.swing.JMenu", "Quit"));
    clickButton(waitForObject(":Address Book.No_JButton"));
}

To accommodate the platform difference we’ll:

  1. Check the platform prior to the impacted steps
  2. Branch the script to take one path when the platform is Mac, and another path it isn’t

Which results in the following:

function main() {
    startApplication("AddressBookSwing.jar");
    activateItem(waitForObjectItem(":Address Book_javax.swing.JMenuBar", "File"));
    activateItem(waitForObjectItem(":File_javax.swing.JMenu", "New..."));
    activateItem(waitForObjectItem(":Address Book - Unnamed_javax.swing.JMenuBar", "Edit"));
    activateItem(waitForObjectItem(":Edit_javax.swing.JMenu", "Add..."));
    type(waitForObject(":Address Book - Add.Forename:_javax.swing.JTextField"), "jane");
    type(waitForObject(":Address Book - Add.Surname:_javax.swing.JTextField"), "smith");
    type(waitForObject(":Address Book - Add.Email:_javax.swing.JTextField"), "jane@smith.com");
    type(waitForObject(":Address Book - Add.Phone:_javax.swing.JTextField"), "123.123.1234");
    clickButton(waitForObject(":Address Book - Add.OK_javax.swing.JButton"));
    if (java_lang_System.getProperty("os.name").indexOf("Mac OS") == 0) {
        nativeType("<Command+q>");
    } else {
        activateItem(waitForObjectItem(":Address Book - Unnamed_javax.swing.JMenuBar", "File"));
        activateItem(waitForObjectItem(":File_javax.swing.JMenu", "Quit"));
    }
    clickButton(waitForObject(":Address Book.No_JButton"));
}

Notice, line 12 in the modified script retrieves the platform where the application is *currently* executing. This is important, as the test may be triggered by a remote system using another platform.

Example working with Qt Applications

You can try it using our sample Addressbook application, located in:
<squishDir>\examples\java\addressbook

In the following script (javascript), lines 10 and 11 are valid for Linux and Windows, but not valid for Mac:

function main() {
    startApplication("addressbook");
    clickButton(waitForObject(":Address Book.New_QToolButton"));
    clickButton(waitForObject(":Address Book - Unnamed.Add_QToolButton"));
    type(waitForObject(":Forename:_LineEdit"), "jane");
    type(waitForObject(":Surname:_LineEdit"), "smith");
    type(waitForObject(":Email:_LineEdit"), "jane@smith.com");
    type(waitForObject(":Phone:_LineEdit"), "123.123.1234");
    clickButton(waitForObject(":Address Book - Add.OK_QPushButton"));
    activateItem(waitForObjectItem(":Address Book - Unnamed_QMenuBar", "File"));
    activateItem(waitForObjectItem(":Address Book - Unnamed.File_QMenu", "Quit"));
    clickButton(waitForObject(":Address Book - Delete.No_QPushButton"));
}

To accommodate the platform difference we’ll:

  1. Check the platform prior to the impacted steps
  2. Branch the script to take one path when the platform is Mac, and another path it isn’t

Unlike in Java, where the host platform is available with the java_lang_System.getProperty(“os.name”) statement, for Qt the platform should be passed to the squishrunner service when started.

For example, you may start your squishserver using the following commands:
export SQUISH_HOST_OS=`uname`
./squishserver

For Windows, use ver instead of uname:

for /f "delims=" %a in ('ver') do @set SQUISH_HOST_OS=%a
squishserver.exe

Then modify the script as follows:

function getHostOS(){
    myAUT = currentApplicationContext();
    hostOS = myAUT.environmentVariable("SQUISH_HOST_OS");
    return hostOS
}

function main() {
    startApplication("addressbook");
    clickButton(waitForObject(":Address Book.New_QToolButton"));
    clickButton(waitForObject(":Address Book - Unnamed.Add_QToolButton"));
    type(waitForObject(":Forename:_LineEdit"), "jane");
    type(waitForObject(":Surname:_LineEdit"), "smith");
    type(waitForObject(":Email:_LineEdit"), "jane@smith.com");
    type(waitForObject(":Phone:_LineEdit"), "123.123.1234");
    clickButton(waitForObject(":Address Book - Add.OK_QPushButton"));
    
    if (getHostOS() == "Darwin"){
        nativeType("<Command+q>")
    } else{
        activateItem(waitForObjectItem(":Address Book - Unnamed_QMenuBar", "File"));
        activateItem(waitForObjectItem(":Address Book - Unnamed.File_QMenu", "Quit"));
    }
    
    clickButton(waitForObject(":Address Book - Delete.No_QPushButton"));
}

Notice, line 3 in the modified script retrieves the platform where the application is *currently* executing using the value set in the environment variable before starting the squish server. This is important, as the test may be triggered by a remote system using another platform.

Object Map Tips & Tricks – New Video!

$
0
0

Checkout our latest tutorial: Object Map Tips & Tricks


Watch more tutorials in our Video Library


More Information

Request your free 30 day Squish evaluation
Learn more about Squish
Other Squish Resources (videos, tech articles, user communities and more)


Squish tip of the week: How does Squish find objects?

$
0
0



A critical component to any automated gui testing solution is how objects are identified and interacted with

Squish uses the Object Map to store select properties, and their values or othe object real name, which is then referenced by scripts using a symbolic name.

Example: An OK button

Real name
{text='Yes' type='QPushButton' unnamed='1' 
  visible='1' window=':Address Book - Delete_QMessageBox'}
Symbolic name
:Address Book - Delete.Yes_QPushButton
Object Map Entry

click to zoom


Should the Yes in the button change to Confirm or OK, simply update the property value in the Object Map, and no changes are required in your scripts.

In this case as well, the ‘window’ property value is dynamic, and can be handled with a regular expression or wild card from within the Object Map (or within the script directly) If using an image-based solution, such dynamic changes become a maintenance nightmare.

Changes to objects in an application are handled quickly and from a central location – no updating screenshots or XPaths to objects (however XPath is supported as an option). Additional properties can be added, or undesired or unneeded properties can be removed from an object’s real name as well. The key is the extensive flexibility the Object Map profiles, along with the accuracy with which it can find and interact with objects. Learn more about object vs image-based object recognition

Read more about how Squish finds objects below

Squish tip of the week: Insert comments while recording

$
0
0

Want to include notes or comments in your script about what you’re recording?

While recording, the Control Bar contains an Insert Script Comment button
insertScriptComment

  1. Click the Insert Script Comment button
  2. The Comment Window appearsInsertCommentWindow
  3. Enter a comment and click OK

Once you complete your recording, by clicking Stop, the comment appears within your script. The following example’s comment is: # Adding a new entry

def main():
    startApplication("AddressBookSwing.jar")
    activateItem(waitForObjectItem(":Address Book_JMenuBar", "File"))
    activateItem(waitForObjectItem(":File_JMenu", "New..."))
    activateItem(waitForObjectItem(":Address Book - Unnamed_JMenuBar", "Edit"))
    activateItem(waitForObjectItem(":Edit_JMenu", "Add..."))
    # Adding a new entry
    type(waitForObject(":Address Book - Add.Forename:_JTextField"), "sam")
    type(waitForObject(":Address Book - Add.Forename:_JTextField"), "<Tab>")
    type(waitForObject(":Address Book - Add.Surname:_JTextField"), "smith")
    type(waitForObject(":Address Book - Add.Surname:_JTextField"), "<Tab>")
    type(waitForObject(":Address Book - Add.Email:_JTextField"), "sam@smith.com")
    type(waitForObject(":Address Book - Add.Email:_JTextField"), "<Tab>")
    type(waitForObject(":Address Book - Add.Phone:_JTextField"), "123.123.1234")
    clickButton(waitForObject(":Address Book - Add.OK_JButton"))

Squish tip of the week: How to spy menu items using Pick tool

$
0
0

Using the Pick tool to spy items which only appear when a parent or related item is first selected may appear impossible, but it’s not!

Imagine you want to verify or inspect an item in a menu, drop down list, context menu, etc. You click the menu, and then the Pick tool. Clicking away makes the menu close. How can you possibly ‘pick’ such an object?

Two options:
  • Option 1: Select the parent item using the Pick tool and manually navigate the Application Objects tree.
  • Option 2: Run the IDE using a remote connection to where the AUT is running and select the menu item using the Pick tool
Option 2: Remote Squish IDE & the Pick tool

As learned in a prior Squish tip of the week, your Squish IDE can create tests and interact with applications through a remote connection. Read more here: Squish tip of the week: Create tests against a remote environment

  1. Once you have the remote connection setup, record a test (or use Launch AUT) using a Squish IDE on a separate computer from the running AUT (this also works with a host computer and virtual machine).
  2. Click the menu in the AUT to display the menu contents.
  3. Return to the computer where the IDE is running and select the Pick tool.
  4. Because these are two different systems, the menu does not close (or disappear) when you click the Pick tool.
  5. Back on the computer where the AUT is running, select the menu item of interest.
Result:

The Squish IDE now displays the menu item in the Application Objects tree with its associated properties and values in the Properties list.

Squish tip of the week: Determine memory usage of Application

Squish tip of the week: Using your AUT’s toolkit API

$
0
0

With each Squish edition, or technology supported, you can us the corresponding toolkit’s API from your test scripts.

This gives you access to your application, and to make calls, beyond what can be done from your application’s user interface alone.

Take for example the Java Convenience API

In JavaFx applications you can have more than one top-level window.

How can you ensure the proper top-level window is in front before interacting with it? Use the .toFront() call.

For example, given a symbolic name of MyWindow1, the line would simply read MyWindow1.toFront()

Search doc.froglogic.com for your toolkit’s convenience API, or your the AUT toolkit API documentation.

(Near) endless possibilities!

Viewing all 398 articles
Browse latest View live