Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Selenium MoveToElement操作不起作用_Selenium_Selenium Ide - Fatal编程技术网

Selenium MoveToElement操作不起作用

Selenium MoveToElement操作不起作用,selenium,selenium-ide,Selenium,Selenium Ide,在执行MoveToElement操作时,鼠标未移动到元素位置。请查找以下代码 Actions action = new Actions(driver); action.MoveToElement(element); action.Build().Perform(); 您可以尝试以下代码: IWebElement element = driver.FindElement(By.Id("Login_Id")); Actions action = new

在执行MoveToElement操作时,鼠标未移动到元素位置。请查找以下代码

    Actions action = new Actions(driver);
    action.MoveToElement(element);
    action.Build().Perform();

您可以尝试以下代码:

 IWebElement element = driver.FindElement(By.Id("Login_Id"));

        Actions action = new Actions(driver);
        action.MoveToElement(element);
        action.Build().Perform();

请参阅关于提问和提供更多详细信息的部分,以便社区为您提供帮助。@sowmya您可以考虑更新相关的HTML DOM吗?感谢您在问题中输入的代码不是用来将鼠标移动到元素位置的,所有这些都是滚动页面直到目标元素出现。如果您提供了更多关于您要做的事情的上下文,您可能会得到关于如何完成它的更好答案。@Jsmith2800,那么哪种selenium操作用于鼠标移动?与其只给出代码,不如解释OP的问题为什么有问题以及代码将如何解决问题。