selenium webdriver - How to switch to dynamically named iframe with Behat/Mink -


writing test iframe generated when button clicked. iframe name , id similar generated dynamically. have used "switchtoiframe" before.

<div class="bbbb-frame-container" style="height: 400px; width: 665px; margin-top: -200px; margin-left: -332.5px;"> <div class="user-support-frame-close-container" style="display: block;"> <div class="user-support-frame-close">close</div> </div> <iframe id="poplock_default9636_priv" frameborder="0" name="poplock_default9636_priv" src="blah.blaag.com"> <!doctype html> 

.....................

the poplock_defaultnnnn_priv dynamically generated iframe switch to..

first, find iframe 1 of find methods. if it's iframe on page (or first one) use find() method. if it's not, you'll have use findall() , rely on order (since there's no distinct attribute search for).

once find iframe, can use getattribute name , use switchtoiframe to... well, switch iframe.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -