2

I am trying to click on a element which is visible only after hovering.

browser.actions().mouseMove(element(by.css(".frx-mywork-main-block .frx-mywork-main-body-block3"))).perform();
 browser.sleep(5000);
element(by.css(".frx-mywork-main-block .frx-mywork-main-overlay .frx-mywork-main-overlay-body div:nth-child(2) span i")).click();

The class 'frx-mywork-main-overlay' is visible only after the hovering.The action hovering is successfully done while running the script, but it failed on clicking the element after hovering in Chrome browser.But this code is sucessfully clicking while running in Firefox.In chrome, it says element is not clickable at point (259, 504).i have attached the screenshot of the html page below.enter image description here How can i solve this?Thanks in advance.

Devleena
  • 453
  • 9
  • 25

1 Answers1

0

Try the below one after hover

var elm = element(by.css(".frx-mywork-main-block .frx-mywork-main-overlay .frx-mywork-main-overlay-body div:nth-child(2) span i"); 
return browser.executeScript("arguments[0].click();", elm.getWebElement());

Hope it helps you

Madhan Raj
  • 1,404
  • 1
  • 7
  • 13
  • Thanks Madhan..it worked by below code var elm = element(by.css(".frx-mywork-main-block .frx-mywork-main-overlay .frx-mywork-main-overlay-body div:nth-child(2) span i"); return browser.executeScript("arguments[0].click();", elm.getWebElement()); – Devleena May 08 '19 at 11:45
  • @Devleena Updated the answer. Do mark the answer correct so that it may help someone who face the same issue.Thanks – Madhan Raj May 09 '19 at 04:49