Monday, March 24, 2025

Unable to seek out XPath for mouse hover


I can not discover my XPath in order that I can not run the code. Can anybody remedy this challenge?

I’ve to do mouse hover handle content material then click on on content material Library:

bundle TestNG;

import org.testng.annotations.Take a look at;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.help.ui.ExpectedConditions;
import org.openqa.selenium.help.ui.WebDriverWait;
import org.testng.annotations.BeforeTest;

public class MuviOTT {

    public WebDriver driver;
    static WebElement aspect;
    //@Take a look at
    public void FreeTrail() throws Exception {
        driver.findElement(By.xpath("//button[@type="submit"]")).click on();
        driver.findElement(By.id("title")).sendKeys("subhankar jena");
        Thread.sleep(5000);
        // driver.findElement(By.id("companyname")).sendKeys("itworld");
        driver.findElement(By.title("cellphone")).sendKeys("7684914257");
        driver.findElement(By.id("electronic mail")).sendKeys("[email protected]");
        driver.findElement(By.id("inputPassword")).sendKeys("Bbsr@2021");
        // driver.findElement(By.id("subdomain")).sendKeys("iddomain");
        driver.findElement(By.id("terms_check")).click on();
        driver.findElement(By.id("nextbtn")).click on();
    }
    @Take a look at
    public void f() {
        
    }

    @BeforeTest
    public void openURL() throws Exception{
        System.setProperty("webdriver.chrome.driver", "F:Librarychromedriver.exe");
        driver = new ChromeDriver();
        // Opening the Browser and Getting into the URL
        driver.get("https://www.muvi.com/");
        // Maximize the Browser window
        driver.handle().window().maximize();
        //driver.handle().timeouts().implicitlyWait(2, TimeUnit.SECONDS);
        Thread.sleep(1000);
        driver.findElement(By.id("load_login")).click on();
        driver.findElement(By.id("LoginForm_email")).sendKeys("[email protected]");
        driver.findElement(By.id("LoginForm_password")).sendKeys("Gulu@123");
        driver.findElement(By.id("btn-login")).click on();

        Actions motion = new Actions(driver);
        // Mouse Hover actions on a component utilizing Motion Class:
        motion.moveToElement(driver.findElement(By.xpath("//em[@class="icon-film left-icon"]"))).carry out();
        
        WebDriverWait wait = new WebDriverWait(driver, 10);
        aspect= wait.till(ExpectedConditions.elementToBeClickable(By.id("//a[contains(.,'Content Library')]")));
        
        driver.findElement(By.xpath("//a[contains(text(),'Content Library')]")).click on();

    }
}

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles

PHP Code Snippets Powered By : XYZScripts.com