Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Selenium WebDriver Integration
Tue Nov 21, 2017 1:06 pm by azharuddin

» how to connect DB in selenium webriver
Fri Oct 06, 2017 4:09 pm by anbarasi

» How find any text in browser screen and click on it?
Thu Oct 05, 2017 2:02 pm by sandeepkommineni

» Selenium Webdriver
Tue Oct 03, 2017 1:35 pm by PiyushBiswas

» GRID setup tutorial.
Wed Sep 27, 2017 4:29 pm by johnyapp

» Drag & Drop Between Windows Using Selenium Driver
Wed Sep 27, 2017 2:10 pm by 26rondel

» Check if window is closed / verify input
Sat Sep 23, 2017 10:21 pm by brainstir

» How to work on pages with AJAX in selenium?
Mon Sep 18, 2017 6:08 pm by azharuddin

» pause test until user press a key like F2
Wed Aug 09, 2017 11:10 pm by djnforce

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

MouseHover and then click on Link

View previous topic View next topic Go down

MouseHover and then click on Link

Post by iamsethi on Sun Feb 08, 2015 5:30 pm

I am trying to write a piece of code which

1) Opens a URL
2) Mouse Hover
3) Click on a link which appears on Mouse Hover

Right now my code is completing the steps 1 and 2 but not the Step 3

Code:


package Selenium_Pack;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
import org.testng.annotations.Test;

public class Day5 {
   
    public WebDriver driver;
   
    public Day5()
    {
        driver=new FirefoxDriver();
    }
   
    @Test
   
    public void Test() throws InterruptedException
    {
        driver.get("somelink");
        driver.manage().window().maximize();
       
        /*WebElement home = driver.findElement(By.xpath("//li//a[@href='#homeloan']"));
        home.click();
       
        WebElement homeloan = driver.findElement(By.xpath("//div[@class='hgreenicons1']"));
        homeloan.click();*/
       
        WebElement e = driver.findElement(By.xpath("//a[text()='Home Loan']"));
        Actions a= new Actions(driver);
        Thread.sleep(5000);
        a.moveToElement(e).perform();
        WebElement f = driver.findElement(By.xpath("//a[@class='parent' and @href='somelink'"));
        f.click();
       
       
       
       
       
       
       
       
    }

}


Any suggestions will be appreciated

iamsethi

Posts : 3
Join date : 2015-02-08

Back to top Go down

Re: MouseHover and then click on Link

Post by ccox on Fri Feb 13, 2015 12:17 am

Are you doing this in Selenium IDE?

ccox
Master
Master

Posts : 205
Join date : 2012-01-06
Age : 32
Location : Denver, CO

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum