Snapshot我必须使用量角器自动点击iframe内的下拉菜单。JavaScript在量角器
的Iframe:
<iframe src="swagger-ui/index.html" frameborder="0" marginheight="0" marginwidth="0"
width="100%" height="900" scrolling="auto" target="_top" class="ng-scope">
</iframe>
下拉:
<select id="select_baseUrl" name="select_baseUrl">
<option value="1">default (1)</option>
<option value="2">eventui (2)</option>
<option value="3">eventservice (3)</option>
</select>
我试图
var eeel = browser.executeScript("document.getElementByTagName('iframe')
.contentWindow.document.getElementById('select_baseUrl').click();");
browser.wait(eeel,200000);
console.log("Lv2");
但不工作。
我解决了这个问题。 ................................ browser.driver.switchTo().frame(0).then(function() { \t \t \t的console.log( '现在fn1的SRC1内'); \t \t \t browser.driver.sleep(5000); browser.driver.findElement(by.id( 'select_baseUrl'))点击() ; \t \t \t的console.log( '现在FN2 SRC1'); \t \t \t browser.driver.switchTo()defaultContent(); \t \t}); –