【问题标题】:How to convert the WebElement to RepoItemInfo object in Ranorex如何在 Ranorex 中将 WebElement 转换为 RepoItemInfo 对象
【发布时间】:2020-03-14 22:32:56
【问题描述】:

在 Ranorex 中,我可以在 WebElement 对象上使用 FindAdapter<T>() 将 RepoItemInfo 转换为 WebElement,但我不知道如何向后执行?​​

RepoItemInfo info = someWebElement.???();

【问题讨论】:

  • 该 Web 元素是否在您的存储库中可用,或者您是否在运行期间构建它?

标签: c# ranorex


【解决方案1】:

该元素需要在您的 Ranorex 存储库中。添加后,您可以从存储库对象访问元素的信息对象。

【讨论】:

  • 是的,确实如此。但是如何在运行时创建 RepoItemInfo 对象呢? FE: `SomeMethod(WebElement we){ RepoItemInfo ri = we.???;]
  • 您不应该这样做,应该使用 Ranorex 存储库来定义 repo 项目。不使用存储库将为您的测试创建大量额外的工作和维护。
猜你喜欢
  • 2016-08-16
  • 2015-02-03
  • 2018-04-08
  • 2015-09-08
  • 1970-01-01
  • 2019-12-18
  • 2021-08-05
  • 2021-05-07
  • 2021-01-27
相关资源
最近更新 更多