In the above project, there was a mistake done by me, the filename name is "tes2.c" the "t" is missing, and due to this it was not working.
if I type `tes2\testvar`I am getting the output, so it was my mistake.
But there is some more point, which I got after contacting the IAR support team, and I will share this information below.
If the "pre-include" file is specified in your IAR IDE, then this doesn't work, this is a known issue and is present till now, and they will fix this in the next upcoming releases.
Actually, in my main project, there is a "pre-include" file and that's why even after entering the correct information, I am not getting the proper data on the "Live Watch" or "Watch Window". The example shown here was a demo project to show the issue I am facing.
Now there is another possibility to view/watch the static variables.
Click on `"View" --> "Statics"` this will list down all the status variables in your project and this works well even when the "pre-include" file is included in the IAR IDE.