javascript - 无法切换到 Salesforce 闪电页面中的框架
问题描述
请找到我使用的附加屏幕截图和代码。
driver.switchTo().frame(driver.findElement(By.xpath("//iframe[contains(@title,'部署数据集')]")));
<div class="slds-template_iframe slds-card" force-aloha-page_aloha-page=""><iframe height="100%" width="100%" scrolling="yes" allowtransparency="true" id="vfFrameId_1536136086228" name="vfFrameId_1536136086228" allowfullscreen="true" force-aloha-page_aloha-page="" allow="geolocation *; microphone *; camera *" title="Deploy Data Set"></iframe></div>
解决方案
var select = document.querySelector('.slds-select.slds-select1');
select.addEventListener('change',function(){
var result = [];
var options = this && this.options;
var opt;
for (var i=0, iLen=options.length; i<iLen; i++) {
opt = options[i];
if (opt.selected) {
result.push(opt.value || opt.text);
}
}
alert( result );
});
<div class="slds-form--stacked slds-grid slds-wrap" role="form">
<div class="slds-form-element slds-m-top--large slds-size--3-of-6">
<label class="slds-form-element__label dsLabel" for="selectSample1">Destination Salesforce Organization</label>
<div class="slds-form-element tooltipIcon">
<div class="slds-form-element__icon slds-align-middle">
<img alt="Table" class="slds-button__icon" src="/resource/1530008060000/pdri_sprint17__SLDS_Resource/assets/icons/utility/info_60.png">
</div>
<div class="slds-popover slds-popover--tooltip slds-nubbin--left-top toggle slds-hide" id="tooltipDestination" role="tooltip" style="position: absolute;top: -49px;left: 30px;float: left;min-width: 312px;">
<div class="slds-popover__body">Specifies the organization to copy data to. Use Ctrl+click to select up to five destinations.</div>
</div>
</div>
<div class="slds-form-element__control slds-m-top--small"><select id="j_id0" name="j_id0:theForm:targetList" class="slds-select slds-select1" multiple="multiple" size="3"> <option value="a02m00000086vRZAAY">Local connection</option>
<option value="a02m00000086vReAAI">Destination connection</option>
</select>
<input id="valholder" type="hidden" name="selval">
</div>
</div>
</div>
推荐阅读
- flutter - StreamBuilder 监听流和普通监听方法的区别
- javascript - setInterval 和 setState 中的 useEffect 错误
- php - SQLSTATE [23000]:违反完整性约束:1048 列 'cne' 不能为空
- c# - C#使用OleDbConnection将数据插入excel,但数据在错误的行上
- swift - 在 Swift 中以正确的方式从 URLSession 解码原始数据
- php - php(客户端套接字) java(服务器套接字)无法接收第二个数据
- python - python中硒代码中xpath中的语法错误
- java - groovy.lang.MissingMethodException:Jmeter 上的错误
- php - 从 PHP 打开 SQLITE 数据库并将结果报告到 HTML 页面时出现问题
- react-native - React native 我在 app.js 中放了一个启动画面,但出现错误