2017-02-27 28 views
1

簡単な夜間テストがあります。私はiframeの中のいくつかの要素をクリックする必要がありますが、私は、エラー '予想通り'が表示されていますが、「見つかりません」があります。Nightwatch。 iframeの要素をクリックすることはできません

.waitForElementVisible(".my_iframe", 30000) // this is work correctly 
.pause(5000) 
.frame('my_iframe') // I understood that it is needed to go inside iframe 
.waitForElementVisible("card_input", 5000) 
.frame(null) 

要素card_inputは表示されません。 iframe内の要素を操作するにはどうすればよいですか?

答えて

0

セレクタ ".my_iframe"はクラスを示します。 idのようなもっとユニークなセレクタを使うべきです。 iframeインデックスを使用することもできます。それはページの最初で唯一のiframeがある場合 、これを試してみてください。

.waitForElementVisible("iframe", 30000) // long timeout, but whatever. 
.pause(5000) // another long timeout. 
.frame(0) // zero indexed: if 1st iframe on this page, 0 should work. 
.waitForElementVisible("card_input", 5000) 
.frame(null) 
関連する問題