首页 \ 问答 \ Selenium:如何将值从field1复制到field2?(Selenium: How to copy values from field1 to field2?)

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 have Object values, this is why values().stream() returns a Stream<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());

相关问答

更多