How to click on hidden element in protractor?

后端 未结 2 554
旧巷少年郎
旧巷少年郎 2021-01-02 03:53

I have an element which is visible only when I hover over it.

I\'ve written following code to hove over the panel so that the element is visible.

pto         


        
2条回答
  •  旧巷少年郎
    2021-01-02 04:29

    Following code worked for me.

      ptor.actions().
        mouseMove(ptor.findElement(protractor.By.xpath('//*@id="productapp"]/div/div/di‌​v[2]/div/div/div/div[2]/div/div/div/div[4]/table/thead/tr/th[2]'))).perform();
    
       ptor.element.all(by.css('i.ng-scope.tea-ic-sorting')).then(function(elm){
           elm[0].click();
        });
    

提交回复
热议问题