无法在Salesforce减轻页面中切换到框架

时间:2018-09-05 06:22:27

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

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

driver.switchTo()。frame(driver.findElement(By.xpath(“ // iframe [包含(@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>

enter image description here

1 个答案:

答案 0 :(得分:0)

使用此命令:jsfiddle.net/pn7e3b2u

baseball_data.csv
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 );
});