I have mounted a server with Selenium RC, I do the test and export it to Python 2 remote control. From my nagios server I run selenium.py but the test fails because you can not change the window.
The test is as follows: I open a url, I click on a button that opens another window and in that window I click on another button that opens another window. The problem is that the test stops searching for the second window button because it does not locate it because it stays in the first window.
This is the export code of Selenium IDE in python 2 remote control
-- coding: utf-8 --
from selenium import selenium import unittest, time, re
class altamira_python5(unittest.TestCase): def setUp(self): self.verificationErrors = [] self.selenium = selenium("192.168.119.156", 4444, "*chrome", "
https://www.*******.com/") self.selenium.start()
def test_altamira_python5(self):
sel = self.selenium
self.assertEqual("homes", sel.get_title())
sel.click("css=div.contenido > a > span")
sel.wait_for_page_to_load("30000")
sel.click("css=img[alt=\"new\"]")
sel.wait_for_page_to_load("30000")
sel.wait_for_page_to_load("600000")
sel.click("css=img[alt=\"streat\"]")
sel.wait_for_page_to_load("30000")
try: self.failUnless(sel.is_element_present("css=div.contacto"))
except AssertionError as e: self.verificationErrors.append(str(e))
def tearDown(self):
self.selenium.stop()
self.assertEqual([], self.verificationErrors)
if name == "main": unittest.main()
I try many things but none works. I need your help