看板 Python 關於我們 聯絡資訊
找到解法了,回來分享一下: 在開新視窗前需要先"捕捉"開出來的新視窗(因為視窗是隨機產生的) code 在下面: 下一步就是透過IDE來學WebDriver 了, 請問有大家推薦的原文書或是Youtube List 嗎? 謝謝~ <tr> <td>storeEval</td> <td>selenium.getAllWindowNames()[1]</td> <td>windowName</td> </tr> <tr> <td>getEval</td> <td>this.doEcho(&quot;array length: &quot;+s elenium.getAllWindowNames().length);this.doEcho(&quot;Available window names: &quot;+selenium.getAllWindowNames()); this.doEcho(&quot;Selecting window: &quot;+storedVars['windowName']);</td> <td></td> </tr> <tr> <td>selectWindow</td> <td>${windowName}</td> <td></td> </tr> ※ 引述《lalelee (股市修行人)》之銘言: : Selenium IDE 的問題不知道適不適合在這問 , : 直接錄完以後的Case 照跑但是會出現問題, 所以想請教一下: : 1. 登入後等到某個元素出現 : 2. ClickAndWait 這個元素 : 3. 這邊會開一個新網頁 : 4. 一樣Type Username 但就會出現如下的錯誤: : [warn] Opening window '_blank', which is not a real window name. Randomizing : target to be: selenium_blank5287 : [info] Executing: |type | name=username | XXX | : [error] Element name=username not found : [info] Test case failed : 有試過用selectWindow(title=XXX) 但是還是一樣會出現"Element not found" : 調慢也一樣, : 請問還有其他作法嗎 ? : 謝謝~ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 210.69.75.17 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1515981169.A.CAE.html
s860134: 問題百百種,上 stackoverflow 最快XD 01/15 13:34