Implementation of Built-in RightClickNextTo Function in OCR Module
We propose the addition of a new built-in function called RightClickNextTo in the OCR module of TestComplete. This function would work similarly to the existing ClickNextTo but would simulate a right-click action next to an identified text element based on its coordinates.
Currently, we have implemented a custom RightClickNextTo function by leveraging the x1, y1, x2, y2, height, and width coordinates obtained from the Bounds function of the OCR object. After identifying the text, the function calculates the necessary offset and direction to perform the right-click action. However, we initially encountered challenges when applying this function to the BlockByText object due to coordinates errors. After further experimentation, we realized that the coordinates should be applied directly to the ClickR in the image object or the screen object identified through the TestComplete Object Spy, bypassing the OCR object's bounds error.
While this solution works, we believe that incorporating this functionality as a native built-in feature within the OCR module would streamline the process and make it more accessible to all users. The RightClickNextTo function could be used for more precise interaction with text elements based on their coordinates, particularly for scenarios where right-clicking actions are needed, improving the flexibility and usability of the OCR module for automated testing.
By making this a built-in function, TestComplete users would save time and avoid errors when trying to implement similar solution manually, improving overall productivity and reducing complexity in the automation process.
Code Snippet: [ Refer the attached image]
This code snippet demonstrates how the custom RightClickNextTo function calculates the coordinates and applies a right-click at the identified text's location using the image or screen object.
We truly appreciate your consideration of this suggestion, as making it a built-in function would greatly enhance the usability of the OCR module for right-click action, benefiting users and simplifying the automation process.