1

I want to display log which is a long string in an HTML page. Sample log which I want to display is below. When I insert this directly into my HTML, it is displayed as a continuous text. Is there any cleaner way of displaying the log as it is on my screen. One of the way to achieve is to replace \n with <br> but that would still remove lot of formatting like spaces etc. Is there any in built way in angularjs or some kind of module I can use to preserve the formatting and display as it is?

Testrun log : org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"link text","selector":"python Button sub components"}
Command duration or timeout: 62.06 seconds
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
1

1 Answer 1

4

Could you just wrap it in a <pre> tag which will preserve the line breaks and spacing?

<pre>{{ logDataVar }}</pre>
Sign up to request clarification or add additional context in comments.

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.