-1

I am new to selenium i have a problem with.

I am working with one form at that when I click the "Report" it launches the new browser with some data. I want to work with data.

How to get that data and verify that data

Launching and opened browsers are Fire fox browser

Please share your experience.

user2251940
  • 61
  • 1
  • 3
  • 11

2 Answers2

0

Assuming this is Java you are talking about - using the getting started with selenium framework.. your test would look like this.

@Config(url="http://mysite.com", browser=Browsers.FIREFOX)
public class MyTest extends AutomationTest {
    @Test
    public void myTest() {
        click(By.linkText("Report"))
        .waitForWindow("The Report") // specify what title or url the window is to be
        .click(By.linkText("something in the new window"))
        .validatePresent(By.cssSelector("div#content")); // validate whatever you need.
    }
}

If you are choosing to not use a framework, then you will have to use the WebDriver#switchTo()#window() method to switch to the window.

Also, disambiguate selenium-rc and selenium2. They are both completely different software packages.

ddavison
  • 28,221
  • 15
  • 85
  • 110
0

This is with related to selenium rc

Consider the case where I have 2 forms or window:

Currently I am at 1st form where Report button is present when I click the button it opens another form or window.

Below code is to select the 2nd form or window and maximizing it... Please give the title of the window..(in my exmaple i have title of 2nd form as 'Terms & Conditions | Photojaanic').

selenium.selectWindow("title=Terms & Conditions | Photojaanic");

selenium.windowFocus();

selenium.windowMaximize();

Below code is to return to original form where Report button is present.

selenium.selectWindow("null");
selenium.windowFocus();
Dan
  • 2,701
  • 1
  • 29
  • 34