Forum Discussion

srini_molleti's avatar
srini_molleti
New Contributor
6 years ago

TestComplete help to Draw a polygon using ArcGIS Drawing Tool - Chrome webportal

Hi,

In our application testing, we got a requirement to automate one scenario which includes web actions and drawing a diagram on an inbuilt design tool. As part of this we need to draw a polygon using inbuilt ArcGIS Drawing Tool, where we may need to do below actions

1. Draw a line combining two points.

2. Draw lines to form a rectangle [Creating a rectangle is the minimum requirement to test our functionality]

3. Select lines to do other actions

4. Select all on the diagram Attached a sample image for your reference.

This can be done using the record and play option provided by TestComplete. But we avoid record and play in our testing as it fails many cases. We only use XPath method to automate most of the web actions. In the above mentioned requirement the location of the rectangle created may also change each time we run, which is very difficult to implement using Record and play option. Could you please give us a best possible solution for this scenario.

 

Note:  Same issue was raised earlier with SmartBear, and they came up with below conclusion: "We've discussed the situation with the team once again, and unfortunately it looks like at the moment there is no way TestComplete can recognize the objects inside SVG. So, a meeting is not going to be very helpful here - as the "HTML5 Support" article I mentioned says, you should be able to interact with the elements using getElementById, getElementsByTagName etc. But, you can register a corresponding feature request here: "TestComplete Feature Requests". If it gets popular, the product owner will select it for discussion."

 

Can anyone help how this can be addressed.

Let me know if you need more details on this.

 

Thank you for all your help in advance,

 

Kind Regards,
Srini

3 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    LLP object in TestComplete is first that comes to my mind.

    I hope that the following approach should work:

    -- Prepare the target UI layout to be in a certain defined state. This may include setting the size of the tested application, positioning the window to a certain place on the screen, etc.;

    -- Use the LLP object to draw the objects that you need. Considering defined fixed initial layout, the drawing can be 'blind', i.e. when the mouse is moved from one hardcoded point to another, or 'semi-blind', i.e. when test code uses start coordinates of the target canvas object and its size and adjusts mouse movement according to them;

    -- Then you may use either image comparison provided by TestComplete to check if mouse actions completed with the expected result, or some third-party image comparison service (e.g. like the one provided by Applitools) to check the same but, maybe, with more flexible settings. Alternatively, you may not check the resulted image and do some backend verification. For example, you may check that certain expected records were generated in the database and this will mean that executed actions succeeded.

     

    • srini_molleti's avatar
      srini_molleti
      New Contributor

      Hi Alex,

       

      Thank you very much for your reply. I am not sure this approach can be used for my application. My current application is not designed using Canvas, but using SVG elements and SmartBear replied saying they are not supporting SVG currently.

       

      Please help me in this case.

       

      Thanks,

      Srini

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi Srini,

         

        Absence of support for SVG or canvas means that TestComplete cannot get their internals (e.g. list of displayed graphical elements).

        This means that it is not possible to use TestComplete's object model provided via Object Browser to manipulate these elements. With the absence of direct support, I see only two other options possible:

        a) Use the approach that I already described. I.e. prepare the tested graphical layout so it is always in the stable, known and predictable state, and use coordinate-based actions to alter it. Then use image comparison to verify that the executed actions resulted in the expected result;

        b) Assuming, that the displayed graphic is data-bound, you may emulate the actions by getting/setting the data on the back-end and either compare them with expected values, or, again, do image comparison after data manipulation to verify that manipulation resulted in correct expected data persisted to the storage.