Tengo un iframe que se carga cuando hago clic en una pestaña en una página. Cuando uso Firebug para mirar el marco flotante en Internet Explorer 8, todo lo que veo es:Selenium and iframe
iframe id=tabContextFrame class=contextFrame contentEditable=inherit src=/xyz.dt?forward=show&layouttype=NoHeader&runid=1234 name=tabContextFrame url=/xyz.dt?forward=show&layouttype=NoHeader&runid=1234 scrolling=auto
y eso es it.The jerarquía por debajo del marco flotante no puede ser visto. Quiero hacer clic en un enlace dentro del iframe. Para encontrar los elementos dentro del iframe, hice un selenium.click("on the tab that loads the iframe")
y luego selenium.getHtmlSource()
. Desde esta fuente, al menos puedo localizar mi enlace de interés. Hice selenium.click("//span[text()='Link']")
pero parece que no hace nada. Alguna idea, por favor?
Aquí está el código:
selenium.click("//span[text()='tab that loads iframe']");
Thread.sleep(5000);
selenium.selectFrame("tabContextFrame");
selenium.mouseOver("//span[text()='Link']");
selenium.mouseDown("//span[text()='Link']");
selenium.mouseUp("//span[text()='Link']");
Thread.sleep(5000);
selenium.selectFrame("null");
¿Has probado selenio 2.0 con el controlador web? U puede usar driver.SwitchTo(). Frame() – Sudara
posible duplicado de [manejo de iframe en webdriver] (http://stackoverflow.com/questions/9942928/handling-iframe-in-webdriver) – Innovation