driver.get("www.exmpale.com");
Thread.sleep(7000);
driver.findElement(By.cssSelector(".side-tab.side-generator")).click();
driver.manage().window().maximize();
Thread.sleep(30000);
// to find the 5 numbers in list1 and list 2 present in the header and
// add them in the list
for (int i = 0; i < 7; i++) {
numberList1
.add(
driver
.findElements(By.cssSelector(".generated-line"))
.get(0)
.findElements(
By.cssSelector(".generated-ball.animated.bounceIn>div")
)
.get(i).getText()
);
driver.switchTo().frame(driver.findElement(By.id("lotto-frame-games")));
// to find the numbers in the 2 boxes and add them in comparelist1 and
// comparelist2
for (int i = 0; i < 7; i++) {
compareList1
.add(driver
.findElements(
By.cssSelector(".select_num_col_part"))
.get(0)
.findElements(By.cssSelector(".main_active, .extra_active"))
.get(i).getText());
//to sort the lists so that lists can be compared easily.
Collections.sort(numberList1);
Collections.sort(compareList1);
System.out.println(numberList1.toString());
System.out.println(compareList1.toString());
[13, 16, 27, 34, 5, 7, 7]
[13, 16, 27, 34, 5, 7, 7]
私はソートは、私はそれを行うことができますどのように、ローからハイに動作することをしたいですか?
あなたは整数にあなたの文字列を変換し、適切な並べ替えを取得するためにリストにそれを配置する必要があります。 –
Grasshopper
@KirillKoganユーザーがあなたの質問に答えた場合は、彼の答えを受け入れてください** [回答を受け入れて:どうしますか?](https://meta.stackexchange.com/questions/5234/how-does-accepting-アンサーワーク))。未回答のものを指定してください、これはStackOverflowの本当に重要な部分です、ありがとうございます。 – Zabuza