how to mouse pointer from one frame to another?


I’m facing an issue in moving mouse pointer from one frame to another,as shown in screenshots am able to select an option (User Management] from ‘Administrator ‘ drop down by using mouse hover feature but after selecting and clicking User Management mouse pointer is not able to found the Webelement ‘test1@hcl.’ which is shown in screenshot.
And getting error as  “Unable to locate element: {“method”:”xpath”,”selector”:”.//*[@id=’’]/div[2]/div/img”}”.Below is the code which i used for login and mouse hover function and attached screenshots for reference,expecting quick reply..thanks ton in advance.

package automationFramework;
import java.util.concurrent.TimeUnit;
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.Action;
import org.openqa.selenium.*;
import org.openqa.selenium.interactions.Actions;
public class DragDropTestCase {
private static WebDriver driver = null;
public static void main(String[] args) throws InterruptedException {
// Create a new instance of the Firefox driver
driver = new FirefoxDriver();
//Put a Implicit wait, this means that any search for elements on the page could take the time the implicit wait is set for before throwing exception
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
// Find the element that's ID attribute is 'account'(My Account)
// driver.findElement(By.xpath(".//*[@id='account']/a")).click();
// Find the element that's ID attribute is 'log' (Username)
// Enter Username on the element found by above desc.
// Find the element that's ID attribute is 'pwd' (Password)
// Enter Password on the element found by the above desc.
// Now submit the form. WebDriver will find the form for us from the element
// Print a Log In message to the screen
System.out.println(" Login Successfully into MAGNet, now it is the time to Log Off.");
// for selecting User Management option from drop down
WebElement element = driver.findElement(By.linkText("ADMINISTRATOR"));
Actions action = new Actions(driver);
WebElement subElement = driver.findElement(By.linkText("User Management"));
//Double click
Actions Useraction = new Actions(driver);

Add Comment
  • 5 Answer(s)

    RE: how to mouse pointer from one frame to another?

    Train Answered on June 8, 2015.
    Add Comment


    Is there an iframe involved in the whole process? Can you check the HTML and let us know if there is an iframe?


    Professor Answered on June 8, 2015.
    Add Comment

    Yes Virender,

    You are right there is an iframe when i check HTML..

    Naresh G

    Train Answered on June 8, 2015.
    Add Comment

    you can use the simple code ” driver.switchTo().frame(framename);” to handle the frame

    and to move out of frame you can use “driver.switchTo().defaultContent();

    Train Answered on June 12, 2015.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.