1 |
What is WebDriverIO? |
A) A programming languageB) A web browserC) A JavaScript testing frameworkD) A database management system |
C) A JavaScript testing framework |
2 |
Which of the following is the correct command to install WebDriverIO using npm? |
A) npm install wdioB) npm install selenium-webdriverC) npm install webdriverioD) npm install webdriver |
C) npm install webdriverio |
3 |
Which programming language is primarily used with WebDriverIO? |
A) PythonB) JavaScriptC) JavaD) Ruby |
B) JavaScript |
4 |
What is the purpose of the wdio.conf.js file? |
A) It is the main test fileB) It is a log fileC) It is the configuration file for WebDriverIO testsD) It is the output file for test results |
C) It is the configuration file for WebDriverIO tests |
5 |
Which command is used to open a URL in WebDriverIO? |
A) browser.goTo()B) browser.open()C) browser.url()D) browser.navigate() |
C) browser.url() |
6 |
Which command is used to select an element by its CSS selector in WebDriverIO? |
A) browser.selectByCss()B) browser.$()C) browser.findElementByCss()D) browser.select() |
B) browser.$() |
7 |
How do you maximize the browser window in WebDriverIO? |
A) browser.maximize()B) browser.maximizeWindow()C) browser.resizeWindow()D) browser.fullScreen() |
B) browser.maximizeWindow() |
8 |
Which command is used to wait for an element to be visible on the page in WebDriverIO? |
A) browser.waitForElementVisible()B) browser.waitUntilVisible()C) browser.waitForVisible()D) browser.waitUntilElementVisible() |
C) browser.waitForVisible() |
9 |
How do you execute JavaScript code in the browser context in WebDriverIO? |
A) browser.executeScript()B) browser.runScript()C) browser.execute()D) browser.runJavaScript() |
A) browser.executeScript() |
10 |
Which command is used to switch to a different frame in WebDriverIO? |
A) browser.switchToFrame()B) browser.frame()C) browser.switchFrame()D) browser.selectFrame() |
C) browser.switchFrame() |
11 |
What is the purpose of the browser.pause() command in WebDriverIO? |
A) To pause the execution of the test script for a specified durationB) To close the browser window
C) To pause the execution until a specific condition is metD) To reload the page |
A) To pause the execution of the test script for a specified duration |
12 |
Which command is used to perform a mouse click on an element in WebDriverIO? |
A) element.click()B) element.mouseClick()C) element.performClick()D) element.mouseClickEvent() |
A) element.click() |
13 |
How do you verify the title of a webpage in WebDriverIO? |
A) browser.getTitle()B) browser.verifyTitle()C) browser.checkTitle()D) browser.assertTitle() |
A) browser.getTitle() |
14 |
Which command is used to perform a double-click action on an element in WebDriverIO? |
A) element.doubleClick()B) element.performDoubleClick()C) element.doubleClickEvent()D) element.doubleTap() |
A) element.doubleClick() |
15 |
Which command is used to get the value of an attribute of an element in WebDriverIO? |
A) element.getAttribute()B) element.getValue()C) element.fetchAttribute()D) element.retrieveValue() |
A) element.getAttribute() |
16 |
What is the purpose of the browser.debug() command in WebDriverIO? |
A) To start a debugging session in the browserB) To output debugging information to the consoleC) To pause the execution of the test script for debugging purposesD) To enable debugging mode in WebDriverIO |
C) To pause the execution of the test script for debugging purposes |
17 |
Which command is used to wait for a specific condition to be met in WebDriverIO? |
A) browser.waitForCondition()B) browser.waitUntil()C) browser.waitFor()D) browser.waitCondition() |
B) browser.waitUntil() |
18 |
What does the browser.end() command do in WebDriverIO? |
A) Terminates the WebDriver sessionB) Closes the browser windowC) Ends the test script executionD) Resets the browser to its initial state |
A) Terminates the WebDriver session |
19 |
Which command is used to perform a drag-and-drop action in WebDriverIO? |
A) element.dragAndDropTo()B) element.dragAndDrop()C) element.performDragAndDrop()D) element.dragAndDropBy() |
D) element.dragAndDropBy() |
20 |
Which command is used to perform a swipe action on a mobile device in WebDriverIO? |
A) browser.swipe()B) browser.performSwipe()C) browser.mobileSwipe()D) browser.touchAction() |
D) browser.touchAction() |
21 |
How do you handle frames in WebDriverIO? |
A) Using the browser.switchToFrame() commandB) Using the browser.frame() commandC) Using the browser.selectFrame() commandD) All of the above |
D) All of the above |
22 |
Which command is used to get the number of elements matching a selector in WebDriverIO? |
A) browser.getElementsCount()B) browser.elementCount()C) browser.getCount()D) browser.elements() |
D) browser.elements() |
23 |
What does the browser.pause() command do in WebDriverIO? |
A) Pauses the execution of the test script for a specified durationB) Closes the browser windowC) Pauses the execution until a specific condition is metD) Reloads the page |
A) Pauses the execution of the test script for a specified duration |
24 |
Which command is used to set the value of an input field in WebDriverIO? |
A) element.setValue()B) element.setValueField()C) element.inputValue()D) element.enterValue() |
A) element.setValue() |
25 |
How do you perform assertions in WebDriverIO? |
A) Using the assert libraryB) Using the expect libraryC) Using the should libraryD) All of the above |
D) All of the above |
26 |
Which command is used to select an option from a dropdown menu in WebDriverIO? |
A) element.selectOption()B) element.chooseOption()C) element.pickOption()D) element.select() |
A) element.selectOption() |
27 |
What is the wdio.conf.js file in WebDriverIO? |
A) Main test script fileB) Configuration file for WebDriverIO testsC) Output file for test resultsD) Log file |
B) Configuration file for WebDriverIO tests |
28 |
Which command is used to generate a wdio.conf.js file? |
A) wdio generateB) wdio configC) wdio createD) wdio init |
B) wdio config |
29 |
What is the purpose of the specs property in wdio.conf.js? |
A) To specify the testing framework to be usedB) To define the test files or specs to runC) To specify the capabilities of the WebDriver instancesD) To define the reporters for test results |
B) To define the test files or specs to run |
30 |
How can you specify multiple spec files to run in the wdio.conf.js file? |
A) Separate each spec file with a commaB) Use an array of spec file pathsC) Use a wildcard (*) to match all spec filesD) Specify each spec file path on a new line |
B) Use an array of spec file paths |
31 |
Which property in wdio.conf.js is used to specify the capabilities of the WebDriver instances? |
A) capabilitiesB) specsC) servicesD) reporters |
A) capabilities |
32 |
What does the services property in wdio.conf.js define? |
A) The list of reporters for test resultsB) The testing framework to be usedC) The capabilities of the WebDriver instancesD) Additional services or utilities to use during testing |
D) Additional services or utilities to use during testing |
33 |
Which property in wdio.conf.js is used to specify the base URL for tests? |
A) baseUrlB) specsC) capabilitiesD) services |
A) baseUrl |
34 |
What is the purpose of the before and after hooks in wdio.conf.js? |
A) To execute code before and after each test suiteB) To define the capabilities of the WebDriver instancesC) To specify the test files or specs to runD) To define the reporters for test results |
A) To execute code before and after each test suite |
35 |
Which command is used to run tests using the wdio.conf.js configuration file? |
A) wdio runB) wdio startC) wdio executeD) wdio launch |
A) wdio run |
36 |
What is the purpose of the maxInstances property in wdio.conf.js? |
A) To specify the maximum number of test files to run concurrentlyB) To define the capabilities of the WebDriver instancesC) To specify the maximum number of browser instances to run concurrentlyD) To define the reporters for test results |
C) To specify the maximum number of browser instances to run concurrently |
37 |
How can you configure timeouts for WebDriverIO tests in wdio.conf.js? |
A) Using the timeout propertyB) Using the timeouts propertyC) Using the jasmineNodeOpts propertyD) Using the mochaOpts property |
B) Using the timeouts property |
38 |
What is the purpose of the framework property in wdio.conf.js? |
A) To define the testing framework to be usedB) To specify the capabilities of the WebDriver instancesC) To define the reporters for test resultsD) To specify the base URL for tests |
A) To define the testing framework to be used |
39 |
Which property in wdio.conf.js is used to specify the directory where test files are located? |
A) specsB) frameworkC) suitesD) specs |
A) specs |
40 |
How do you specify the test runner for WebDriverIO tests in wdio.conf.js? |
A) By setting the runner property to the desired test runnerB) By specifying the test runner as a service in the services propertyC) By setting the testRunner property to the desired test runnerD) WebDriverIO supports only one test runner |
B) By specifying the test runner as a service in the services property |
41 |
What is the purpose of the mochaOpts property in wdio.conf.js? |
A) To define options for the Mocha test frameworkB) To specify the capabilities of the WebDriver instancesC) To define the reporters for test resultsD) To specify the base URL for tests |
A) To define options for the Mocha test framework |
42 |
How do you specify custom reporters for test results in wdio.conf.js? |
A) By setting the reporters property to an array of reporter namesB) By setting the reporterOptions property to an array of reporter optionsC) By specifying the reporters as services in the services propertyD) By setting the customReporters property to an array of reporter objects |
A) By setting the reporters property to an array of reporter names |
43 |
What is the purpose of the jasmineNodeOpts property in wdio.conf.js? |
A) To define options for the Jasmine test frameworkB) To specify the capabilities of the WebDriver instancesC) To define the reporters for test resultsD) To specify the base URL for tests |
A) To define options for the Jasmine test framework |
44 |
Which property in wdio.conf.js is used to specify the directory where log files are stored? |
A) logDirB) outputDirC) logPathD) reporterOutputDir |
B) outputDir |
45 |
How can you specify custom commands or helpers in wdio.conf.js? |
A) By setting the customCommands property to an array of command namesB) By specifying the commands as services in the services propertyC) By setting the helpers property to an array of helper namesD) WebDriverIO does not support custom commands or helpers |
B) By specifying the commands as services in the services property |
46 |
What is the purpose of the beforeSession and afterSession hooks in wdio.conf.js? |
A) To execute code before and after each test suiteB) To define the capabilities of the WebDriver instancesC) To execute code before and after each WebDriver sessionD) To define the reporters for test results |
C) To execute code before and after each WebDriver session |
47 |
How do you specify browser-specific options in wdio.conf.js? |
A) By setting the browserOptions property to an array of browser optionsB) By specifying browser options as services in the services propertyC) By setting the capabilities property to an array of browser capabilitiesD) By setting the browserArgs property to an array of browser arguments |
C) By setting the capabilities property to an array of browser capabilities |
48 |
What is the purpose of the exclude property in wdio.conf.js? |
A) To exclude certain test files or specs from executionB) To specify the capabilities of the WebDriver instancesC) To define the reporters for test resultsD) To exclude certain services from execution |
A) To exclude certain test files or specs from execution |
49 |
How do you specify environment-specific configurations in wdio.conf.js? |
A) By setting the env property to an array of environment configurationsB) By specifying environment configurations as services in the services propertyC) By setting the config property to an array of environment configurationsD) By setting the capabilities property to an array of environment capabilities |
C) By setting the config property to an array of environment configurations |
50 |
How can you specify global variables or functions for tests in wdio.conf.js? |
A) By setting the globals property to an object containing variables or functionsB) By specifying global variables or functions as services in the services propertyC) By setting the config property to an object containing variables or functionsD) WebDriverIO does not support global variables or functions for tests |
A) By setting the globals property to an object containing variables or functions |
51 |
What is the purpose of the retry property in wdio.conf.js? |
A) To specify the number of retries for failed testsB) To define the capabilities of the WebDriver instancesC) To define the reporters for test resultsD) To specify the retry strategy for failed tests |
A) To specify the number of retries for failed tests |
52 |
What is the purpose of the suite property in wdio.conf.js? |
A) To specify the testing framework to be usedB) To define the test files or specs to runC) To define the capabilities of the WebDriver instancesD) To define test suites for grouping tests |
D) To define test suites for grouping tests |