鼠标在c#selenium上移动 [英] mouse onhover in c# selenium

查看:640
本文介绍了鼠标在c#selenium上移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网页中,默认情况下元素是不可见的。但是当鼠标移动到该对象上时,该元素变得可见。我想让selenium做一个鼠标onhover并在它可见时单击该元素。可以完成吗?



请帮助您的宝贵意见..

解决方案

我自己的解决方案是这样的:



行动行为=  new 动作(驱动程序); 
IWebElement menuhover = driver.FindElement(By.Id( id));
act.MoveToElement(menuhover);
act.Perform();


你检查一下吗?

http://www.learnseleniumtesting.com/mouse-hover-and-other-mouse-events-in-webdriver/ [ ^ ]

In my webpage an element is invisible by default. But when mouse is moved onto that object, that element becomes visible. I want selenium to do a mouse onhover and click on that element when it is visible..Can that be done??

Please help with your valuable comments..

解决方案

My own solution is like this:

Actions act = new Actions(driver);
IWebElement menuhover = driver.FindElement(By.Id("id"));
act.MoveToElement(menuhover);
act.Perform();


Do you check it?
http://www.learnseleniumtesting.com/mouse-hover-and-other-mouse-events-in-webdriver/[^]


这篇关于鼠标在c#selenium上移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆