這裏是代碼的html代碼。這裏使用java selenium代碼,我需要點擊註銷選項關閉會話。在下拉按鈕,點擊後註銷選項會出現,我需要點擊該鏈接如何選擇下拉選項,並應在硒webdriver java代碼下拉列表中點擊下面的值
<div class="sp-info">
abc
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
</a>
<ul class="main-menu" style="display: block;">
<li>
<a href="profile.php">
</li>
<li>
<a href="change_password.php">
</li>
<li>
<a href="logout.php">
在這裏是用java代碼硒。
driver.get(baseUrl + "owner/login.php");
driver.findElement(By.xpath("//input[@name='admin_user_name']")).sendKeys("qwerty");
driver.findElement(By.name("admin_password")).clear();
driver.findElement(By.xpath("//input[@name='admin_password']")).sendKeys("12345678");
driver.findElement(By.xpath("//button[@type='submit']")).click();
driver.manage().timeouts().implicitlyWait(10 , TimeUnit.SECONDS);
WebElement wb = driver.findElement(By.xpath("//div[contains(@class,'sp-info')]"));
Actions mouse = new Actions(driver);
mouse.moveToElement(wb).click();
WebElement wb1 = driver.findElement(By.xpath("//a[contains(@href,'logout.php')]"));
mouse.moveToElement(wb1).click();
如何試着解決這個問題? – noor