Error handling in WhatsApp Web

Error handling in WhatsApp Web

Hello everybody. Recently I'm developing an RPA to send promotions to my company's associates. But I'm experiencing some problems regarding error handling.

I'm using the WA Web Plus for WhatsApp extension to be able to send messages to unregistered numbers on my phone.

But when a number doesn't exist or is an invalid number my script crashes. I would like some help regarding the use of the try catch block. I will be attaching images of errors that I would like my script to skip ahead and go to the next contact from my CSV using the for each row loop.

Uploading: Screenshot_1.jpg…

@Matheus_Antunes

You can use try catch around your activities in for each so that if something fails it moves to next iteration in loop…

Alternately …you can do a proactive approach…of first check if a number is valid or not if you get any message can read it and move to next item using a if condition

Cheers

Can you send me a example about how can i use the try catch around my activities?
The activie “For each row” need stay inside de activie “Try catch”?

@Matheus_Antunes

This is how it looks

your try catch should be inside the loop and all activities inside loop should be inside the try block…and in catch you can log message of error and move ahead

cheers

Thanks for help me Anil_G!
In the Catches Exception i want use one activitie to click in in a message that appears on my WhatsApp Web screen.
What type of exception should I use to handle an exception in my internet browser?

I will attach the image of the exception.

Screenshot_1

I need click in the “OK” and continue to the next contact in my for each.

@Matheus_Antunes

You can use system.Exception which will catch all types of exceptions…

Apart from that if you want to know the specific exception that occurs then when exception occurs open locals panel and open the exception details which will contain the exception type

Alternately if this is not a exception from activity and is a new pop up that comes…then you can use check app state to check for this pop up and then you can raise an exception to catch or handle the pop up when it is found or on else side you can continue

Hope this helps

cheers

cheers

Hello Anil_G!
My script still does not work…

I will attach the sequence about my script in here. My problem continue in the “Catch situation”.

The problem is below in this image sequence, my script dont click in the “OK” in the message to continue to the next contact in CSV

@Matheus_Antunes

First of all is the bot coming to the catch sequence?

If yes then when the pop up appears is what you need to click…so check app state shpuld be for pop up and on the element appears side you have to click on the pop up

Cheers

Hi Anil_G!
Thanks again for suport.
My script doesn’t go into the catch block.
It stops before one step inside the try block.
The first loop with a valid number it does normally but when there is an invalid number in the listing it continues the flow inside the try block and does not enter the Catch block as expected.
I will attach a printscreen of where it goes after finding an invalid number and not entering the catch block.
And the strangest thing is that the script passes from the invalid number message.
There is no click by the script. It just continues the flow ignoring the catch…

image

@Matheus_Antunes

Then do one thing…

After searching for the number…before doing the next activity…use a check app state and check for any number not found message…if that is found then on the then side of it do nothing and put your code to proceed on the else side…so that way you need to use try catch as well…

As we are checking before hand for the error message and taking an alternate path

Cheers

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.