Hi All,
I have a Web based Application, On which when I navigate through different Pages give's JS Error. On the Left Bottom Side (if you know).
Now my scenario is I Want to catch and perform certain steps when I get those error's anytime(Ex: Copy the details of the error in a .txt file).
But the JS' error is random and comes at any random page.
Any solution's/Advice which concept/Idea can be used here?
Please Help!!!
Regards,
Deepak
Catching JS error's
Re: Catching JS error's
Hi,
I think the best way would be to use "Handling unexpected Dialogs" code, as shown here:
http://www.ranorex.com/support/user-gui ... html#c4678
Don't be fooled by "handling unexpected dialogs" description. The code can wait and process any GUI element. Basically, if correctly implemented, the code runs in a separated thread during the execution of your test and waits for the appearance of given GUI element. If the element appears, the code jumps to a pointed method, where you can process the error according your needs (e.g. save the error to report or text file). Hope this helps?
I think the best way would be to use "Handling unexpected Dialogs" code, as shown here:
http://www.ranorex.com/support/user-gui ... html#c4678
Don't be fooled by "handling unexpected dialogs" description. The code can wait and process any GUI element. Basically, if correctly implemented, the code runs in a separated thread during the execution of your test and waits for the appearance of given GUI element. If the element appears, the code jumps to a pointed method, where you can process the error according your needs (e.g. save the error to report or text file). Hope this helps?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 76
- Joined: Fri Mar 14, 2014 2:37 pm
Re: Catching JS error's
So will it work if the JS error comes multiple times?
ANd why the Close button is clicked 2 times?
ANd why the Close button is clicked 2 times?
Code: Select all
public static void CloseUpdateCheckDialog(Ranorex.Core.Repository.RepoItemInfo myInfo, Ranorex.Core.Element myElement)
{
myElement.As<Ranorex.Button>().Click();
}
public static void CloseUpdateCheckDialog(Ranorex.Core.RxPath myPath, Ranorex.Core.Element myElement)
{
myElement.As<Ranorex.Button>().Click();
}
Re: Catching JS error's
Yes, it will work each time the GUI element in question appears. As for why the close button in below example is clicked twice, it's just an example! First one is an example of using repository item, second one uses rxpath.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Catching JS error's
The button is not clicked twice.
The example shows 2 different methods that both can click the button. Each method would be called in a slightly different way.
I would highly recommend that you read up on Object Oriented Programming and .NET (especially C#) as they will both be very important in your use of Ranorex. You are developing software, so you need to learn about the environment you will be developing in.
The example shows 2 different methods that both can click the button. Each method would be called in a slightly different way.
I would highly recommend that you read up on Object Oriented Programming and .NET (especially C#) as they will both be very important in your use of Ranorex. You are developing software, so you need to learn about the environment you will be developing in.
Shortcuts usually aren't...
-
- Posts: 76
- Joined: Fri Mar 14, 2014 2:37 pm
Re: Catching JS error's
Hi,
But the Problem is this JS error comes as a element only in IE and not in Chrome and Firefox.
For them we have to go to Developer Option's and check it.
So what are your comments on this?
Regards,
Deepak
But the Problem is this JS error comes as a element only in IE and not in Chrome and Firefox.
For them we have to go to Developer Option's and check it.
So what are your comments on this?
Regards,
Deepak
Re: Catching JS error's
I'm afraid, I don't have any experience with this. But maybe this page could help you:
http://codex.wordpress.org/Using_Your_B ... ipt_Errors
As it looks, there is no simple way to create one check for all browsers?
http://codex.wordpress.org/Using_Your_B ... ipt_Errors
As it looks, there is no simple way to create one check for all browsers?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 76
- Joined: Fri Mar 14, 2014 2:37 pm
Re: Catching JS error's
Yes that was not what i was looking for.
Can anyone else solve the Issue????
Regards,
Deepak
Can anyone else solve the Issue????
Regards,
Deepak
Re: Catching JS error's
I'm afraid, you won't find any easier solution of your problem. Error reporting is different in each browser. So if you really need to check and process these errors in each browser, you will have to implement browser-specific solution for each single browser. I'm almost 100% sure there is no shortcut this time
Actually, there could be a "shortcut", which may help you with your problem, but it would require to add some code to your HTML page. See this tutorial (and its three previous chapters):
http://www.javascriptkit.com/javatutors/error4.shtml
The question is, if your web developers/project leader will be willing to adapt the pages to make them better testable?
Actually, there could be a "shortcut", which may help you with your problem, but it would require to add some code to your HTML page. See this tutorial (and its three previous chapters):
http://www.javascriptkit.com/javatutors/error4.shtml
The question is, if your web developers/project leader will be willing to adapt the pages to make them better testable?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration