Is the htmlunit "WARNING: CSSValue '0\0' has to be a 'px', 'em', '%', 'mm', 'ex', or 'pt' value." really just a warning? - htmlunit

I'm trying to load a web page with htmlunit 2.33 and my app displays the above CSS warning in a seemingly endless, repeating list.
I'm specifying FIREFOX_60.
I've tried setting the "silent" css error handler, but that doesn't help.
wc.setCssErrorHandler(new SilentCssErrorHandler());
I'm not sure that setting the log level to OFF is the right answer, either.
It looked to me like the htmlunit library was stuck in a loop. Sure enough, when I let the page complete, I was presented with this error:
Exception in thread "main"
Exception: java.lang.OutOfMemoryError thrown from the
UncaughtExceptionHandler in thread "main"

Looks like an issue; please open one in the HtmlUnit bug tracker or on github and provide all the details you have (complete stack traces, souce code, url of the page your are testing and so on). If i'm able to reproduce i can fix it.

Related

Moodle Moove Child Theme

I am trying to make a child theme for 'Moove' in moodle 3.6! But as soon as I update my database and click on theme selector button, I get an HTTP 500 error!
I follow the instruction from the blog below, but apparently, I am doing something wrong. Can sb help me please?
https://edwiser.org/blog/create-child-theme-moodle/
Error 500 usually means there is something wrong in your scripts/configuration.
First thing to do would be to enable debugging messages to see what exactly is wrong.
Here you can find how to enable debug output to get more detailed error messages: https://docs.moodle.org/36/en/Debugging#In_config.php

Nativescript error context is not fully stringified

It makes development really hard when you can't see stacktrace and the context of the error. Is there any way to make nativescript errors more transparent? How I can manage to stringify the error context?
JS: ERROR TypeError: format.replace is not a function
JS: ERROR CONTEXT [object Object]
It is really hard to search for that null variable. A needle in the haystack...
I found a workaround solution but still we should spend time to view the error context.
If you are using Angular with Nativescript probably your error is being thrown from core.umd.js (#Angular). Without Nativescript every field of the error is visible. I found two solutions that still take time:
Method 1: You can easily debug your error by placing a breakpoint to callWithDebugContext function.
Method 2: You can catch any throw on any level using try...catch, you may wrap your method and stringify your err.context.
I am not considering top most level try...catch as a solution.
But these are still not the best way. Nativescript team should fix this console logging issue.

HTMLUnit error: Attempted to refresh a page using an ImmediateRefreshHandler which

For several days I'm facing an odd error with HTMLUnit - all page loads fail with following exception:
java.lang.RuntimeException: Refresh to https://acme.com:11111/x/y/z aborted by HtmlUnit: Attempted to refresh a page using an ImmediateRefreshHandler which could have caused an OutOfMemoryError Please use WaitingRefreshHandler or ThreadedRefreshHandler instead.
at com.gargoylesoftware.htmlunit.ImmediateRefreshHandler.handleRefresh(ImmediateRefreshHandler.java:56)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeRefreshIfNeeded(HtmlPage.java:1276)
at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:216)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:440)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:311)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:373)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:358)
...
Well ... the error message is descriptive enough and I guess I can make the WebClient instances use WaitingRefreshHandler or ThreadedRefreshHandler.
However:
these tests run against 4 different product releases and this issue
occurs only on one of them.
they run for about 3 years now and this
issue appeared only recently.
Based on that - most probably the reason is in the target system but the error does not provide any further details what happened and why. Does anyone have an idea what is the root cause of this issue?
Note: I'm using htmlunit 2.9.

When testing with WatiN: "'DebuggerDisplayProxy()' threw an exception of type 'System.InvalidCastException'"

FrameworkActionsLink = CurrentBuyerSite.BuyerWorkAreaFrame.Link(Find.ById("actions"));
I have code which finds a link element by finding by ID.
The HTML on the page is:
<a id="actions" href="Javascript:ShowMenuItem('options','actions'); ... >
I have excluded the full Javascript code in the href where you see "...".
On test execution, sometimes this code works correctly, but sometimes I get the following error:
'DebuggerDisplayProxy()' threw an exception of type
'System.InvalidCastException'
It's a pretty straightforward bit of code, I just wondered if anyone had experienced similar problems or error messages. Do you think this is an issue with the WatiN tool, the web application, the internet browser, or perhaps something else entirely?
Can you try the following code:
FrameworkActionsLink = (WatiN.Core.Link)CurrentBuyerSite.BuyerWorkAreaFrame.Link(Find.ById("actions"));
I'm pretty sure that it doesn't like the link being JavaScript:...
Edit: Try maybe this:
CurrentBuyerSite.Eval("ShowMenuItem('options','actions'); ...");
What runner are you using? if nUnit 64bit then try 32bit or other runner.
Maybe the issue is that page didn't fully download and that makes problem with javascript function, try replace Click() for ClickNoWait().

Displaying Error Page in WP7 app

Just want to check I have not missed anything obvious. There is no way to Navigate the user to a "ooops something bad has happened" page from the UnhandledException handler is there?
What is everyone else doing
I know I can "handle" the error and popup up messagebox but I would prefer a whole page offering them the oppurtunity to file a bug report.
The samples I have seen simply set the RootFrame directly but I have seen that just makes for a messy UI with what looks like a Page displayed on top of another page
TIA
Pat
If you get an UnhandledException it occurs while your applicaiton is about to be shut down. The best you can do in this situation is warn the user that something went wrong (using a messagebox or similar) but be prepared that this may not be displayed to the user for long, depending on the actual exception.
Rather than try and continue executing application functionality when an unhandled exception occurs, simply save the details of the exception. Then, when the application is next started, display a message to the user to indicate that "the last time that app ran there was a problem". You can also use this opportunity to send exception details to yourself/ your web reporting service so you can analyse the issues and fix/prevent them in a future version.
You can call RootFrame.Navigate(your errorPage) to navigate to your custom error page in the UnhandledException handler.
Basically, using a custom MessageBox to show a nice easy-going error info and providing an button to send bug report is very common. And this article is MSDN pointed out that errorinfo not be a separate page in best practice.

Resources