在我的应用程序中使用自定义标签(另一个框架)。我需要为按钮创建 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>
最佳答案
您可以像使用标准标签一样使用自定义标签。
因此,您可以使用 //mosaic-button
或 //mosaic-button/button
xpaths
关于selenium - 我可以使用自定义标签创建 XPath 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67197419/