Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to open a popup before running my tests and after completing my test run. I want to give few inputs from the popup on basis of that my test will run.

Suppose I have multiple links on which my project is present to test. I want to select the link from popup and then my test cases should run on that selected link.

I have made an html file which have all fields necessary for me. I am trying to open that file in a popup before selenium start running my tests.

Can anyone suggest how to achieve this? I am using Selenium webdriver with Testng.

share|improve this question
What programming language? What xUnit framework? – Twaldigas Jul 1 '14 at 13:03
I am using java and Testng framework. – Ashwani Raj Jul 1 '14 at 13:15
Sorry, but I do not know a framework named "Testing" and when I google for it, I can not find it. Do you have a link for me? – Twaldigas Jul 1 '14 at 14:06
He says he is using TestNG not testing, you can find the website here: – Niels van Reijmersdal Jul 1 '14 at 15:57
hey @Niels any kind of suggestion is highly appreciated. – Ashwani Raj Jul 2 '14 at 6:28

TestNG provide a lot of annotations for thinks like that: @BeforeTest, @BeforeSuite, BeforeGroups and more:

It may be look like that:

public void setup() {
    // open your popup and click on the link

public void test() {
    // test case

public void tearDown() {
    // close popup

TestNG also provide Listeners: With Listeners you can say what before or after a test happens. Also what happens when a test finish, failed, skipped or succeed. Maybe this provide a better way for you.

share|improve this answer
I am facing problem in opening popup. That popup may contain a dropdown. so need to get that selected value from dropdown and then proceed. – Ashwani Raj Jul 2 '14 at 7:21
Selenium 2 / WebDriver has a Select class for dropdowns:… – Twaldigas Jul 2 '14 at 7:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.