标签: mousehover

将鼠标悬停在元素上并使用Java等待Selenium WebDriver

编辑:所以我想出了一种悬停在元素上的简单方法,但我想等待弹出一个结果.Chrome网页驱动程序悬停在元素上并且移动得太快,以至于我无法看到文本.在文本弹出之前,如何让它保持悬停状态?我查看了Wait()和until(),但我似乎无法使它们正常工作(我认为这是因为我并不是真的在等待代码中的布尔值.除非有人有一些建议吗? ).这就是我到目前为止所拥有的......

WebDriver driver = getWebDriver();
By by = By.xpath("//*[@pageid='" + menuItem + "']");
Actions action = new Actions(driver);
WebElement elem = driver.findElement(by);
action.moveToElement(elem);
action.perform();
Run Code Online (Sandbox Code Playgroud)

再次感谢大家!

干杯.

java selenium mouseover mousehover selenium-webdriver

8
推荐指数
2
解决办法
3万
查看次数

鼠标悬停在goJS图上添加文本

我想用JavaScript和GoJS创建一个ER(实体关系图).当鼠标悬停在节点上方以显示包含每个节点的一些信息的文本时,我也想要.我试着用这个例子,这是我的代码:

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ER diagram</title>
<meta name="description" content="Interactive entity-relationship diagram or data model diagram implemented by GoJS in JavaScript for HTML." />
<!-- Copyright 1998-2018 by Northwoods Software Corporation. -->
<meta charset="UTF-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/gojs/1.8.10/go-debug.js"></script>

<script id="code">
  function init() {

  var $ = go.GraphObject.make;  // for conciseness in defining templates

    myDiagram =
      $(go.Diagram, "myDiagramDiv",  // must name or refer to the DIV HTML element
        {
          initialContentAlignment: go.Spot.Left,
          allowDelete: false,
          allowCopy: false, …
Run Code Online (Sandbox Code Playgroud)

html javascript mousehover gojs

7
推荐指数
1
解决办法
1467
查看次数

在 Bootstrap 4 中使一行具有悬停效果而不使用表格

我想知道是否有办法让这里的行悬停?我想指出的是,我没有使用表格来创建它,而是使用 Bootstrap 4 中的网格系统。这可能吗?我研究的所有内容都表明您需要创建一个表才能实现这一点。

 <div class="row">
        <div class="report-card-i report-card-i-height">
            <h3 class="m-l-35 p-t-25 p-b-10">Compliance</h3>
            <div class="fa-orange m-t-10 m-b-15 m-l-80">
                <div class="row">
                    <div class="col-sm-1 col-xs-1 text-center">
                        <i class="fa fa-star m-r-15 text-center" style="font-weight: bold">Adjustment</i>
                    </div>
                    <div class="col-sm-1 col-xs-2 col-lg-offset-1 text-center">
                        <p>21,922</p>
                    </div>
                    <div class="col-sm-1 col-xs-2 col-lg-offset-1 text-center">
                        <p>$0.00</p>
                    </div>
                    <div class="col-sm-1 col-xs-2 col-lg-offset-1 text-center">
                        <p>$304,012.23</p>
                    </div>
                    <div class="col-sm-1 col-xs-2 col-lg-offset-1 text-center">
                        <p>$0.00</p>
                    </div>
                    <div class="col-sm-1 col-xs-2 col-lg-offset-1 text-center">
                        <p>$0.00</p>
                    </div>
                    <div class="col-sm-1 col-xs-1 text-center">
                        <i class="fa fa-angle-right text-center" style="font-weight: bold"></i>
                    </div>
                </div>
        </div> …
Run Code Online (Sandbox Code Playgroud)

html css mousehover bootstrap-4

7
推荐指数
1
解决办法
6026
查看次数

当鼠标悬停在QPushButton上时,如何从QPushButton发出信号?

最近,QPushButton当鼠标指针进入时,我希望能发出信号.我该怎么做?

我知道QPushButton有一些已经定义的信号,如clicked(),pressed(),destory() 等等.但没有信号如hover(),enter(),...

我看了一些关于它的信息:有人说可以用css完成.我不明白.你能给我一些建议吗?谢谢!

qt mousehover

6
推荐指数
2
解决办法
2万
查看次数

Change WinForms button highlight color

I found this page, which outlines how to change the rendering for a MenuStrip and its items.

I want to use this, but the problem is that the highlight color when you hover over a button doesn't match it.

Is there any way to change the highlight color from blue to yellow? I've tried using the MouseHover and MouseLeave events, but for some reason they're really slow, and they change the button to a solid color, which looks bad, …

c# button highlight visual-studio mousehover

6
推荐指数
2
解决办法
2万
查看次数

Bootstrap 在鼠标悬停时显示 div

有什么方法可以Div在鼠标悬停在任何 html 元素上时显示,例如td

Div 中有 HTML 内容。

在此输入图像描述

css jquery mousehover twitter-bootstrap twitter-bootstrap-3

6
推荐指数
2
解决办法
2万
查看次数

org.openqa.selenium.interactions.MoveTargetOutOfBoundsException: (x, y) 越界,而鼠标悬停与 GeckoDriver Firefox Selenium

我正在学习如何使用 Selenium WebDriver 进行自动化测试,但是我卡住了,无法使下拉菜单在 Firefox 中工作。相同的代码在 Chrome 中运行得非常好。

我正在练习的站点是:http : //www.executeautomation.com/demosite/index.html ,我想从菜单中单击以下项目:自动化工具 > Selenium > Selenium WebDriver。

错误消息表明 web 元素可能尚未加载到屏幕上,所以我实现了一些方法来等待每次执行,直到元素出现:

public static void ImplicitWait(WebDriver driver){
    driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
}
Run Code Online (Sandbox Code Playgroud)

但它没有帮助。

然后我读到最好“管道”这些 moveToElement() 方法而不是一个一个地执行它们。所以我改变了这个:

action.moveToElement(menu).perform();
action.moveToElement(selenium).perform();
action.moveToElement(seleniumWebDriver).click().build().perform();
Run Code Online (Sandbox Code Playgroud)

到一行。此时它开始在 Chrome 上工作,但我仍在努力使其在 Firefox 上工作。

当前代码如下所示:

System.setProperty("webdriver.gecko.driver", "C:\\Drivers\\geckodriver-v0.24.0-win64\\geckodriver.exe");
System.setProperty("webdriver.firefox.bin", "C:\\Program Files\\Mozilla Firefox\\firefox.exe");
WebDriver driver = new FirefoxDriver();

ImplicitWait(driver);

driver.navigate().to("http://executeautomation.com/demosite/index.html");

WebElement menu = driver.findElement(By.id("Automation Tools"));
WebElement selenium = driver.findElement(By.id("Selenium"));
WebElement seleniumWebDriver = driver.findElement(By.id("Selenium WebDriver"));

Actions action = new Actions(driver);
action.moveToElement(menu).moveToElement(selenium).moveToElement(seleniumWebDriver).click().build().perform();
Run Code Online (Sandbox Code Playgroud)

正如我上面提到的,当我切换到 Chrome 时同样可以正常工作,但是使用 Firefox 我收到错误消息: …

java firefox selenium mousehover geckodriver

6
推荐指数
1
解决办法
1万
查看次数

显示鼠标悬停文本的工具提示

与此问题相关: 在鼠标悬停文本时显示工具提示

如何对 RichTextBox 中的关键字而不是链接执行相同的操作?

在 RichTextBox 中我输入:

Hello World, How are You?
Run Code Online (Sandbox Code Playgroud)

我将鼠标悬停在“世界”这个词上作为工具提示,当它悬停时,工具提示会出现“这就是世界”!

但如果它悬停在 RichTextBox 之外或“World”一词本身,工具提示就会消失。

c# tooltip winforms mousehover

5
推荐指数
1
解决办法
2528
查看次数

如何为引导菜单启用悬停事件?

我实现了一个引导响应式丰富菜单,它工作正常。它适用于 Click 事件,我的问题是:如何将其更改为 Hover 事件?
所有引导菜单都有这个问题。bootstrap 对此没有任何支持?这是我使用的菜单:http : //geedmo.github.io/yamm/ 我的问题解决了:

<style>
    li.dropdown:hover .dropdown-menu {
        display: block;
    }

    li.dropdown:hover .dropdown-toggle {
        color: #555;
        background-color: #e5e5e5;
    }
</style>
Run Code Online (Sandbox Code Playgroud)

但是出现了一个新问题,当我缩小浏览器时,子菜单显示在菜单的末尾 显示在菜单的末尾 ,这是不合适的:/

javascript css hover mousehover drop-down-menu

5
推荐指数
1
解决办法
1890
查看次数

如何在鼠标悬停5秒前隐藏元素?

#div1 {
  display: block;
}

#div2 {
  display: none;
}

#container:hover > #div2 {
  display: block;
}
Run Code Online (Sandbox Code Playgroud)
<div id="container">
  <div id="div1">Div1</div>
  <div id="div2">Div2</div>
</div>
Run Code Online (Sandbox Code Playgroud)

这里我有一些代码,每当Div1鼠标悬停时,Div2就会显示这些代码。当未将鼠标悬停在Div1或上时Div2Div2会隐藏自身。

如何让鼠标悬停在 上Div1但 5 秒内没有移动时Div2隐藏自身?

html javascript css jquery mousehover

5
推荐指数
1
解决办法
5809
查看次数