Selenium MCQs
Selenium MCQs
Selenium MCQs
or a variable in Selenium IDE. command command The 'print' command The 'printr' command
Select the command which is used to compare the
contents of a table with expected values. verifyTables verifyTableData verifyTable verifyTableCell
Select the command that will NOT wait for a new page to
load before moving onto the next command. clickAndWait selectAndType typeAndWait selectAndWait
Select the command which is NOT used in verifying page verifyElementPre verifyElementRig verifyElementNotPre verifyElementPosition
elements sent ht sent Left
Select the variation which finds elements based on the
driver's underlying CSS selector engine in Web driver
Selenium. By.cssSelected By.cssSelection By.cssSelector By.Selectcs
Select the variation which locates elements by the value
of their "id" attribute in Web Driver Selenium By.id By.idno By.id_no By.tag_id
Method which selects the option which displays the text selectVisibleText( selectByVisibleTe
matching the parameter passed to it ) xt() select_VisibleText() select_ByVisibleText()
waitForTextPrese
Out of the following which is NOT a wait command. waitForTitle nt waitForActive waitForAlert
Which option is given to selenium server for diagnostics debug step diagnose None of the above
What is the unit of movementsString argument in
dragAndDrop selenium action Inches Pixels cm percentage
What is the option given to selenium server during
startup for loading JavaScript file Load Extensions userExtensions loadFile
Which prototype need to be extended to create our own
function to locate an element LocateBot SearchBot PageBot WebPageBot
HTML Unit Driver is Graphical so we can watch whats
happening in the screen TRUE FALSE
Test cant be executed against emulators and real devices
for Iphone and Android OS. TRUE FALSE
Void Close Quits this driver ,closing every associated
window TRUE FALSE
Which selects either the first frame on the page or the window(java.lang.Str
main document when a page contains frames alert() default Content() ing nameOrHandle) to(java.lang.String url)
KeyBoard Simulations can be done with the help of? KEYS Sendkeys gettext getattribute
which is triggered from the application can be handled
by Assertion activation Abort Alert
Which is a commercial package allowing native calls from
javacode Shelltraywnd Windowactive Jinvoke Windowname
The selenium is
selectByIndex() selectIndex() selectedByIndex() selectedByIndexes()
Select the method which selects the option at the given index
Assert Verify WaitFor Wait
Select the command which is not a type of assertion in Selenium IDE
Element Title Page Title Block Title Title of Element
What does the assertTitle checks
Can Unix operating system is supported by Selenium IDE TRUE FALSE
display command echo command print command printer command
Select the command which is used to print a string value or a variable in selenium IDE
are commands that directly are commands that allow you to store are commands that verify if a are commands that allow you to
interact with page elements values to variables certain condition is met print values of the variables
The Action commands
sendskeys() sendkey() sendkeys() sendskey()
Which commands can be used to enter values onto text boxes?
verifyTables verifyTableData verifyTable verifyTableCell
Select the command which is used to compare the contents of a table with expected values
Selenium Grid Selenium IDE Selenium RC Selenium Webdriver
Which component is used to run multiple tests simultaneously in different browsers and
platforms?
Select the Get command which fetches the inner text of the element that you specify in wed getInnerText() getText() getTextelement() getElementText()
driver
driver().manage().maximize() driver().manage().window().maximize() driver().window().maximize() manage().window().maximize()
In selenium, parent and child nodes are in same query because HTML has a tree structure. TRUE FALSE
Which process use the JavaScript to find an element? By DOM query BY XPath query BY CSS sector - All of these
Does Selenium supports Data Driven Framework ? TRUE FALSE
The annotation ______ identifies that a method is a test method. @Before @Test @Ignore @After
Which selenium command check whether specific text exists somewhere on the page? verifyTextPresent verifyPresentText None of these CheckTextPresent
Selenium variables are stored in _____________. VariablesStore storedVariables storedVars None of the above
The term AJAX expands to___________ Asynchronous java and XML Asynchronous javascript and XML Accumulated java and XML None of the above
What is called that scale for large test suites or test suites that must be run in multiple
environments? Selenium Grid Selenium IDE selenium web driver selenium RC
Can google chrome is supported by Selenium IDE TRUE FALSE
Select the command in Selenium IDE used to open a page using the URL OpenURL Open openText OpenRecord
Which component of selenium can create customized test results Selenium WebDriver Selenium IDE Selenium RC Selenium Grid
Select the command which is used to pause execution until the specified elements became
active waitForElementPresent waitForPagepresent waitForFieldPresent wait
css=tag:attributes("inner
Select the syntax to locate an element using inner text css=tag:contains("inner text") css=tag:value("inner text") text") css=tag:class("inner text")
Select the tab which gives feedback and other useful information when executing tests Information Feedback Reference Elements
Select the tab that shows selenium IDE command is currently executing VariablesStore Data Information info
Select the command which retrieves the alert messages and stores it in a variable that you will
specify store Alert storedAlert storesAlert stores.Alert
Advanced
User
Which allows the user to do things like dragging and dropping as well as gives us the ability to Interactio
do something like hold down a key and move the mouse around or carry on typing, Hub API ns API Java API
Advanced User Interactions API works only on MAC Unix Linux Windows
User
Registratio Page
Which are representation of web Objects Page Objects n Elements Page nodes
Waits are not used While navigating from one page to another? TRUE FALSE
The default wait for an implicit wait is not zero TRUE FALSE
A pure
JAVA
solution
and so it is Fastest
platform implement
independe Supports ation of
Benefits of HTMLUnit Driver Supports POI nt Javascript WebDriver
Confirmatio
What are the types of alerts Simple n Accept Prompt
The methods used by alert interface are accept() dismiss() gettext() sendkeys()
changeFocus() is the WebDriver method is used to change focus to an alert, a frame or a
browser window? TRUE FALSE
Consider the following code
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.presenceOfElementLocated(by));
This is an example of an implicit wait. TRUE FALSE
Selenium Selenium Selenium
Select the component which is NOT a part of selenium suite Selenium IDE
RC Grid Web
To deploy
the test
across To test
To create To test
multiple webapplica
Selenium IDE can be used customized test HTMLUni
environme tions in
results t
nts using firefox only
selenium
grid
Verifyprese None of checktextpr
Specify the selenium command which checks specific text exists somewhere on the page Verifytext present
nttext these esent
Only
Only
keyword
Does selenium support Datadriven framework Yes Modular No
driven
Framework
framework
Which will execute method before each test @after @before @test @afterclass
character
String in Java is a? class object variable
array
Which of these method of String class is used to obtain character at specified index? char() Charat() charAt() charat()
None of
Which of these keywords is used to refer to member of base class from a sub class? upper super base
these
Which of these method of String class can be used to test to strings for equality? isequal() isequals() equal() equals()
The start of Xpath instructs XPath engine to look for element starting from Rootnode Anywhere Directory File
A double slash at the start of Xpath instructs XPath engine to search look for matching
TRUE FALSE
element at Rootnode in the XML document.
It needs to stop at The path
This is All of the
The // tells the query that the first element of the file
comment above
that it finds or folder
Working
Working
Applications do not have the items needed for the tests when the tests get to commands. To with All of the
Debugging test with AJAX
get around this, we had a look at adding from waitFor commands to test. This is related to multiple above
application
windows
wait for None of
Which is a procedure? wait exit
property these
The first
The first
paramete
parameter
r is where
The first parameter is where it
it was
is the name of the was
used, and
cookie, and the created, None of
To delete a cookie we need to call the deleteCookie method, passing in two parameters. the
second parameter is and the these
second
where it was second
paramete
created. parameter
r is where
is the name
it was
of cookie.
created
//div[contains(@id,'
//div[par
time_') //div[contai //div[para
If you wanted to access the element that has the text "This element has an ID that changes ameter(
ns(@id_tim meter(@id,
every time the page is loaded" in it, then which of the following is used? @id_time
e()) ’time_’)
())
titleConta
titles(java.l ins(java.lo
The Expected conditions class contains the set of predefined conditions to be used with elementToBeClickab ong.String ng.String textPresent
webdriver wait are ______________ le(By Locator) titles) titles) (By locator)
ElementToBeClickable(By Locator) is an expected wait condition to check that only radio
buttons are visible to be clicked TRUE FALSE
textToBePresentInElement (By Locator,java.long.String text) An Expectation for checking if
the given text is present in the specified element. TRUE FALSE
WebDriverWait by default calls the ExpectedCondition every ________ milliseconds until it
returns successfully 1000 100 10 500
Data driven testing, which allows you to automatically run a test case multiple times with
different input and validation values,is not possible with selenium webdriver TRUE FALSE
Sheet sh
Sheet sh = =
Sheet sh = wb.getShee wb.getSh None of
How to get the access to the sheet 1 in a particular workbook in excel wb.getSheet(1) t() eet(0) the above
getMessag
________method returns a text message describing the exception name and description printStackTrace() e() toText() toString()
Using wrapper methods we can make error handling more generic in Selenium webdriver TRUE FALSE
If we use Wrapper classes in Selenium webdriver, it increases the lines of codes and a lot of
unnecessary codes
TRUE FALSE
Exception Handling Wrapper
We can increase the code reusability in selenium webdriver using _______classes Class String Class Class All of the above
None of
_________ is a block which executes whether exception raises or not Catch block Try block
Finally block the above
User defined exceptions need to be extended by Runtime Exception in our classes for
selenium webdriver. TRUE FALSE
Which driver is used to run Html unit Phantom Both b &
Firefox driver Webdriver
scripts in the background. driver js driver c
HTML
Parrllel report Test case All the
Advantage of Testng Grouping Test cases
testing generatio priorty above
n
Tests Test
Test data
Test driven data directory
What is TDD devlopmen
devlopment devlopme devlopmen
t
nt t
Doublecli Clickandhol All the
What are the mouse movements in action class Release Click
ck d above
What is the jar required for excel (xlsx) XSSF HSSF XSFF FSXF
Keybotto
What are the keyboard events in action class Keyup KeyDown A&B B&C
m
To perform keyboard and mouse actions. Actions should end with build().perform() perform() build() Relase()
getLastRo
Which method is used to get lastrow number getLastrow() getrow() getnum()
wNum()
Before Before All THE
Which of the following are annotations in Testng Before class After test
suite test above
Low cost
Maximum Easy All THE
Advantage of Automation framework Reusability of code maintena
coverage reporting above
nce
Invocatio Multiple
Which is the attribute to run script multiple times IN Testng Count Run count
n Count count
How Many times @Before suite will be executed One Two Three Four
For handling Excel what jar is used Apache poi Jxl A and B none
s.getOption s.getOpti s.getOption
How will you select the last option in the dropdown s.getOptions();
(); ons; ;
Select by
Select by All the
How will you select dropdown value Select by Value Visible
index above
Text
Dependso Execution
If I want to run the 3rd @Test first, how to achieve that use @ Priority Dependson
ngroups order
methods
Callable
Prepared All the
which is the jdbc statements Statement statemen
statement above
t
Grid is used to achieve remote execution. TRUE FALSE