Nightwatch Respuestas

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 5
At a glance
Powered by AI
The key takeaways are about different types of scripting, Nightwatch commands, and resolving bugs in Nightwatch labs.

The different types of scripting discussed are client side scripting (HTML, JavaScript, CSS) and server side scripting (Ruby on Rails).

Some Nightwatch commands discussed are .init(), .getAttribute(), .saveScreenshot(), .getLocationInView(), .containsText().

Which of the following is client side scripting?

HTML
JavaScript
NodeJs
CSS
Ruby on Rails
--1,2,4

Which of the following is Server side scripting?

HTML
JavaScript
NodeJs
CSS
Ruby on Rails
--MALA 2,3,4,5
-- Mala 1,2,4
debe ser 3,5

npm stands for


--
Node package manager

Node is ___________.
--Server-side scripting

Which of these syntax is correct for relative xpath?+


--Mala //*[@google='text']
//input[@value='text']

Node is written in ___________.


--JavaScript

pug is ______________ for node.js.


--middleman and template engine

-g in the command for installation is used for __________.


--global installation

___________ is the command to create node express-generator.


--npm install express-generator

For chrome, we need to define chrome driver location at ___________.


--cli_args

Test folder detail will be defined in ___________.


--src_folder

Nightwatch script directly reaches to Selenium server for execution.


--False

Nightwatch configuration should be in ___________.


(Mala)JSON formate
(Mala)conf.js formate
--can be in both
Default browsers for the execution is always __________.
--need to define the default browser

Module in module.export is __________.


--an variable

What is command to run the script?


--npm run nightwatch

export in module.export is __________.


-- an object

this in defining function stands for ____________.


an object

Where is run command defined in package.json?


-- Scripts

Xpath syntax is ________________.


--//Tagname[@attributename=‘value’]

Which of these syntax is correct for absolute xpath?


--/html/body/div/input

Xpath stands for ________________.


--XML Path

Which of these syntax is correct for multi type xpath?


--//*[@attribute='value'][@attribute1='value1']

It is used for selecting all the nodes or attributes that come ___________ the
current node or attributes.
--before

Which of these syntax is correct for following xpath?


--//*[@attribute='value']//following::value

Which of these syntax is correct for ancestor xpath?


--//*[@attribute='value']//ancestor::value (en el final la respuesta esta sin un /)

In CSS selector we call child attribute as ___________.


--div li:nth-of-type(1)

In CSS selector class is called as ___________.


--.class

In CSS selector id value is called as ___________.


--#id

In CSS selector // is removed by ___________.


-- whitespace

$= in css used for ___________.


--end with

*= in css used for ___________.


--sub String

^= in css used for ___________.


--starts with

In CSS selector / is removed by ___________.


-- >

How to called the element is main script?


-- @elementName

page object folder should be defined in ___________.


--Page-objects_path

How to switch from xpath to css selector?


--.useCss

Page object script should be defined in ___________.


--All these options are true.

How to switch from css selector to xpath?


--.useXpath

Which of the syntax is correct for defining JSON?


--
{
"value1" : "text",
"value2" : "text2"
}

How to define inline variable?


--both the options are correct

How to call the json file in script?


--Using require

How to read the data from JSON file?


--.setValue('xpath','dataVar.userName')

___________ command pauses the execution till the text or value is not visible.
--.waitForElementVisible()

To stop execution or close browser we use ________ command.


--.end()

___________ command verifies the value of the attribute.


--.attributeText()

___________ command captures the screenshot.


--.saveScreenshot()

___________ scrolls to a specific element.


--.getLocationInView()

___________ command verifies the specific value.


--.containsText()

To start or launch browser, we use ________ command.


--.init()

Complete path is also known as ___________.


--absolute xpath
All the drivers are stored in _______ folder.
--By default it should be in bin (Mala)
--By default it should be in lib (Mala)
--you can store in any folder and call the path

Which of these syntax is correct for contains xpath?


--//*[contains(@attribute,'value')]

Our run command is defined in package.json under __________.


--Scripts

What is command to check the node running status?


--DEBUG=myapp:* npm start

Which of the following is client side scripting?


-- Ans: 1,2,4
1.HTML 2.JavaScript3.NodeJs4.CSS5.Ruby on Rails

- Which of these syntax is correct for starts-with xpath “valueX123e234”?


//*[starts-with(@attribute, ‘value’)]

Self is used for ________ node.


--No es Followed by ni previuos

- In CSS, selector class is called as __________.


.class

Nightwatch configuration should be in ___________.


-- can be both

----------------- Labs ---------------------


Los labs del 1 al 6 y del 8 al 10 tienen un bug, y se solociunan de la siguiente
forma
solucionar el primer estep
ingresar el comando (ls)
ingresar el comando cd nightwatchSetup ls
Ingresar el comando npm install
Ingresar el comando cd tests
Click en continuar, cuando pase al step2, se devuelven al 1 y precionan repetidas
veces
la flecha que los lleva al estep 2, el bug pasara el lab completo.

------lab 7---------
ingresar el comando (ls)
ingresar el comando cd nightwatchSetup ls
ingresar el comando mkdir pages
Ingresar el comando npm install
Ingresar el comando cd tests

-------lab 11--------
ingresar el comando (ls)
ingresar el comando cd nightwatchSetup ls
ingresar el comando vi package.json
en la linea donde dice ("e2e-test":"nightwatch") modifique por: "e2e-
test":"nightwatch --skipgroup firstScript"
Presionar ctrl + c
Ila instruccion :wq
Ingresar el comando npm install
Ingresar el comando cd tests
Click en continuar, cuando pase al step2, se devuelven al 1 y precionan repetidas
veces
la flecha que los lleva al estep 2, el bug pasara el lab completo.

------ lab Mocha (12)-----


ingresar el comando (ls)
ingresar el comando cd nightwatchSetup ls
ingresar el comando npm install mocha --save
Ingresar el comando cd tests
Click en continuar, cuando pase al step2, se devuelven al 1 y precionan repetidas
veces
la flecha que los lleva al estep 2, el bug pasara el lab completo.

You might also like