【问题标题】:Test case to test the styles associated with a button when hovering in robot framework在机器人框架中悬停时测试与按钮关联的样式的测试用例
【发布时间】:2022-02-10 16:19:05
【问题描述】:

我正在尝试在机器人框架中实现以下验证。

  1. 按钮悬停时光标变为手形
  2. 当鼠标悬停在 按钮。 悬停按钮时,两者同时发生。

谁能帮我解决关键字和要传递的值。

另外,我想提一下,所有这些都是在类中定义的,如下所示:

例如:

and selector had all these kind of information:
.gMpiYI
    cursor: pointer;
    border-radius: 2px;
    color: #FFFFFF;
    background: #C25608;
    padding: 0.75rem 1rem;
    min-height: 2.5rem;
    font-weight: 700;
    font-family: Arial,Helvetica,sans-serif;
    font-size: 1rem;
    border: none;
  
.gMpiYI:hover, .gMpiYI:focus
    color: #FFFFFF;
    border-color: transparent;
    background: #aa4b07;
    box-shadow: 0 0 0 2px #FFFFFF,0 0 0 5px #aa4b07;
    outline: none;
My button had inspect element like this :

<button type="button" class="uitk-button Buttoncomponent__Button-uuuau7-1 gMpiYI"><span>Default</span></button>

【问题讨论】:

    标签: css hover robotframework


    【解决方案1】:

    根据您当前的代码 sn-p,我只能建议您使用 get element 属性关键字比较类名

    ${textToCompare}   Get Element attribute ${locator}@class
    should be equal as string  ${textToCompare}   uitk-button Buttoncomponent__Button-uuuau7-1 gMpiYI:hover
    

    【讨论】:

      猜你喜欢
      • 2016-03-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-14
      • 1970-01-01
      • 1970-01-01
      • 2017-12-24
      • 1970-01-01
      • 2019-10-25
      相关资源
      最近更新 更多