【发布时间】:2021-07-15 17:47:25
【问题描述】:
在我的应用程序中使用了自定义标签(另一个框架)。我需要为按钮创建一个 XPath。
<mosaic-button class="mc-btn" id="btnShowResults btnShowResults " color="secondary" type="button" title="Show results" text="Show results" data-ng-disabled="v1RetrieveService.activeAdvSearchSettings().length < 1 || !isValidForm()" data-ng-click="v1RetrieveService.activeAdvSearchSettings().length < 1 || !isValidForm() || showResults()">
<button type="button" class="mc-btn__button mc-btn__button--secondary" ng-class="{'mc-btn__button--rounded mc-btn__button--icon-only' : rounded, 'mc-btn__button--icon-only' : justicon}" aria-label="" ng-disabled="disab">
<!-- ngIf: useIcon -->
<div class="mc-btn__div ng-binding" ng-class="{'mc-btn__div--icon-only' : rounded, 'mc-btn__div--icon-only' : justicon}">
<!-- ngIf: showSpinner -->
Show results
</div>
</button>
</mosaic-button>
【问题讨论】:
-
你指的是哪些标签?
-
请edit您的问题包括您的代码试验。
-
是的,您应该能够使用自定义标签创建 XPath,
//mosaic-button应该可以获取该元素。另一种选择是使用//*[local-name()='mosaic-button'] -
@Eliyahu 是的,谢谢,我认为该标签没有用。
标签: selenium selenium-webdriver xpath custom-tags