Run Test Suites in MuseIDE

Typically, test suites are designed to be run via the command line interface in a scheduled job or a CI server such as Jenkins or Travis CI. The Muse Test Framework has long supported this capability. Now, a test suite can be run in the MuseIDE, too!

Start by pressing the Run button at the top of the test suite editor. This will open the suite progress panel. Press the Run button in the panel to start the suite:

run-suite

After the suite has completed, press the Details button to view the status and event log for each test:

suite-results

Note: this feature first appears in MuseIDE version 0.9.

Advertisements

Import SeleniumIDE tests into MuseIDE

MuseIDE for Selenium supports supports the following commands, targets, matchers when importing SeleniumIDE tests:

Commands

  • click, clickAndWait
  • open
  • goBack, goBackAndWait
  • refresh, refreshAndWait
  • pause (becomes Wait)
  • select (label= and index=)
  • type, sendKeys
  • store
  • verifyElementPresent, assertElementPresent
  • verifyText, assertText
  • verify, assert

Element Targets

  • css
  • id
  • name
  • link
  • xpath

Parameters

  • javascript{…}
  • ${varname}
  • exact:
  • glob:
  • regexp:
  • regexpi:

Note: This list applies to MuseIDE version 0.8.

How to: Import SeleniumIDE tests into MuseIDE

MuseIDE can import SeleniumIDE tests via the Import button in the Project Navigator. Many files can be imported at once; this UI shows some of the problems that can occur during the import process:

seleniumide-importui

A status is shown for each test to be imported. The 4 tests in the above example illustrate:

  1. will import correctly
  2. could not be read and parsed – it might just be a regular HTML file
  3. will be imported, but uses some commands that are not recognized – some manual adjustments will be needed
  4. could be imported if the user selects the Import? checkbox – but it is initially disabled because it would overwrite an existing test in the project

If you would like the original source files to be deleted, check the Delete source files… option before starting the import.

Note: this feature appears in MuseIDE version 0.8.

 

 

 

How to: Use Javascript to provide a step parameter

There are many reasons you may need to dynamically generate a value when building a UI test in MuseIDE. As an example, you may need to type a string into a field that you know will be unique – such as “user1486147711036”, which is the string “user” concatenated with the current time in milliseconds. In Javascript, this might be expressed like:

"user" + getTime()

To accomplish this task in MuseIDE, you can use a JS Eval source to provide the dynamic value.

In the step shown below, a message is sent to the Muse event log that says something like “I’m thinking of a number: 176”.

jseval-step

Diving down to the message source of the Log Message step shows the configuration of the Eval JS source in more detail:

jseval-source

You can use the Eval JS value source to provide dynamic or calculated values to any parameter of any step (or any sub-source of another source).

Chris

Note: this feature appears in MuseIDE version 0.8.

How to: Use RegEx and glob matching in a Verify step

Verifying that a string matches an expression is easy in MuseIDE, which supports both RegEx (Regular Expression) and glob-style matching. This example shows two verify steps, matching against the value of variable var1 using each method.

verify-matchsteps

The Verify step takes a condition parameter, which expects a boolean value, which is what both match sources return.

Looking closer at the first step, we can see the parameters passed into the RegEx match source. The pattern parameter expects a RegEx pattern. More specifically, it expects a Java RegEx pattern. The target parameter is the string that the pattern should be applied to. The (optional) case insensitive parameter can be set to true for case-insensitive RegEx matches.

regex-match

The second verify step illustrates the simpler Glob-style match source, which also expects pattern and target parameters. It supports *, ?, [abc123] and [a-z] wildcard syntax in the pattern.

glob-match

If you have questions about using these steps and sources, you can ask them in the MuseIDE google group.

Note: this feature appears in MuseIDE version 0.8.

How to: Enter randomized text into fields in a MuseIDE/Selenium test

When automating tests using Selenium, it can be handy to generate random, or partially random, numbers as part of a text input field. This is easily accomplished using MuseIDE with the Random Number value source. This example demonstrates configuring the step using the MuseIDE expression language and the random() function-call syntax.

randomfunction

Note: this feature appears in MuseIDE version 0.8.