Selenium Basics UPDATED

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 27

Code:

Selenium basics:

Ans: b.

Ans: b.

Ans: driver.quit()
Ans: Explicit wait

Ans: c.

Ans: a.

+
Ans: d.

Firefox Driver is capable of being run and is tested on Windows, Mac, Linux.

Ans: b.

Ans: all of the listed


Ans: c.

Ans: a.

Ans: b
Ans: b.

Ans: a.

------

Ans: a & b.
Ans: implicit

Ans: c

Ans: a)

Ans: b.
Ans: c

Ans: Selenium Grid

Ans: All options

Ans: a.
Ans: a.

Ans: c.

Ans: driver.quit()

Ans: a.
Ans: a.

if (driver instanceof JavascriptExecutor) {

((JavascriptExecutor) driver)

.executeScript("alert('hello world');");

Ans: b.

// Get a handle to the open alert, prompt or confirmation


Alert alert = driver.switchTo().alert();

Ans: a.

An implicit wait is to tell WebDriver to poll the DOM for a certain amount of time
when trying to find an element or elements if they are not immediately available.
The default setting is 0. Once set, the implicit wait is set for the life of the
WebDriver object instance.

Ans: d.

int
rowCount=driver.findElements(By.xpath("//table[@id='DataTable']/tbody/tr")).size();

Ans: d.

Ans: b

dropdown.selectByValue("prog");
Ans: b.

Ans: c. & d.

Ans: b

Ans: a
Ans: a.

Ans: d.

Ans: a
Ans: d

Ans: d.

Ans:b.
Ans: a.

Ans: b.

Ans: b
Ans: b

Ans: b & d

Ans: c.
Ans: d.

Ans: d.

Ans: a.

Ans: a, UI wait- implicit wait


Ans: c.

Ans: d.

Ans: c.

Ans: b.
Ans: d.

Ans: c.

Ans: b and d
Ans: a.

Ans: unknown.b

A script requires that you open the home page url, right click on a link and choose a context menu
item in New tab.Which method will be useful for this operation?

Ans: All of the above(Correct)

While building a JAR. What is/are the roles of the manifest file?
Ans: c.

Ans: unknown(d)

A java protected method needs to be tested. It can only be accessed within the same package where
the class is defined. How would a user test this method?

Ans: a. (not sure)(correct)

https://courses.cs.washington.edu/courses/cse143/15wi/eclipse_tutorial/customize_view.shtml

While using eclipse, there is need to customize the layout of the workflow. How do you achieve that?
Ans: d. (not sure) (a) throw statement

http://www.pearsonitcertification.com/articles/article.aspx?p=98149&seqNum=5

You are creating an order-tracking application using a Visual C#.NET Windows application.When you
are unable to track a particular order number entered by the user,you need to raise an
exception.Which of the following options will help to raise an exception?

Ans: d. (not sure) guess c

Download to excel functionality involves checking the invoice date column in the downloaded excel
file during regression testing.Which method will you use to extract and test the data?
Ans: unknown(b)

You are designing a windows form that adds a new product to the product catalog of your
company.You need to validate the controls as the user enters the data. If incorrect data is entered in
the filed,you should set the focus back to the cotrol and ask the user to enter the correct data.Which
of the following events would you use to validate the user input?

Ans: d. (not sure)(b) Extend exception class

http://www.java2novice.com/java_exception_handling_examples/create_custom_exception/

There is a code block in Java in which you need to create your own exceotion class.Which of the
following indicates the action that you would take to achieve this?

Ans: c. (not sure)


You are a tester working on an application that would released to a LINUX envinorment.Which
browser driver would you avoid to co de the automation scripts in the selenium webdriver?

Ans: a. (not sure) Correct

What is the method to simulate the right click event on an element in the application under test using
C#.Net implentation?

Ans: b.

Ans: a & d (not sure)(a,b,d)

http://www.indiaparinam.com/c-sharp-programming-language-question-answer-properties

If there is a sample class that has a length property with get and set accessors, then which of the
following statement(s) will work correctly?
Ans: unknown(a,d)

What are the different creational patterns in the object oriented design?

Ans: unknown

The client environment has multiple operating system implementations and regression testing has to
be done on all of them.What tool would you use for this scenario?

Ans: unknown

You are building a software for HR domain and there is a requirement for generating excel
reports,usully across managements levels.apart from reports,the input data for the appllication comes
in excel sheet format and the application needs to support this format.Select an option from the open
source APIs listed to handle such scenarios.

Ans: unknown

Ans: unknown

In eclipse customizations,the indexer not correctly recognize constants defined in the inckuded
files.Which of the following options help the eclipse customizantions to function properly?

Ans: b.

Additional Q’s:
1. "storeText" command in selenium IDE software testing tool is useful to
store text value of page element of software web application in to variable
for future use.
2. The default port the hub uses to listen for new requests is port 4444.
3. Reg ex * qualifier, 0 or more of the preceding character (or group)

Additional notes:
Pattern Match
. any single character
[] character class: any single character that appears inside the brackets
* quantifier: 0 or more of the preceding character (or group)
+ quantifier: 1 or more of the preceding character (or group)
? quantifier: 0 or 1 of the preceding character (or group)
{1,5} quantifier: 1 through 5 of the preceding character (or group)
| alternation: the character/group on the left or the character/group on the right
() grouping: often used with alternation and/or quantifier

4. What is Selenium IDE?


Selenium IDE is a Firefox add-on that records clicks, typing, and other actions to make a
test cases, which QA Tester can play back in the Firefox browser or export to Selenium
RC. Selenium IDE has the following features: record/play feature, debugging with step-
by-step and breakpoints, page abstraction functionality, an extensibility capability
allowing the use of add-ons or user extensions that expand the functionality of Selenium
IDE
5. css=<HTML tag><. Or #><value of Class or ID attribute><[attribute=Value of
attribute]>
Two or more attributes can also be furnished in the syntax. For
example, “css=input#Passwd[type=’password’][name=’Passwd’]”.
6.

You might also like