0

I am developing an automation tool where one of my requirement is to detect whether the input page contains any js error. I have tried using response but this is not wokring.

Can you please help me out as I am stuck very badly.

2
  • Read this thread - stackoverflow.com/questions/6638132/… Commented Dec 9, 2011 at 5:13
  • your question is bit unclear. you want to check javascript code for errors or you want to check the user input via javascript ?? Commented Dec 9, 2011 at 5:24

2 Answers 2

2

You can't check if there is a JavaScript error on the page.

What you can do is on "trappable" errors, you can insert text into a hidden field and read that in your c# code.

But if there is an error in code then I don't think you'll be able to check that in c#.

Actually, you could have a hidden field on the page that already has text in it. Then use JavaScript to clear out the field.

In c# code, if you can see an entry in the field, then there was an error in the JavaScript and if it's empty then the JavaScript ran ok and there was no error.

Sign up to request clarification or add additional context in comments.

Comments

0

Do you mean something like described here? Log client side js errors

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.