页面下拉框一般有两种类型,一种是div标签的,一种是option类型的,比如: div标签类型则可以通过定位进行元素点击去选择对应的枚举参数则可,而option类型的下拉选项则通过Selenium2Library库提供的3种方法去定位: select from list by value select from list by index select from list by lable 处理方法: 第1步:统计下拉框option的选项数量(get matching xpath count):
var id=$("#orderId").children('option:selected').val(); //selected选中项取值 var id=$('#orderId option:selected').val(); //原来一直都是上边的方法取值,今天刚了解到的,只要下拉框被选中后, //option的值会赋给select,name这个方法就会拿到下拉框的值 $('#sel').val();
一.选择屏幕下拉框. DATA: g_vrmid TYPE vrm_id, "id of value set gt_vlist TYPE vrm_values, "internal table of list gs_vlist TYPE vrm_value. "wa of gt_vlist. SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001. PARAMETERS: p_lsbox TYPE c AS
1.1:下拉框条件:后台取得ViewBag传给前台 MonitorController: public ActionResult BigData(): //下拉框筛选条件 var result = MonitorBLL.GetSoilPlantCountByCode(loginSoil); var r = (object)result.data; ViewBag.soilplantcount = r; // loginSoil是登录用户 public static ResponseModel G