Hello I have a case where i have to input 10-20 fields with data to an application.
based on data the field may pop up messages. it could be warning message or Error message.
Warning pop up we can ignore but error we have to capture.
the messages for a each field can be different and could be many
question is there a generic way to capture the error messages automatically, if they pop up? do we have to use multiple element exists for each input field to capture different error/warning message on a single field?
It really depends on how the source application is built, most likely if they have the same pop up error window they will have similar selectors. Said that you may create a dynamic selector.
You will need to examine all the error messages for common parameters, keep the common parameters and use wildcards on the variable ones.
So instead of this:
Your selector could look like this.
Then one element exists will work for multiple scenarios
thanks Edwin.
but my question is do i have to write the code for if message poped up or not for a field. if we have to use element exists then do i have to write this for each input field to check if any message poped up or not using element exists?
Firstly you can use element exist activity . This element exist should cover all your popups. Usually you can use attach activity for this. Check cls etc selectors. If there is a warning message such as Alert as a title, make it wilcard. (title=‘alert’)
If you think there is a possibility of warning at every step, continue with the parallel activity. If you see it in the buttons, you can add short-term controls with the visible find element activity right after it. In this way, you do not expect exist time out when the error message is not received.
When you catch errors, you can easily read the content with the same selectors.
i bet there should be some way than writing for each field to handle such situation and more over my screen is overview screen with multiple rows. so i need some robust solution instead of writing for each field in each row to handle many possible popups.
here is what i found though lately
the “triggers scope” with help of “element attribute change” i can handle my requirement and define all my element attribute changes in one trigger scope and write the logic as needed in different background process to capture these messages instead of same process that inputs the data. i believe this can be handled in same process as data input process may be using parallel activities? but not sure
hope this helps someone in future.