如何使用编码的UI测试从编辑控件中获取值

时间:2018-04-09 12:39:19

标签: coded-ui-tests

我正在尝试使用编码的UI TEST从文本字段中获取订单号

文字字段ID为: order_no。

我知道硒会使用:

String strOrderNumber=driver.findElement(By.id("order_no")).getAttribute("value");

我在codedUi测试中的代码

public static void getOrderNumber(UITestControl Control) 
{ 
Control.TechnologyName = "web"; Control.SearchProperties.Add("Controltype", "Edit");
Control.SearchProperties.Add("Id", "order_no"); 
OrderNumber = Control.GetProperty("Text").ToString(); 
Console.Write(OrderNumber); 
}

enter image description here

0 个答案:

没有答案
相关问题