鼠标在c#selenium上移动

编程入门 行业动态 更新时间:2024-10-28 20:17:21
本文介绍了鼠标在c#selenium上移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

解决方案

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

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

你检查一下吗? www.learnseleniumtesting/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? www.learnseleniumtesting/mouse-hover-and-other-mouse-events-in-webdriver/[^]

更多推荐

鼠标在c#selenium上移动

本文发布于:2023-11-08 10:41:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1569164.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:鼠标   selenium

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!