【问题标题】:Automated testing with Visual Studio 2012 for test framework telerik使用 Visual Studio 2012 为测试框架 Telik 进行自动化测试
【发布时间】:2013-06-04 19:56:04
【问题描述】:

如何在 Visual Studio 2012 中使用 Telerik 框架为此命令行生成测试:

<span class = "widget-k k k-dropdown-header" style = "width: 100%;" unselectable = "on" role = "listbox" aria-haspopup = "true" aria-expanded = "false" tabindex = "0" = aria-owns "IdCorPinturaTipo_listbox" aria-disabled = "false" aria-readonly = "false" aria-busy = "false" aria-activedescendant = "IdCorPinturaTipo_option_selected">
<span class="k-dropdown-wrap k-state-default" unselectable="on">
<span class="k-input" unselectable="on"> PEROLIZADA </ span>
<span class="k-select" unselectable="on">
<span class="k-icon ki-arrow-s" unselectable="on"> select </ span>
</ span>
</ span>
<input id="IdCorPinturaTipo" type="text" style="width: 100%; display: none;" name="IdCorPinturaTipo" data-role="dropdownlist">
</ span>

由于信息来自一个下拉列表,想要生成测试信息PEROLIZADA。

我尝试了几种代码来生成这一行:

<span class="k-input" unselectable="on"> PEROLIZADA </ span>

这是我尝试生成测试上述信息的示例之一。

Find.ByExpression<HtmlAnchor>("class=k-input", "unselectable=on", "tabindex=-1", "id=IdCorPinturaTipo_option_selected").InnerText("PEROLIZADA");

【问题讨论】:

  • 嗨迈克尔 - 你试过的代码出了什么问题?是不是找不到元素?

标签: visual-studio-2012 telerik telerik-grid telerik-mvc


【解决方案1】:

看看this approachwiki有详细信息。

【讨论】:

    【解决方案2】:

    字符串 str = "PEROLIZADA"; Find.ByExpression("class=k-input", "unselectable=on", "textcontent="+str);

    【讨论】:

      猜你喜欢
      • 2016-11-13
      • 2023-03-18
      • 2016-03-03
      • 2012-10-06
      • 2012-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多