Selenium

  Home  Software Testing  Selenium


“Selenium frequently Asked Questions by expert members with experience in Selenium. These questions and answers will help you strengthen your technical skills, prepare for the new job test and quickly revise the concepts”



66 Selenium Questions And Answers

62⟩ Tell me what are the basic annotations used to run TestNG tests in Selenium?

The basic annotations used to run TestNG tests in Selenium RC:

1. @BeforeClass: The annotated method with @BeforeClass will be run

before the first test method in the current class is invoked.

2. @AfterClass: The annotated method with @AfterClass will be run after

all the test methods in the current class have been run.

3. @BeforeMethod: The annotated method with @BeforeMethod will be run

before each test method.

4. @AfterMethod: The annotated method with @AfterMethod will be run

after each test method.

5. @Test: Marks a class or a method @Test with as part of the test.

 170 views

63⟩ Explain what is the difference between Thread.Sleep() and Selenium.setSpeed()?

Selenium.setSpeed:

1. takes a single argument in string format

ex: selenium.setSpeed("2000") - will wait for 2 seconds

2. Runs each command in after setSpeed delay by the number of

milliseconds mentioned in setSpeed.

Thread.sleep:

1. takes a single argument in integer format

ex: thread.sleep(2000) - will wait for 2 seconds

2. Waits for only once at the command given at sleep.

 199 views

64⟩ Explain how to configure Selenium RC with eclipse to run Junit Tests?

1) Download eclipse. click here to download the software

2) Open eclipse -> Workspace Launcher window will open

3) Create a workspace by giving meaningful name

3) Click on Workbench

4) Create a project of type java

5) Create a package under src folder of the package

6) Add Junit to the build path

7) Add selenium rc java client driver to the build path

8) Now drag and drop your test script (.which is exported from Selenium

IDE) to the package created.

 210 views

65⟩ Do you know actual end user simulation, Is the test conducted using this toolequivalent to an end user action?

Selenium performs actions in the background on the browser. It modifies

the DOM structure of the HTML page in order to perform actions on the

page. To be more precise it executes JavaScript on UI objects within the

webpage to perform actions like click, type, select etc. This is the

reason why you can execute tests with the browser minimized.

QTP claims to perform end user simulation, in other words executing QTP

scripts are equivalent to a person performing those steps manually on

the application.

 216 views