【发布时间】:2020-08-17 21:10:16
【问题描述】:
如何在 webdriver IO 中使用参数构建 xpath 我必须将 xpath 作为参数传递,就像这样- const xpAthForthePageMenuItem = "(//div[contains(text(),"" + PageToNavigateTo + "")])[2]" 现在-上面的变量是我的实际 xpath 值,我需要将其传递给 elem const 才能编写选择器- const elem = $(xpAthForthePage)- 完成此操作的正确方法是什么? 我怎样才能在 webdriverIO 中实现这样的目标? 请问有人可以帮忙吗?
【问题讨论】: