Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Dark

Collapse
Brand Logo

Forum

How Tosca Decides Which Button or Field to Click?

Scheduled Pinned Locked Moved General Discussion
1 Posts 1 Posters 70 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    topitcourses
    wrote last edited by
    #1

    Tosca (1).jpg

    Tosca uses previously stored data in order to determine which button, textbox, link, or another control to click. Before using any element, Tosca determines its properties. Such properties are needed by Tosca in order to determine which element should be clicked or updated. In Tosca Training, it is crucial to understand the way this procedure works because any small change in an application can lead to test failure.

    Key Takeaways

    ● Tosca uses control properties in order to determine the right button or field.
    ● Text of the button may not be enough to determine control.
    ● Unique properties prevent Tosca from clicking on the wrong element.
    ● Test failure may occur due to changes in ID and hidden controls.
    ● XScan tool can help testers manage control properties.
    ● Control should be available before being used by Tosca.

    How Does Tosca Find a Button?

    Upon scanning an application, Tosca retrieves information regarding the controls that exist on the screen. The scan process generates a Module that can be utilized during the testing of the application in the test case execution process. Upon test execution, Tosca searches through the retrieved information in order to locate the control it requires to perform the desired action.
    It does not rely solely on the location of the button on the screen. Properties it is capable of searching include:
    ● ID: Identifier for a control.
    ● Name: Name assigned to a field or button.
    ● Text: Text displayed by a control.
    ● Control type: Type of the control, whether a button, text field or hyperlink.
    ● Parent control: Area of the screen containing the control.
    The properties depend on the application being tested and the scanning technique used.

    What Happens When Tosca Runs a Test?

    Step 1: Testing begins
    Tosca scans the action stored in the test case.

    Step 2: Identifying the control
    It verifies the stored attributes of the button or the field.

    Step 3: Verifying the match
    It verifies whether the required control is identified.

    Step 4: Performing the action
    Tosca clicks the button or inputs the required data.

    Identification of the button doesn’t necessarily mean that Tosca will be able to click it. The button might be disabled, the page might still be loading, or there might be another window covering it.
    That’s why testers need to verify two conditions – whether the required control has been identified by Tosca and whether it is clickable.

    Why Does Tosca Need Unique Properties?

    A lot of applications contain multiple buttons that have the same label. An application might contain two Submit buttons or multiple Save buttons. Tosca will not have enough identifying criteria to distinguish between these buttons based on their names alone.
    Here is when unique properties come into play. The unique properties can be added via the Make Unique command of the Tosca XScan tool.

    Table.PNG

    The test should contain those properties which distinguish the desired control from other controls. The inclusion of additional properties without verification may lead to increased complexity of the test case.

    How Does Tosca Handle Two Buttons with the Same Name?

    Consider a page with two Submit buttons, where one of these buttons is part of an employee form and the other is part of a payment form. The buttons have identical text, but perform different actions.
    More information will help Tosca identify the right button. The tester will launch XScan and view the properties of the buttons.
    The tester will be able to do the following:
    ● Select the desired button.
    ● Verify its stored properties.
    ● Perform Make Unique operation or add relevant properties.
    ● Identify the parent section if the buttons are similar to Tosca.
    ● Save the Module and re-run the test.
    In this way, Tosca will be able to identify the button in the correct section rather than just its text.

    What Happens When a Button ID Changes?

    Some programs generate their IDs automatically. In some cases, these IDs vary from session to session and Tosca will fail to locate the control during the following run.
    For instance, in one test session a field may have the ID like user_123 and in another – user_456. In case if the varying element follows some pattern, it may be possible to use a wildcard in order to identify it. However, this pattern should always lead to the correct element.
    There are other reasons why Tosca may not recognize controls including:
    ● The developer changes the properties of the control.
    ● Another popup window has a button that has the same name as the required one.
    ● The field is generated only after executing another action.
    ● Loading the page is taking too much time.
    ● Hidden control is similar to the visible one in its properties.
    In case of using Tosca Certification Training, it is important to try to find the true cause of failure prior to making any changes in the Module.

    What If Tosca Cannot Find the Control?

    Property-based identification is normally a good choice for starting out, but there might be certain cases where other identification techniques could be used. The software Tosca provides different means of identification, depending on the application and the technology being used.
    A tester may have to consider these types:
    ● Property-based identification: This is based on factors like id, text, and control type.
    ● Anchor-based identification: Based on a control that lies close by.
    ● Image-based identification: Based on the image or appearance of an element.
    ● Index-based identification: Based on the index number of the element in the list.
    Image and index techniques require special considerations as any change in screen layout could impact them. Property-based technique is normally easier to maintain when the application has stable properties.
    Students enrolled for Tosca Classes in Hyderabad will gain experience using these techniques on forms, tables, and pop-ups, to observe how different controls work during testing.

    Conclusion

    Tosca identifies the correct button or field using saved properties before executing any action on it. In case there are two controls having the same property details, or when there is a change in ID, the test will not work properly. The tester must verify the property and select the appropriate identification details. This knowledge helps to troubleshoot the test case easily.

    1 Reply Last reply
    0

  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups