An error is triggered by window opening

When clicking on HtmlAnchor, a pop-up window should appear. However, the program crashes with the error message: com.gargoylesoftware.htmlunit.ScriptException: Exception invoking open. Below is the code and console printouts for reference. The href attribute is as follows:

Javascript:window.open('https://www.apps.amway.hu/shop/los/los.aspx?lng=hu', 'points_window', 'width=830,height=580,location=0,menubar=0,resizable=1,scrollbars=1,status=1,titlebar=0,toolbar=0');void(0);

Your assistance in resolving this issue is greatly appreciated.




link = (HtmlAnchor) page.getFirstByXPath("//*[@id=\"content\"]/div[2]/div[2]/div[3]/a");

System.out.println("link text= ,"+link.asText()+"  hreg= "+link.getHrefAttribute());

page= (HtmlPage) link.click();  

The error report generated is as follows:

 com.gargoylesoftware.htmlunit.ScriptException: Exception invoking open
    ======= EXCEPTION START ========
    Exception class=[java.lang.RuntimeException]
    com.gargoylesoftware.htmlunit.ScriptException: Exception invoking open
        at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:894)
        at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628)
        at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:515)
        ...
    ... more detailed exception information can be found in the original content above...
    ...
======= EXCEPTION END ========

Answer №1

If you encounter any problems with HtmlUnit, make sure to log an issue detailing the version and providing the full StackTrace for better assistance.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilizing ngModel bindings in AngularJS to link controller data, or invoking functions through ngModel

I am attempting to link an unspecified array index based on a certain property in angularjs. <select id="iditemtype" ng-model="bindSpecificAttribute(entity, e)" ng-options="e as e.configValue for e in allConfig() | filter:{typeName:'It ...

I have decided to integrate Laravel with Vite for building CSS and JS. However, when I attempted to run `npm run dev`, it appeared to execute but was accompanied by an error in the background that

Hi there, I'm new to Laravel and I've created a small app that primarily uses CSS and JS scripts. Everything was working fine in my development environment, so I decided to push it to a production server. However, after installation, my code does ...

What is the correct way to encapsulate a socket.io socket for optimal performance?

In my node.js server application, this code is currently executing: io.sockets.on('connection', function (socket) { var c = new Client(socket, Tools.GenerateID()); waitingClients.push(c); allClients.push(c); if (waitingClients ...

Validating object keys

I am dealing with an array of objects and I need to find a way to pass multiple keys in the function checkArray to validate these keys within each object. var test = [ { // Object details here... }, { // Another object details here... } ...

Tallying the number of messages on Facebook

Greetings everyone! I have been utilizing the Facebook JS SDK to retrieve the number of messages sent. Below is the code snippet: <script> function statusChangeCallback(response) { console.log('statusChangeCallback'); console.log ...

Using Node.js with Express, the Router.use() method expects a middleware function as an argument, however, it received a different type: ' +

As I delve into the world of back-end development using node and express, my current project involves creating a back-end for a simple blog with posts and user authentication. This will be utilized later in an angular 4 application. While testing the "Pos ...

When the jQuery keyup event is triggered, the "function" will be incremented to 0

There are three input fields to search a JSON tree. When all three fields are filled correctly, the data from the next level of the JSON tree is retrieved. A number is incremented through the keyup event to access the next data of the JSON tree. However, ...

Can you guide me on using protractor locators to find a child element?

Could you provide a suggestion for locating the <input> element in the DOM below? I have used by.repeater but can only reach the <td> element. Any additional protractor locator I try does not find the <input> element underneath. Thank y ...

Tips for retaining the value of a variable when the page is reloaded

I need to store the value of the variable loggedIn, as it determines the behavior of a function in appComponent.html. Can you explain how I can achieve this? Template of app component: <li class="nav-item"> <a class ...

What is the best way to show "no results found" message in a jQuery search list?

Everything is working smoothly. Does anyone have any suggestions on how to display a message saying "No results found"? This is the code I'm using: http://jsfiddle.net/UI_Designer/8p426fog/4/ $(".my-textbox").keyup(function() { var val = $( ...

Is it possible for a nodejs server to handle both grpc and express servers simultaneously, or do they need to be separate servers?

I'm currently in the process of building a REST server using Node/Express. I'm curious about how to incorporate a GRPC server within the same setup. Would it be possible to run both servers on the same NodeJS instance, or is it recommended to hav ...

JavaScript is currently not executing properly. According to Firebug, the message states to "reload the page to obtain the source for: ..."

I'm currently working on creating a bookmarklet that adds some JavaScript elements to the head of a webpage. However, I've noticed that one of them is not loading properly. Is there a solution to this issue? Is it possible to reload the page wit ...

The variable maintains the same value both inside and outside of the loop

I have a list of objects that provide information to a variable, which creates "markers": var markers = [ //testPOW { mesh: ["campDome","POW"], color: iconRed, location: {lat: 43.30985465943113, lng: 11.898409657895801}, visible: true, id: "TestPO ...

Use React to increment a variable by a random value until it reaches a specific threshold

I am currently working on creating a simulated loading bar, similar to the one seen on YouTube videos. My goal is for it to last 1.5 seconds, which is the average time it takes for my page to load. However, I have encountered an issue with the following co ...

Tips for accessing elements using document.getElementsByTagName

Greetings and best wishes for the holiday season! I hope everyone is cozy and safe. I need a little help with some code here, as I am fairly new to JavaScript but not entirely new to programming. Despite finding an answer on this site, I am still encounter ...

`Inability to remove item from array in Vue.js`

I've been struggling to understand why this feature isn't functioning as expected. I'm using sample code for reference, but it's not behaving the same way. When I click on the delete button, nothing happens even though it should remove ...

Discovering the final element of ng-content while conducting tests using Protractor

I am searching for the always last element to click on. This is what I see when I inspect the page. https://i.sstatic.net/DMXQ8.png https://i.sstatic.net/ZkbER.png ...

Verify whether the element has been clicked prior to deletion

Here is the jquery code I'm working with: $(document).on('focusout', '#element_a', function(e){ $('#element_b').remove(); }); $(document).on('click', '#element_b', function(e){ // additional ...

In TypeScript, use a Record<string, any> to convert to {name: string}

I have developed a custom react hook to handle API calls: const useFetch: (string) => Record<string, any> | null = (path: string) => { const [data, setData] = useState<Record<string, any> | null>(null); var requestOptions: Requ ...

Loop through a variable class name in JavaScript

When working with Javascript, I have a series of elements with identical divs: (....loop, where "count" is a unique number for each column) <other divs> <div class="pie"></div> </div> My goal is to be able to rotate each individ ...