简体   繁体   English

如何使用Selenium Java将数组中的值分配给网页中的文本框

[英]How to assign values from an array to Text boxes in Webpage using selenium java

I have an Excel sheet with as 5 rows and 3 columns containing values. 我有一个包含5行和3列包含值的Excel工作表。 What I need is :- -To read the values row wise each time and input into corresponding 3 textboxes in a webpag e and click submit button - Then page refreshes and then fetch the next row values in excel ,assign the values to the textfields perform the submit action 我需要的是:-要每次按行读取值并将其输入到webpag中相应的3个文本框中,然后单击提交按钮-然后页面刷新,然后在excel中获取下一行值,将值分配给文本字段执行提交动作

In a nutshell, how can we assign the values row wise enter image description here from an excel sheet to multiple textboxes in a page one after the other? 简而言之,我们如何才能将值从Excel工作表中逐行输入图像描述到一个页面中的多个文本框?

For read excel sheet and storing it into the variables in java probably the best way is to use Apache POI library .This library lets you manipulate excel documents and more. 要读取Excel工作表并将其存储到Java中的变量中,最好的方法可能是使用Apache POI库。此库可让您处理excel文档等。 I found some example how to use Apache POI to read data from excel. 我找到了一些示例,该示例如何使用Apache POI从excel读取数据。 After that you can you can store the cells inside the variables and use variables to insert the data into the website. 之后,您可以将单元格存储在变量中,并使用变量将数据插入网站。 Hope this gets you on the right track. 希望这能使您走上正确的道路。

http://www.codejava.net/coding/how-to-read-excel-files-in-java-using-apache-poi http://www.codejava.net/coding/how-to-read-excel-files-in-java-using-apache-poi

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM