2012-03-23 85 views
0

我正在使用Selenuim網絡驅動程序(IE)編寫測試腳本。我沒有嘗試通過點擊獲得彈出式登錄(在iframe中)顯示。它是一個asp.net web應用程序,這是呈現的HTML:使用selenuim webdriver通過點擊登錄到彈出窗口

<span class='loggedOut'> 
        <a class='logInOut logIn popupLink' href='#'>Log In</a> 

        <span class='divider mini-hidden'>|</span> 

        <a class='logInOut register mini-hidden' href='/Forms/Registration.aspx'>Register</a> 

       </span> 

這是我用過的selenuim語法,沒有什麼工作:

lbi.findElement(By.xpath("//div[@class='logInOut logIn popupLink']")).click(); 

lbi.findElement(By.classname("logInOut logIn popupLink")).click(); 

lbi.findElement(By.ByLinkText("Log In")).click(); 

回答

0

我添加使用.sendkeys方法併發送「Enter」作爲鍵。它在IE8中訣竅。