views:

548

answers:

1

Hi ,

I am testing the Router UI using selenium. I am using cisco routers. I am pinging a website and the router opens a pop up window showing the Ping statistics. The selenium ide is recording the popup window as " Ping table " but when i am running it the ide shows an error.

I want to verify and validate the data in the pop up window . i tried " select window " , get win ids " , win names , nothing seems to be working. I am using python in selenium .

code below

    sel.open("/Diagnostics.asp")
    sel.click("ping_button")
    sel.wait_for_page_to_load("30000")
    sel.click("ping_button")
    sel.wait_for_page_to_load("30000")

------- it fails for all the steps below

    sel.wait_for_pop_up("PingTable", "30000")

------ pop up window -----> ping table ------------

    sel.select_window("name=PingTable")


self.failUnless(sel.is_text_present("5 Packets transmitted, 5 Packets received, 0% Packet loss"))

nothing seems to work ......

A: 

I'd need to reproduce this locally to be able to answer definitively. The only thing that comes to mind right now is that you say the IDE identifies it as "Ping table" but in your python you refer to it as "PingTable". It might be a typo on your behalf, but maybe not.

John Keyes
My ide identifes it as "PingTable"
Even though selenium records the window as "PingTable " when i do sel.selectwindow("PingTable") i get an error saying that the window does not exist.
What does `selenium.get_all_window_ids()` return?
John Keyes
nothing - it identifes the main window and not the pop up window
when i do get_all_window_ids i get " undefined "
That's not helpful. I presume it's because the window has been opened by a different process and not by a Javascript `window.open` call. Is the pop up window beyond your control?
John Keyes
I did not understand your question . pop up window beyond my control means what exactly ? The pop up window opens and i get the ping statistics.
Have you opened the window with `window.open`? If not how have you opened it?
John Keyes
The ping window opens by clicking on the " ping button . " sel.click("ping_button")
Well you should be able to get a handle for the window then. Sorry I can't provide a solution.
John Keyes
Thanks John.......