我有一个列表列表,我想删除重复项。列表是无序对象,系统认为它们不同。 例如,
a = [[1,2], [1,3], [3,4], [2,1] ,[4,3]]
我希望最终结果是
b = [[1,2], [1,3], [3,4]]
其中保留第一次出现。
答案 0 :(得分:0)
我使用python来解决这个问题。
public class DropDown3 {
@Test
public void selectByvalue() throws InterruptedException{
WebDriver driver = new FirefoxDriver();
driver.get("https://www.facebook.com/");
driver.manage().window().maximize();
List<WebElement> months = driver.findElements(By.xpath("//select[@id = 'month']/*"));
int total_months = months_list.size();
System.out.println("Total month Count is = " +total_months);
String[] exp = {"Month", "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"};
int count = 0;
for (WebElement ele: months){
count++;
Assert.assertTrue(ele.getText().toLowerCase().equals(exp[count].toLowerCase){
System.out.println("Matched ");
}