无法识别弹出文本

时间:2016-10-20 14:06:22

标签: java selenium-webdriver

我无法为以下控件提供cssSelector语句。

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: ipengine
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: ipengine
    spec:
      containers:
      - name: ipengine
        image: <imageaddr.>
        args:
        - ipengine
        - --ipython-dir=/tmp/config/
        - --location=ipcontroller.default.svc.cluster.local
        - --log-level=0
        resources:
          requests:
            cpu: 1
            #memory: 3Gi
      nodeSelector:
        #<labelname>:value
        cloud.google.com/gke-nodepool: pool-highcpu32

我需要简单地编写一个测试来验证此警告是否存在。有人有什么想法吗?

2 个答案:

答案 0 :(得分:0)

您可以使用JQuery

<a id="btnT" class="btn btn-xs btn-warning">Test</a>

var x = false;
    $(document).ready(function(){
            $('#btnT').popover({
            placement: 'bottom', 
            title: '${trainingDetail.title}',
            content: '${trainingDetail.description}',
            trigger: 'click',
            html : true,
            container: 'body'
        }).hover(function() {
              if (x) {
                  $(this).popover('hide');
                  x = false;
              }
              else {
                $(this).popover('show');
                x = true;
              }
            }); 
    });

答案 1 :(得分:0)

使用class找出div标签并获取其文本。它将为您提供h3和p标签中的所有文本。

driver.findElement(By.className("popover-content")).getText();

假设你已经能够将鼠标悬停在等等上......使用Actions类和moveToElement方法。

相关问题