Need to get the text of error

I need to get the value of error which is shown in the log like “text not matched” etc. Can anyone please tell me how I can get it. Thanks.

Hi… for what command is this? Best if you post a small demo macro, so we understand.

Hello Plankton, Thanks for your reply. Please check sample below:
“Command”: “verifyText”,
“Target”: “xpath=//body”,
“Value”: “Http/1.1 Service Unavailable”

Now when the text wont match then the error will be generated (which is happening). Similarly at other points other errors are generated which are again expected. I want to copy the text of all the errors and want to email it to me whenever any error occurs. My email part is also ready. Its just I am not able to find a way to copy the text of an error which appears in the log. Any help will be appreciated. Thanks

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

After you can save it in a csv to use after to copy and paste in email or other form

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


“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.

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.