0

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.

asked Jul 1, 2014 at 12:27
7
  • 1
    What programming language? What xUnit framework? Commented Jul 1, 2014 at 13:03
  • I am using java and Testng framework. Commented Jul 1, 2014 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? Commented Jul 1, 2014 at 14:06
  • He says he is using TestNG not testing, you can find the website here: testng.org Commented Jul 1, 2014 at 15:57
  • hey @Niels any kind of suggestion is highly appreciated. Commented Jul 2, 2014 at 6:28

1 Answer 1

1

TestNG provide a lot of annotations for thinks like that: @BeforeTest, @BeforeSuite, BeforeGroups and more: http://testng.org/doc/documentation-main.html#annotations

It may be look like that:

@BeforeTest
public void setup() {
 // open your popup and click on the link
}
@Test
public void test() {
 // test case
}
@AfterTest
public void tearDown() {
 // close popup
}

TestNG also provide Listeners: http://testng.org/doc/documentation-main.html#testng-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.

answered Jul 2, 2014 at 7:12
2
  • 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. Commented Jul 2, 2014 at 7:21
  • 1
    Selenium 2 / WebDriver has a Select class for dropdowns: selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/… Commented Jul 2, 2014 at 7:30

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.