我编写的代码如下: 我试过的代码如下:
@Test()
public void FilterMatching() throws Exception{
Properties properties = new Properties();
properties.load(new FileReader("C:\\FilterSection\\dropdown.properties"));
ArrayList<String> expectedDropDownItems = new ArrayList<String>();
Collections.shuffle(expectedDropDownItems);
List<String> randomFive = new ArrayList<String>();
for (int i=0; i<5; i++) {
if (i < expectedDropDownItems.size()) {
randomFive.add((String) expectedDropDownItems.get(i));
}
}
Log.info("1. Verifying the Visualization drop down values are matching in both property file and UI");
String[] expectedDropDownItemsInArray = properties.getProperty("visualizationId").trim().split(",");
Random r = new Random();
for(int i=expectedDropDownItemsInArray.length;i>0;i--){
int index = r.nextInt(i);
String temp = expectedDropDownItemsInArray[i];
expectedDropDownItemsInArray[i] = expectedDropDownItemsInArray[index];
expectedDropDownItemsInArray[index] = temp;
}
for(int i=0; i<expectedDropDownItemsInArray.length; i++)
expectedDropDownItems.add(expectedDropDownItemsInArray[i]);
Thread.sleep(6000);
}
情况是
任何人都可以帮我解决这个问题