Selenium:如何将值从field1复制到field2?(Selenium: How to copy values from field1 to field2?)
我们正在使用Firefox中的Selenium IDE录制测试。
我们需要将值从只读字段复制到输入字段。
有没有直接的方式我可以参考该领域或我必须存储和使用它。 一个例子就是很棒。
谢谢。
We are recording a test using Selenium IDE in Firefox.
We need to copy a value from a read-only field to an input field.
Is there a direct way I can refer the field or do I have to store and use it. An example would be great.
Thanks.
原文:https://stackoverflow.com/questions/7808378
更新时间:2023-04-13 09:04
最满意答案
好吧,你将
treeMap
定义为具有Object
值,这就是values().stream()
返回Stream<Object>
。 要么更改合同,要么需要在流中转换元素:List<HashMap<String,Object>> list= treeMap.values().stream() .map(element -> (HashMap<String,Object>)element) .collect(Collectors.toList());
Well, you define the
treeMap
to haveObject
values, this is whyvalues().stream()
returns aStream<Object>
. Either change your contract or you'll need to cast the elements in the stream:List<HashMap<String,Object>> list= treeMap.values().stream() .map(element -> (HashMap<String,Object>)element) .collect(Collectors.toList());
相关问答
更多-
使用TreeMap排序问题(Sorting problem using TreeMap)[2023-06-15]
关键字B,G和H被删除的原因是因为您提供的比较器仅根据值进行比较。 由于它们都具有相同的值,它们都是相同的密钥,这意味着将覆盖其他值。 要打印出你想要的内容,你的比较器需要首先比较这些值,然后如果它们相等,则比较这些键。 int compare(Comparable key1, Comparable key2) { // I'm guessing you are doing something like: // return map.get(key1).compareTo(map.get(key ... -
如何将以下hashMap
转换为可用的JS对象?(How does one convert the following hashMap [2023-06-20]to a usable JS object?) 解析你提供的字符串不会因为键部分中的整数(12,2,4等)而起作用。 如果您以字符串的形式获取hashmap数据,那么您可以在javascript中尝试以下内容: var str = '{12=Other Services (Assisted), 2=Other Services, 4=Collect, 17=Get New (For Me), 19=Get New (For My Business)}'; str = str.replace('{',''); str = str.replace('}', ... -
hashMap.keySet().toArray(); // returns an array of keys hashMap.values().toArray(); // returns an array of values 编辑 应该注意的是,两个数组的排序可能不一样,当需要配对键/值时,请参阅oxbow_lakes回答一个更好的迭代方法。 hashMap.keySet().toArray(); // returns an array of keys hashMap.values().toArr ...
-
System.out.println(arrivals.size()); //result 0, arrivals is empty. WHY? 因为当你呼叫flights.clear(); 在arrivals.put(arr, flights);后,输入arrivals.put(arr, flights); 或者arrivals.clear(); 在departures.put(dep, arrivals); ,这会清除您的原始对象(航班和到达)。 请带上你的初始化语句即 MapBook b3=booksTree.get(b1); --------------------------^ 参数必须是String public V get(Object key) : 方法调用返回指定键(在大小写中为String)映射到的值,如果此映射不包含键的映射,则返回null。 Book b3=booksTree.get(b1); --------------------------^ The parameter must be String public V get(Ob ...
HashMap到TreeMap(HashMap to TreeMap)[2023-02-27]
您可以通过将地图供应商传递给groupingBy来直接创建TreeMap : Map> treeMap = list.stream() .collect(Collectors.groupingBy(TagEntity::getTagType, () -> new TreeMap >(Comparator.reverseOr ... HashMap与Treemap(HashMap Vs Treemap)[2023-08-21]
一个区别是TreeMaps不支持null键,但HashMaps支持。 使用TreeMap,如果beanRecord.getEmail()返回null,您将在运行时获得异常。 One difference is that TreeMaps do not support null keys, but HashMaps do. With a TreeMap, you would get an exception at runtime if beanRecord.getEmail() returned null.如何为TreeMap和HashMap(Java)创建一个可迭代的包装器?(How to create an iterable wrapper for TreeMap and HashMap (Java)?)[2023-08-15]
public Iteratoriterator() { return map.values().iterator(); } public Iterator iterator() { return map.values().iterator(); } 将TreeMap
转换为List [2023-08-05]>(convert TreeMap to List >) 好吧,你将treeMap定义为具有Object值,这就是values().stream()返回Stream如何将流Stream
>转换为HashMap数组HashMap [2022-05-13][]?(How to Convert Stream Stream > to HashMap Array HashMap []?) 以下应该有效。 不幸的是,您必须禁止未经检查的警告。 @SuppressWarnings("unchecked") HashMap[] arr = imagesStream.toArray(HashMap[]::new); 表达式HashMap[]::new是一个数组构造函数引用 ,它是一种方法引用 。 方法参考提供了实现功能接口的替代方法。 您还可以使用lambda表达式: @SuppressWarnings({"unchecked", "rawtypes"}) Hash ... 相关文章
更多- Solr4.7---Field、CopyField、DynamicField
- solr required field: id
- Solr Document [null] missing required field: id 的原因
- 启动Solr时报 _version_ field must exist in schema 错误的解决方法
- solr error logs org.apache.solr.common.SolrException: ERROR: [doc=17] unknown field alias
- ExtJS自定义组件中的事件传递问题
- Redis 哈希(Hash)详解
- INSERT INTO blog_appitem (user_id,appid,app_secret,is_valid) VALUES (1, 'wxf415741de036114c','48e1e345fd5f11c93af18ff1714c7f78',1)
- Solr的一些查询参数
- 【solr基础教程之二】索引
最新问答
更多- h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
- 创建一个功能(Create a function)
- 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
- PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
- Qt冻结循环的原因?(Qt freezing cause of the loop?)
- TableView重复youtube-api结果(TableView Repeating youtube-api result)
- 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
- SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
- 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
- 以编程方式创建UITableView(Creating a UITableView Programmatically)
- 如何打破按钮上的生命周期循环(How to break do-while loop on button)
- C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
- 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
- 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
- Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
- 设置kotlin扩展名(Setting a kotlin extension)
- 如何并排放置两个元件?(How to position two elements side by side?)
- 如何在vim中启用python3?(How to enable python3 in vim?)
- 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
- 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
- Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
- dedecms如何安装?
- 在哪儿学计算机最好?
- 学php哪个的书 最好,本人菜鸟
- 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
- 如何覆盖错误堆栈getter(How to override Error stack getter)
- 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
- USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
- 电脑高中毕业学习去哪里培训
- 正则表达式验证SMTP响应(Regex to validate SMTP Responses)