Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

What are Objects?

In Qualitia Automation Studio (QAS), Objects refer to the controls of the application being tested. Each object is displayed with its attributes such as object name and class.Describing a Test Object

To describe a test object, you provide a set of property names and their corresponding values. This description helps to identify the objects in the Application Under Test (AUT).

Object-Related Functions

The Objects section on the Develop screen of Qualitia Automation Studio QAS allows you to:

  • Create objects: Suppose you're testing a new feature in a web application that includes a new form for user registration. In this case, you would need to create new objects in Qualitia for each of the form fields (like Generate objects for form fields, such as username, email, and password , etc.) and buttons (like submit, cancel, etc.) in the form, such as submit and cancel to support testing new features in web applications.

  • Edit objects: LetModify object properties when the application's say the developers have updated the user interface of the applicationuser interface changes, ensuring compatibility with updated elements. For example, changing the ID of the " Submit " button in the form from "submitBtn" to "submitButton". In this case, you would need to edit the "Submit" button object in Qualitia to update its property value to match the new ID.

  • Delete objects: If a feature or element of the application is removed during a redesign, such as a "Cancel" button from a form, you would need to delete the corresponding "Cancel" button object from Qualitia to keep your test cases up to date.Locate objects: In a large application with hundreds of test objects, you might need to find a specific object quickly. For example, if you need Remove objects associated with discontinued features or elements during a redesign to maintain up-to-date test cases.

  • Locate objects: Easily find objects or search for objects in object collections. You can check or uncheck the smart locator to enable or disable it. For example, to update the properties of a " Login" button object, you can use the search function in Qualitia to find this object quickly instead of scrolling through a long list of objects.

  • Import objects: If you're working in a team and a team member has already defined some objects for their part of the application, you can import those objects into your project instead of creating them from scratch. This can save time and ensure consistency across the team's work.

Leveraging Regular Expressions

If there is a browser with the title "MyBrowser", you can use a regular expression like "MyB.*" for the title property. Suppose you are testing a web application that dynamically generates page titles based on the content, but all titles start with "MyApp". You can use the regular expression "MyApp.*" to match any page title that starts with "MyApp", allowing your tests to work regardless of the specific page being tested.

Using Key Names

...

Using Regular Expressions

Regular expressions, commonly referred to as regex, are a powerful feature used for pattern matching within Qualitia Automation Studio.

  • Match Patterns: You can use regular expressions to match specific patterns or text within your application's elements, such as web page titles, object properties, or text on a webpage. For example, you want to verify if a web page title starts with "Welcome to" followed by any text. You can use a regular expression as ^Welcome to.* .

  • Dynamic Object Identification: Regular expressions can be helpful when the properties of web elements or objects are dynamic or change based on the content. By using regex, you can create more flexible and robust automation scripts. Suppose you are automating a web application, and the ID attribute of a button changes dynamically, but it always starts with btn_submit. You can use a regular expression to identify this button as ^btn_submit.* .

  • Parameterization: You can use regular expressions to parameterize test data. This means you can use one test script for multiple test scenarios by defining the data pattern with regex. For example, if you have a set of email addresses, and you want to match any valid email address, you can use a regex like this: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}. This regex matches a wide range of valid email addresses.

Using Key Names in Parameterization

If you have a key TitleKey storing the value MyBrowser, you can use the Property Value for the Browser's title as "{TitleKey}".

Use Case: Assume For example, you are testing a multi-language application where the title of the browser changes based on the selected language. Instead of creating separate objects for each language, you can store the title for each language in a key (like "EnglishTitleKey", "SpanishTitleKey", etc.) and , such as EnglishTitleKey, SpanishTitleKey, and more. Now, use these keys in the Property Value field. This way, you can easily switch between languages during testing by just changing the key values.

Scope of Keys

Let us say consider, you are testing an e-commerce website, and you have two test cases:

...

In both the test cases, you need to interact with a product object. The product object has a property " ProductID, " which is used to identify the product.

  • In Test Case 1, you are testing the functionality of adding a product with ProductID "123" to the cart. So, you set a key

...

  • ProductKey

...

  • with the value

...

  • 123

...

  • . In your test steps,

...

  • use

...

  • {ProductKey}

...

  • to refer to the ProductID. When the test runs, Qualitia will replace

...

  • {ProductKey}

...

  • with

...

  • 123

...

  • , and the test will add the product with ProductID

...

  • 123

...

  • to the cart.

  • Now, in Test Case 2, you are testing the functionality of removing a product with ProductID

...

  • 456

...

  • from the cart. You use the same key name

...

  • ProductKey

...

  • with value as

...

  • 456.

...

  • In your test steps, again use

...

  • {ProductKey}

...

  • to refer to the ProductID. When this test runs, Qualitia will replace

...

  • {ProductKey}

...

  • with

...

  • 456

...

  • , and the test will remove the product with ProductID

...

  • 456

...

  • from the cart.

Even though you used the same key name "ProductKey" in both test cases, changing the key value in Test Case 2 did not affect Test Case 1. This is because the scope of the key is limited to the test case in which it is used. This allows you to reuse the same key names across different test cases without worrying about conflicts or unintended consequences.

Concatenating Keys and Strings

If Let us consider, you have two keys,:

  • "StartKey " = Begin

  • "EndKey " = End

You can combine them in several ways to yield different outputs, such as:

  • "{StartKey}{EndKey}" will yield "BeginEnd"

  • "Start{EndKey}" will yield "StartEnd"

  • "{StartKey}ning" will yield "Beginning"

Suppose you are testing a web application that generates dynamic URLs based on user input. The URL structure is www.example.com/{userInput}Page. You can store the user input in a key, say UserKey. In your test steps, you can refer to the URL as www.example.com/{UserKey}Page. This way, you can easily test with different user inputs by just changing the value of UserKey.

Special Characters

  • Braces ({}) - Key Name Identifiers: If you have a key named "TitleKey" storing the value " MyBrowser, " you will use can insert it in the Property Value field as "{TitleKey}". Suppose you are testing . This is particularly useful when dealing with a web application where the page title changes based on user actions. Instead of creating separate objects for each title, you can store the title in a key and use that key reference it in the Property Value field. This way, you can easily change the title being tested by just changing the value of the keyallows for easy adaptation to changes by simply modifying the key's value.

  • Forward Slash (/) - Escape Character in Qualitia: If When you want need to use a string that includes a brace containing braces in the Property Value field, you will need to precede it must precede the brace with a forward slash, like "/{MyString". Suppose you are testing . For example, in a code editor application testing scenario where users can input code snippets. If , if you want wish to test with include a string that includes a brace, you will need to use a forward slash to escape the brace so that Qualitia does not interpret brace in your string, you should escape it with a forward slash. This prevents QAS from interpreting it as a key name identifier.

  • Caret (^) - Array Data Separator: If you want to To pass an array of strings like , such as "Apple," , "Banana," , and "Cherry," in the Property Value field, you will can use a caret (^) as a separator, like "Apple^Banana^Cherry". Use Case: Suppose you are testing a feature . For instance, in a testing scenario where a user can select multiple items from a list, and the these selected items are sent to the server as a string separated by ^. In your test datacaret (^), you can store the selected items as "Apple^Banana^Cherry" Apple^Banana^Cherry in your test data. In your test steps, you can then use this string directly to simulate the user selecting "Apple," , "Banana," , and "Cherry" from the list.

...