WebdriverIo- Focus remains outside the browser after closing a pop-up window

Trying to automate a scenario, but encountering an issue where execution stops after step 3.

  1. Entering username/password on login page
  2. Clicking submit button opens a pop-up window, entering data in input box on pop-up window and clicking the OK button
  3. Pop-up closes and a new page is displayed.
  4. Verifying elements on the newly displayed page.

Encountering issues with locating items even after trying various methods like getting browser handle, using wait until, and getting browser URL.

After closing the pop-up window, no further steps are executed, leading to execution stopping and eventually showing an error in the console:

JavaScript heap out of memory.

Additional details: Node version - 12 Webdriver 6.4.0 Browser - Chrome 100.04896

EDIT: After debugging, found an exception stating "Session closed/target window is already closed." Unsure of the reason for this exception being thrown.

Answer №1

Have you attempted to implement a solution similar to the following?

let currentWindow = browser.getCurrentWindow();

browser.switchToCurrentWindow(currentWindow);

or

browser.switchToParentFrame()

or

browser.switchToFrame()

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

Error message on line 55 of the kernel_require.rb file in ruby 2.3.0 indicates that the file selenium-webdriver cannot be loaded due to a LoadError

When attempting to execute the code snippet below, I encountered an error: ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- selenium-webdriver (LoadError) I am struggling to identify the missing piece in my ...

Looking for a way to add interactivity to this canvas rectangle?

ctx.fillStyle = "#9b958c"; ctx.fillRect(sampleRectX, sampleRectY, sampleRectW, sampleRectH); ctx.fillStyle = "#fff"; ctx.fillText("Click here to play again.", sampleTextX, sampleTextY); This clickable rectangle has been giving me some trouble. While I fou ...

How can I write a Python code to capture screenshots of individual web elements with distinct names for each?

Exploring automated browser testing with Selenium Webdriver (Python 3) is a new experience for me. Currently, I have been utilizing the following testing method along with capturing screenshots: from selenium import webdriver from selenium.webdriver.suppo ...

Having trouble with a tslint error in Typescript when creating a reducer

I encountered an error while working with a simple reducer in ngRx, specifically with the on() method. https://i.sstatic.net/9fsvj.png In addition, I came across some errors in the reducer_creator.d.ts file: https://i.sstatic.net/sWvMu.png https://i.ss ...

Nextjs server encountered an issue where it was unable to connect to the localhost

npm run dev > <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="563239352239247b372626393f38223b3338227b3439393d3f38317b2133347b372626166678677866">[email protected]</a> dev > next dev ▲ Next.js 14.2. ...

I need to complete the json data to complete the form

Please take a look at this image, as it illustrates what I am trying to achieve Is there a way to automatically populate input boxes when adding more rows to fill? (refer to the image) This is how I retrieve and load the JSON data: #loading Json file wit ...

Webpack: Live reloading is not functioning properly, however the changes are still successfully compiling

Could someone help me understand why my React application, set up with Webpack hot reload, is not functioning properly? Below is the content of my webpack.config.js: const path = require('path'); module.exports = { mode: 'development&apo ...

Manipulating strings in Discord.js

if(msg.content.includes("[mid]")) { let str = msg.content let pokeID = str.substring( str.indexOf("[mid]") + 5, str.lastIndexOf("[/mid") //get the unique-code for a pokemon ); msg.channel.send ...

Is it necessary to delay until the entire page finishes loading in Selenium 3?

public boolean CheckPageLoadStatus(){ final ExpectedCondition<Boolean> pageLoadCondition = new ExpectedCondition<Boolean>() { public Boolean apply(final WebDriver driver) { return ((JavascriptExecutor) driver).executeScr ...

Managing the transition of the object in question

I am in the process of designing a navigation bar. I have created an array to store the information of the tabs present in the nav bar. tabs: [ { name: 'All',id: "dash.courses.all", to: 'all', curre ...

Only capitalized keyboard input will be registered by the document on keydown event

I'm currently working on developing a shared canvas wall that looks the same to everyone viewing the webpage and can be edited in real-time by all users. However, I'm facing some challenges when it comes to accurately capturing keyboard input to ...

anticipating the response of JS callbacks on the main thread

I am currently in the process of setting up an authentication and account creation page for my website using Express and SQLite. I am facing a challenge with my function to add users, as it involves multiple callback steps interacting with the database. I ...

The reactivity of a Vue.js computed property diminishes when it is transmitted through an event handler

Within my main application, I've implemented a Modal component that receives content via an event whenever a modal needs to be displayed. The Modal content consists of a list with an associated action for each item, such as "select" or "remove": Vue. ...

Show the information from the selected item in a modal window

I'm currently using React to develop an application that allows me to view flags and various information about each country. I have integrated an API to retrieve the data, and I have already organized them into a grid layout. This is what my code look ...

Ways to switch visibility based on user's selection

Currently, I am working on a project that involves a select form with multiple options. However, I need to display a specific div only when a particular option is selected. Can anyone suggest the best solution for this scenario? Your guidance would be grea ...

Creating a Comprehensive Page Design with Bootstrap and the Latest Version of Vue

My goal is to develop a Single Page Application using Vue3 and the Bootstrap 5 framework with a simple layout of Header -> Content -> Footer. I want the Content section to fill the space between the header and footer, ensuring there is no overlap. Ho ...

(Applied jQuery) Trouble with div height in responsive layout

I have created jQuery full-page sliding panels that work perfectly on desktop devices. However, when the browser window is resized smaller, the panel divs fail to fill the page. If you want to view the issue in action, you can check out the JSFiddle demo ...

Using Bootstrap to handle opening a link when a dropdown menu button is clicked

Utilizing Bootstrap in my main menu was essential for navigating through the numerous pages, subpages, and sub-subpages within my project. The dropdownmenu feature proved to be very helpful in this regard. However, my client now has a specific request - t ...

Struggling to get your function to complete its execution due to asynchronous operations?

The code in the comment block is not functioning properly when placed inside an if statement. It seems that the issue may be related to its position before a return statement, so I am looking for a way to ensure it completes running before the return is c ...

Generate a random 8-digit number with a specific range in JavaScript

I want to generate a random 8-digit number ranging from 0 to 7, excluding the numbers 8 and 9. Here is what I have tried so far, but I'm unable to exclude the numbers 8 and 9: var b = Math.floor(Math.random()*90000000) + 10000000; console.log(b) Is ...