java - 如何在java中将数组列表值存储在字符串中
问题描述
List<WebElement> Applicationfor = driver.findElements(By.xpath("//ul[contains(@id,'projectMainForm:projectTabSubview')]/li"));
// (I am capturing all the values that are there in the list with the above line)
List<String> applicationfor = new ArrayList<String>();
WebElement applicationfordropdown = driver.findElement(By.xpath("//td[normalize-
space()='Application For*']/following::div[contains(@class,'ui-selectonemenu-trigger')][1]"));
// (I am clicking on the dropdown and fetching the values which is assigned to the ArrayLIST)
applicationfordropdown.click();
Applicationfor.forEach(Ele -> applicationfor.add(Ele.getText()));
//System.out.println("Print the colvalues:"+applicationfor);
for(String text : applicationfor)
{
System.out.println("Print the lst values:"+text);
}
我的问题是,如果将 applicationfor 值分配给数组列表,如上面的代码所示
仅打印列表中的第一个值。我哪里错了?
解决方案
推荐阅读
- azure - Azure 数据流:如何将 csv 映射到 sql 以下表结构?
- r - rgl 随深度褪色,深度感知
- xpath - XPATH 使用 OR 语句将两个不同的查询连接在一起,以便结果按照它们出现的顺序排列
- maven - DL4J UnsatisfiedLinkError:libopenblas_nolapack.so.0:无法打开共享对象文件:没有这样的文件或目录
- php - Laravel + Swift Mailer:错误:没有有效的收件人
- postgresql - 在 PostgresSQL 函数中,是否可以检查列值是否与给定参数值匹配?
- php - Google Ads 无法在 Multi-park 域网站上运行
- javascript - 检查输入字符串是否只有数字且最大长度为 4
- docker - 阻止服务不受限制地在某些工作人员上运行
- kubernetes - Vagrant:在所有虚拟机启动后运行 Ansible 配置,Ansible 无法连接到所有主机