0

我正在尝试切换到具有动态名称和 id 的 iframe,并且这两个属性都具有静态启动,我尝试了函数 browser.frame(''); 如下:

  let frameSelector = $('.zoid-visible');
  const frameID = frameSelector.getAttribute("id");
  console.log("frameID = "+frameID );
  const frameLocator = '#'+frameID +'';
  console.log("frameLocator = "+frameLocator);
  let my_frame = $(frameLocator).value;
  browser.frame(my_frame);

但它会引发如下错误:

invalid selector: Unable to locate an element with the xpath expression //input[#'search-text'] because of the following error:     
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//input[#'search-text']' is not a valid XPath expression.

以下是我尝试与之交互的 DOM 块:

<iframe allowtransparency="true" name="__zoid__one_component__eyJ1aWQidFwibmFtZV3RcIn19fSJ9__" title="one_component" id="uid_eabf27beee_mty6ndi6ndi" class="zoid-visible" style="background-color: transparent; border: none;"></iframe>

我尝试了所有可用资源,但找不到解决方案,我们将不胜感激。谢谢你。

4

0 回答 0