无法切换到salesforce闪存页面中的框架

问题描述 投票:0回答:1

请查看我使用的附加屏幕截图和代码。

driver.switchTo()。frame(driver.findElement(By.xpath(“// iframe [contains(@ title,'Deploy Data Set')]”)));

<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>

enter image description here

javascript selenium selenium-webdriver selenium-chromedriver domxpath
1个回答
0
投票

使用此:jsfiddle.net/pn7e3b2u

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>
© www.soinside.com 2019 - 2024. All rights reserved.