nuxt.renderAndGetWindow(url, options)
Get the window from a given URL of a Nuxt Application.
- 
Type: 
Function - 
Argument: 
String- 
String: URL to render - 
Optional, 
Object: options 
- 
virtualConsole: 
Boolean(default:true) 
 - 
 - 
Returns: 
Promise- 
Returns: 
window 
 - 
Returns: 
 
This method is made for test purposes.
To use this function, you have to install jsdom:
npm install --save-dev jsdom
 Example:
const { loadNuxt } = require('nuxt')
async function init() {
  // Assuming you've already built your project
  const nuxt = await loadNuxt({ for: 'start' })
  await nuxt.listen(3000)
  const window = await nuxt.renderAndGetWindow('http://localhost:3000')
  // Display the head `<title>`
  console.log(window.document.title)
  nuxt.close()
}
init()
 What's next
Check out the the Components Glossary book 
 
        Edit this page on GitHub
        
      Updated at Tue, Mar 11, 2025
    
 
 
        Sébastien Chopin
       
 
        Nazaré da Piedade
       
 
        Nobu
       
 
        川音리오
       
 
        Maciek Palmowski
       
 
        Nestor Vera
       
 
        Daniel Roe
       
 
        Yue Yang
       
 
        Jeronimas
       
 
        Alessandro Carrano
       
 
        Clément Ollivier
       
 
        Alexander Lichter
       
 
        N3-rd
       
 
        Adrien Zaganelli
       
 
        Mag
       
 
        Stefan Huber
       
 
        Olga Bulat
       
 
        Paiva
       
 
        Florian Reuschel
       
 
        Savas Vedova
       
 
        Steven
       
 
        Vinícius Alves
       
 
        Kareem Dabbeet
       
 
        Valentín Costa
       
 
        Ryan Skinner
       
 
        Alex Hirzel
       
 
        Ajeet Chaulagain
       
 
        René Eschke
       
 
        Nico Devs
       
 
        Muhammad
       
 
        Naoki Hamada
       
 
        Tom
       
 
        Yann Aufray
       
 
        Anthony Chu
       
 
        Nuzhat Minhaz
       
 
        Lucas Portet
       
 
        Richard Schloss
       
 
        Bobby
       
 
        bpy
       
 
        Antony Konstantinidis
       
 
        Hibariya
       
 
        Jose Seabra
       
 
        Eze
       
 
        Florian Lefebvre
       
 
        Lucas Recoaro
       
 
        Julien SEIXAS