Hi Gracie,
I would suggest you to go by the Global Send Keys approach only. However as per the best practices, you need to follow few steps:
1) Use a 'Navigate' stage and there you first activate the application window which should be spied using Win32 mode. This will help you bring the application at foreground. You can use the 'Activate Application' action for the Win32 element as shown below:
NOTE: The entire browser window container should be spied while using Wind32 mode for the element and not just the inner window under address bar when spying with Win32 mode.2) Now send the click to the element where you want to clear your text. If your element is spied using 'Browser' mode you will get the 'Click' action which requires no input, otherwise with any other modes you can find the relevant action to send a click like 'Send Global Mouse Click Centre' action where you can pass the input text as "LEFT" so that a left click is triggered. Keep in mind that this should be the element where you want to clear your text entirely which in my case is the search bar located inside Google homepage.
3) Now you should use the root element of your application tree for using the 'Global Send Keys' action. Many people commit the mistake here at this step only where they use this action with the element where text needs to be cleared. In my case, the top most element name is 'IE - Google Search Business Object' and to delete the entire content I am sending the value of the special keys which is:
"^a{DEL}"
This is equivalent to press first Ctrl+A button and then press Delete button which selects all the text on currently focused element and then deletes a text.
If the above step 3 does not work, then the other alternative that you can try is instead of Ctrl+A and Delete send something like Home button then Ctrl+End button and then Delete. This means that the cursor goes to the starting of the element and then we select everything till the end and then delete the selected text. If you go via this approach, the text to be passed is:
"{HOME}+{END}{DEL}"
4) Now this is an option step, if you want to type in some data as well after clearing everything you can add one more Global Send Keys action on the root node of your application tree and then send the text value with a small delay interval like 0.05 seconds
NOTE: You should only provide delay interval parameter when you are not sending any special keys and instead are just sending the whole text value otherwise you will get an exception.
As per your requirement, Step 1 to 3 should be more than enough. Please let me know in case you face any issue while executing or implementing the same, I will be happy to help further 🙂
------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily
Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
Wonderbotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com
----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.