I believe I am launching into the new page that will display the chart on the browser. But the html returned is not complete no matter how long I wait (the chart does take a while when rendered in browser).
HtmlPage newPage = anchorElement.click(false, false, false, true, true, false);
System.out.println("override click ");
int count2 = 0;
boolean foundLoading = false;
String LOADING_STR = "LOADING...";
while (!foundLoading && count2++ < 200) {
webClient.waitForBackgroundJavaScriptStartingBefore(2000);
foundLoading = newPage.asXml().contains("Graph Interval")
&& newPage.asXml().contains(LOADING_STR);
if (foundLoading) {
outputToFile("withchart.html", newPage.asXml());
// outputToFile("chartAsNText.txt", newPage.asNormalizedText()); // empty
}
if (count2 % 100 == 0)
System.out.println("LOADING count2:" + count2);
}
// now waiting for loading to go away
count2 = 0;
while (foundLoading && count2 < 10000) {
if (count2++ % 100 == 0)
System.out.println("waiting for LOADING to go away - count2:" + count2);
webClient.waitForBackgroundJavaScript(2000);
foundLoading = newPage.asXml().contains(LOADING_STR);
if (!foundLoading) {
outputToFile("chartLoaded.html", newPage.asXml());
outputToFile("loadedChartAsNText.txt", newPage.asNormalizedText());
}
}
outputToFile("chart_loaded.html", newPage.asXml());
The last line is:
<script src="/Navigator/assets/pt/dojoChart/DojoGraphLauncher.js" type="text/javascript" graphinfo="{"packageId":"IBM_MN","perspectiveId":"P_SM_CPU_UTIL_AVG","perspectiveName":"CPU Utilization (Average)","collectionLib":"QPFRDATA","collectionName":"Q098000004","collectionType":"*CSFILE","collectionFormat":"*CSFILE","fileLevel":"48","startTime":"Apr 8, 2021, 12:00:04 AM","endTime":"ONGOING","systemName":"Z1432BP3","release":"V7R3M0","targetSystem":"z1432bp3.rch.stglabs.ibm.com"}" contextmri="{"context":"Context","actions":"Actions","collectionName":"Collection Name:","collectionLib":"Collection Library:","fileLevel":"File Level:","startTime":"Start Time:","endTime":"End Time:","systemName":"System Name:","release":"Release:","EMPTY_RESULT_SET":"Query returned empty result set. No data is available to display in chart or table.","EMPTY_RESULT_SET2":"Query returned empty result set. There is no data available to display in chart or table.","refresh":"Refresh","reset":"Reset","CONTEXT_FROM":"From","CONTEXT_TO":"To","loading":"LOADING....","NO_RESULTS_FROM_SERVER":"No results returned from server","HELP_ICON_TEXT":"Click for help","collectionType":"Collection Type:","graphInterval":"Graph Interval:","INTNUM":"Interval number","T_TABLE_VIEW":"Table View","T_TABLE_CHART_VIEW":"Chart & Table View","T_CHART_VIEW":"Chart View","T_SHOW_SQL":"Show SQL","1min":"1 minute","5min":"5 minute","15min":"15 minute","30min":"30 minute","1hour":"1 hour","6hour":"6 hour","12hour":"12 hour","1day":"1 day","viewAllPoints":"View all points","E_ERROR":"E_ERROR","QUERY_PARSE_ERROR":"The query you entered can not be understood by this application. Please correct and try again.","MODIFY_SQL":"Modify SQL","T_HELP":"Help","OK":"OK","CANCEL":"CANCEL","SYSTEM_INFOR":"System Information","CSFILEFORMAT":"Collection Services File Based Collection","QAPMCONF_VIEW":"QAPMCO
How can I debug to find out why it stops at this point? I have the output at ALL and don't see anything significant other than items I have reported earlier.
debug output htmlunit.txt
=== overview of using HtmlUnit for this project ===
I am starting to lose hope that HtmlUnit is going to work with my project. I have tried several paths and keep getting stopped with parts that do not work for my project.
issue #335 - cannot view text of page (asNormalizedText() is blank) to look for status messages such as "LOADING...". Should be able to circumvent this by identifying something that will only be in the "asXml()" output when the loading portion of the chart is completed.
issue #324 - cannot click on link in table with Typescript Angular code. Have circumvented this with using the menu option and selecting the drop down menu list item
issue #318 - errors that may or may not be causing problems with the chart rendering
issue #310 - seems insignificant to my project
issue #305 - cannot export the chart to a downloadable file. Working through this another direction and I have some hope that using this new way could avoid this problem (?). This will be the biggest blocker if I hit it again with the new direction.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too
We use tracking cookies to understand how you use the product and help us improve it.