Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
284 views
by
edited by
I am creating one array list and attempting to equals to another array list, the reader through CSV file. CSV row is not in the same order, changing everything when downloading. I tried with equals and compare to but both fail due to row fluctuations. How do I compare? Apart from row number, everything is the same .

2 Answers

0 like 0 dislike
by

Have you tried sorting and comparing?

You can do,

Arrays.sort(Object[]);

E.g.

Array.sort(A1); //Say this is the array you got from CSV file.

Array.sort(B1); //This is your array you want to compare with.

Then do,

Arrays.equals(A1,B1);

Hope tha thelps!

 

0 like 0 dislike
by New User (11 points)
One thing you can to is to check the each char at ith value then you can compare both of them
you can use for loop and then use equals method.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...