Need to get the text of error

Can anyone please help. Thanks.

When site do not load ui vision more command do not execute because need to injection code in page.

Usually when a site do not load macro fail because more commands do not work when a page not load in browser.

Thanks for your reply. Yes, I am aware of that. I am using error ignore to ignore errors and continue. I just want to copy the text of last error generated at any step which I can use for notification email. I am not considering the case where macro stops executing completely. I hope I am able to explain.

To save the text you must use

Storetext command to save it in variable
https://ui.vision/rpa/docs/selenium-ide/storetext

After you can save it in a csv to use after to copy and paste in email or other form
https://ui.vision/rpa/docs/selenium-ide/csvsave

Consider always the problem when a page do not load some commands do not workm i have not mode to reproduce it with a non load site but some command when a page do not load can fails and do not execute the function.

Thanks for your reply. Yes, I can use StoreText command to save the text but How I can get the text of error produced like for the following command, an error like “Text don’t match” will be generated in the log and it will continue to next step for execution.
{
“Command”: “verifyText”,
“Target”: “xpath=//body”,
“Value”: “Http/1.1 Service Unavailable”
},

So similar errors are generated at different steps which are expected as normal decision making but I need to get the text of error generated. Not sure How I can get that error content. I hope i am able to explain. Thanks for your help.

You can add in macro if command and statusOK or LastCommandOK to save in variable your prefered text

After

{
“Command”: “verifyText”,
“Target”: “xpath=//body”,
“Value”: “Http/1.1 Service Unavailable”
},

Add an If with statusOK and after a command to store your error text in a variable.

https://ui.vision/rpa/docs/selenium-ide/if

Thanks for your reply. I really appreciate. I fully understand that I can add text in a variable depending upon value of statusOk but I dont want to save my own text. I want to know what error was generated at any step so I need to save that text which is saved in log. Thanks for taking time with me to resolve it. Much appreciated.

Ui vision can not manipulate the csv or txt files, you can not in easy way access to the log file and extract data and send via form.

for my opinion there are best solution to check the macro work, like a csv with prefered status saved.

I thinks it’s very hard to open log (that have a dinamic name), search interested line, save it in variable and send it via form.

In my opinion, this request is so complex that it is not convenient to carry it out because it would require a lot of time and perhaps additional software.

I don’t even use the error log, I save my personal log, I never read the saved logs of ui vision because I don’t need them.

Thanks for your reply. Much appreciated. I was just thinking that while execution if the macro is saving the error in a log file then there might be a chance that with some command I can get that error value. I dont want to read csv file at all. Also, the part to send email is ready and working with me. Its just I need that if any error is generated then I need that error in a variable. My macro runs 24X7 and I want to be intimated as soon as any unknown error happens in it. Kind of try and catch as done in programming languages but need to know what error was. Thanks. Any suggestions

Run ui vision 24x7 is not recommended because there are numerous random errors that occur randomly. I also use some macros continuously but I close the browser every 5-10 minutes to prevent random errors present in ui vision and that you can never know when they occur. to check I take a screenshot of each macro to know if everything went well or not.

Some random error of ui vision are:

  • Error #101: Kantu is not connected to a browser tab
  • ipc of tab to play expired!
  • ipcPromise: onAsk timeout 3000 for cmd “RUN_COMMAND”

These errors seem random, i have macro that working well, sometimes give these errors but there are not any error in macro.

Usually most problem are caused from slow connection of incorrect loading of pages.

Thanks for your reply. I am running macro with the help of Microsoft Powershell which crashes my browser after every 1 hour then restarts it after a pause. This way its working very nicely and I am using it since December. I want to make it go completely unattended in which I can get emails in case of any error. I am using it on Private LAN. My macro is already sending emails well so I was thinking if I can get the text of errors then I can pass on to my email gateway to get email about it. Thanks for your efforts so far. Much appreciated.

At the moment i do not know command to read the value of error.

In log file there are saved in generic description of errors.

I think you don’t need to read the error log because it doesn’t explain the errors and doesn’t even report a solution

In the macro you can use XRun to call a PowerShell script that can then pull the info out of the log

Seem easy but how you can read and choice correct line in log file ?

Log file change name every time too

If you start your macro from the command line the log name will always be the same: savelog=MyLog.txt

You can then read the whole log into a variable:

$LOG = Get-Content "C:\Users\Path\Path\MyLog.txt"

Then pull out what you are looking for:

$ERROR = ($LOG | Select-String "text not matched")

Using a combination of a macro and a script the options are limitless

1 Like

But seem the user need to choice separated error for every macro step

It’s more easy and fast with if save a csv with info about macro status.

For my opinion is more easy and fast with if save every status with a custom text.

The error log text it doesn’t have any utilitariness.

If find this text save “Error 1”
If find this element save “Error 2”
If not find this text save “Error 3”
If not find this element save “Error 4”

After you have a complet csv with information about macro status.

You didn’t consider an important thing when a page doesn’t load ui vision some commands don’t execute them and therefore can’t work properly even if you set errorignore true some commands don’t work without loading the page because ui vision needs to inject commands within the web page and if it doesn’t load not work many commands then probably not even your status checks will work.

More and more commands without a page loaded can not execute, do not work, fail.

Example selectWindow without a page loaded in browser can not work.

Thanks for your replies everyone. I think if I have to load log or csv then it will be better to keep it outside the macro and just use powershell to read it independently then keep on sending emails. I was thinking that there must be a way to get the exception text in a variable. I think there should be a feature request for this. Also, Yes, I completely agree that there are times when it completely stops. I understand that and handle such situation by crashing the browser every 1 hour to start fresh. If I am able to catch like even 70% of errors via email, it will serve the purpose. Thanks for your efforts everyone. Much appreciated. Its a great community. Any suggestions still welcome.

To check for errors I save a csv with steps (to understand each macro to which step it has arrived) and save also screenshots every few commands in this way I can check the errors.

I happened that ui vision via command link does not start, the macro does not start despite everything is perfectly worked, or I happened to stop without reason so I see from the csv the completed steps I understand that there was a problem, I check the screnshot and I see last state successful and I understand any problem (example site not load o load incomplete).

It can also happen that the browser no longer responds so there are so many different cases of errors that it is difficult to control them all.

Thanks for your reply. What I am going to do is to send generic email whenever an error occurs and will check by opening specific log file to see what was the error. Also, take screenshot when an error occurs. Thanks for your help so far. Much appreciated.