【问题标题】:PartialLinkText doesn't work in typescriptPartialLinkText 在打字稿中不起作用
【发布时间】:2017-09-29 04:12:49
【问题描述】:

我的元素列表如下:

<div class="container-menu" _ngcontent-c13="">
<nav _ngcontent-c13="">
<ul _ngcontent-c13="">
<li _ngcontent-c13="">
<a class="" _ngcontent-c13="" href="/32info" role="link" routerlinkactive="active" ng-reflect-router-link="/32info" ng-reflect-router-link-active="active" title="Information"> Information test </a>
</li>
<li _ngcontent-c13="">
<a class="active" _ngcontent-c13="" href="/32address" role="link" routerlinkactive="active" ng-reflect-router-link="/32address" ng-reflect-router-link-active="active" title="Address"> Data address </a>
</li>

我想先点击元素二,然后在我的测试中先点击。我是这样申诉的:

element(by.partialLinkText('Data address')).click();
element(by.partialLinkText('Information test')).click();

但这现在不起作用。我的测试人员如何点击这些项目?

【问题讨论】:

    标签: node.js angular typescript selenium-webdriver


    【解决方案1】:

    要使用 Selenium WebDriverJS 获得 TypeScript 的完整编译器体验,请将类型定义添加到您的项目中,例如使用 NPM。

    npm install --save-dev @types/selenium-webdriver
    

    类型定义的源码在GitHub

    【讨论】:

      猜你喜欢
      • 2016-06-16
      • 2018-12-25
      • 2018-11-23
      • 2023-04-07
      • 2020-03-18
      • 1970-01-01
      • 2017-02-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多