I'm new to selenium and I'm having following query.
Query: Am working on a project where I need to copy 4000 values from an excel in a single go and I need to paste that in the list box of application. (The list box in the application can accept maximum of 4000 values)
The excel consists of 4000 values in its first 4000 rows(In a single column). I just need to copy all the values instead of using iterators.
Can anyone help me in achieving this?
-
Hi, I tried VB scripting to copy the value. I used cell range to perform copy action.Mohan– Mohan2016年05月19日 06:02:52 +00:00Commented May 19, 2016 at 6:02
-
And what went wrong with that code? Did you get any error? And again can we see your code if possible? Or at least the logic/algorithm you used?IAmMilinPatel– IAmMilinPatel2016年05月19日 06:09:27 +00:00Commented May 19, 2016 at 6:09
-
what kind of list box, plain text or with the formatting? It is some rich text web editor or just an inputbox? If this is plain text inpubox, then you can try to insert just text with CR/LFDee– Dee2016年05月19日 09:19:57 +00:00Commented May 19, 2016 at 9:19
-
What is a 'list box'. a select dropdown? an input field? We can help you but we need more info to do it.Michael Durrant– Michael Durrant2016年11月12日 12:44:24 +00:00Commented Nov 12, 2016 at 12:44
-
And what are you trying to do. Users wouldn't type 4000 characters so that is not realistic user action you are trying to represent. So again, what are you really trying to achieve here at a higher level ?Michael Durrant– Michael Durrant2016年11月12日 12:46:12 +00:00Commented Nov 12, 2016 at 12:46
3 Answers 3
@Mohan - Can you add why you particularly looking for without iterator?
Very simple solution without iterator
public Object[][] signUpPage1FieldValidationData() throws Exception{
Object[][] retObjArr=getTestData("<your .xls file name","<your tab name>", "<fields which you wanted to fetch>");
return(retObjArr);
Let me know, if you have some dificulty. All the best!
You may try jxl.Sheet.getColumn function of jxl.jar. Only catch is jxl does not support the "xlsx" file format.
-
might want to add a little more than just a link.IAmMilinPatel– IAmMilinPatel2016年11月23日 15:14:37 +00:00Commented Nov 23, 2016 at 15:14
-
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From ReviewKate Paulk– Kate Paulk2016年11月23日 17:46:15 +00:00Commented Nov 23, 2016 at 17:46
-
I don't see this answer as being super low quality. It suggests a library and a specific function to avoid iterators. It provides a caveat for what files will work or won't. I agree it would be better with some example code, but going to the jxl api makes it fairly clear. Maybe I'm just in the Thanksgiving spirit or something. :-)2016年11月23日 21:58:26 +00:00Commented Nov 23, 2016 at 21:58
-
@KatePaulk I thought specific function from a particular library would suffice.Kenil Fadia– Kenil Fadia2016年11月24日 08:51:06 +00:00Commented Nov 24, 2016 at 8:51
If you are using an excel file for inputting all different fields on your
application, you can put 4000 characters data in each cell for a column in excel
Then you can call that column everytime you are inputting value in your listbox,
and it will return random cell value from the column.