Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

194
Vistas
Frente al error TypeError: no se puede leer la propiedad 'script' de undefined

Estoy aprendiendo Nightwatch. Cuando ejecuto lo siguiente, me encuentro con un error. Quiero editar mi archivo script.js para corregir el error, pero no estoy seguro de qué hacer. Dónde está mi archivo test.js

 module.exports = { 'Login': function (client) { client.page.script() .launchapp() .collection() .Checkdata() .notravel() .avail() }, };

Y mi archivo script.js es

 const commands = { launchapp: function () { return this.init() }, collection: function () { return this.click('@city') .waitForElementPresent('@cityInput') .setValue('@cityInput', 'hyd') .waitForElementPresent('@firstOption') .click('@firstOption') }, Checkdata: function () { return this.waitForElementPresent('@checkin') .click('@checkin') .useXpath() .waitForElementPresent(`(//table[@class=' table-condensed']//tbody//tr//td[text()='2'])[1]`) .click(`(//table[@class=' table-condensed']//tbody//tr//td[text()='4'])[1]`) .useXpath() .click("//span[text()='Checkout']") .click("//input[@name='checkout']") .waitForElementPresent(`(//table[@class=' table-condensed']//tbody//tr//td[text()='3'])[2]`) .click(`(//table[@class=' table-condensed']//tbody//tr//td[text()='6'])[2]`) .click(`(//label[text()='Travellers']/parent::div/div/div/a)[1]`) }, notravel: function () { // some code goes here return this; }, avail: function () { // some code goes here return this.useXpath().click(`(//button[@id='submit']//span[text()=' Search'])[1]`) }, } module.exports = { commands: [commands], elements: { city: '#select2-hotels_city-container', cityInput: "input[aria-controls='select2-hotels_city-results']", firstOption: "#select2-hotels_city-results li", checkin: '#checkin', checkOut: "#checkout" }, }

Cuando estoy ejecutando esto, me encuentro con el error "No se puede leer la propiedad 'script' indefinida" o "No se puede leer la propiedad 'página' indefinida"

Amablemente ayúdame en esto.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda