【问题标题】:Not able to switch to the frame in salesforce lightening page无法切换到 Salesforce 闪电页面中的框架
【发布时间】:2023-04-01 22:16:01
【问题描述】:

请找到我使用的附加屏幕截图和代码。

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>

【问题讨论】:

  • @theGuy 你能调查一下这个问题吗?
  • 你能说清楚你想要什么吗?
  • 您需要添加隐藏文本输入并在选择添加时使用 jquery 或 javascript,并在隐藏输入中使用逗号分隔。希望对你有帮助
  • @SamDeveloper 你能提供我需要做的代码吗,因为我不知道 javascript
  • 如果顺序相同,您可以 selectByIndex 。

标签: javascript selenium selenium-webdriver selenium-chromedriver domxpath


【解决方案1】:

使用这个: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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-21
    • 1970-01-01
    • 1970-01-01
    • 2016-06-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多