question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unknown error: window[requireName] is not a function

See original GitHub issue

Hey, I am trying to check the title of my second window. Is this a bug, or am I doing something wrong?

let handles = await app.client.windowHandles();
console.log(handles);
/*
{ sessionId: '0d66b5bac77357c36ea41fd298e55854',
  status: 0,
  value:
   [ 'CDwindow-97CD6BD5-C47A-45C1-9A66-7D0FF3B2F9DF',
     'CDwindow-946E9CE7-9A1C-458A-9DE2-00A975ACC5BD' ] }
*/
await app.client.windowByIndex(1);
console.log(await app.client.browserWindow.getTitle());

BTW windowHandles is missing in the readme. Also I saw on stackoverflow that somebody was doing windowByIndex(handles.values[1]) but this also fails for me.

What is also weird is that my second window actually has focus, but app.client.browserWindow.getTitle() will get me the title of the first window. How can I make app.client.browserWindow to point at currently focused window?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
kevinsawickicommented, May 31, 2016

Also, does your app have nodeIntegration enabled in both windows?

0reactions
Stoyko83commented, Mar 26, 2018

[quote]Also, does your app have nodeIntegration enabled in both windows?[/quote]

How can I check about that? Where is this setting defined?

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >
unknown error: document.getBoxObjectFor is not a function ...
This error message... org.openqa.selenium.WebDriverException: unknown error: document.getBoxObjectFor is not a function (Session info: ...
Read more >
unknown error: window.wave_viewIcons is not a function ...
I have automated recent Wave add-on on Firefox and Chromium, but have not managed to publish that. I may not be able to...
Read more >
How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript error TypeError: "x" is not a function occurs when there is an attempt to call a function on a value or...
Read more >
JavaScript: Uncaught TypeError: n is not a function
This error occurs if you try to execute a function that is not initialized or is not initialized correctly. This means that the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found