I have created and executed the MouseHover functionality on the ADD-ONS tab within https://www.spicejet.com/ but it's not working with the below code.
Can anyone suggest what is missing in the code?
package SeleniumExamples;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
public class MouseHoverConcept {
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.chrome.driver","./driver/chromedriver81.exe");
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().deleteAllCookies();
driver.manage().timeouts().pageLoadTimeout(60, TimeUnit.SECONDS);
driver.get("https://www.spicejet.com/");
// create object for mouse hover
Actions action = new Actions(driver);
action.moveToElement(driver.findElement(By.xpath("//*[@id=\"highlight-addons\"]"))).build().perform();
Thread.sleep(3000);
driver.findElement(By.linkText("SpiceMax")).click();
//driver.quit();
}
}