0

I can't click on the link that is inside of the navigation.

I've tried locating link using class, xpath, css selector

let a = locate('a').withAttr({class: '.full-review'});
I.click(a);

I.click('//*[@id="block-jlr-main-menu"]/ul/li[3]/a');

I.click('#block-jlr-main-menu > ul > li:nth-child(3) > a');

I expect to click on a link and get redirected

Ahmed Ashour
  • 5,179
  • 10
  • 35
  • 56

1 Answers1

0

There are no enough information in your question. Without code of test and logs (use --verbose option for run).

But depending on ' Execution context was destroyed, most likely because of a navigation' it looks like, on previous step you make some navigation or some other action. It leads to element, which you want to click, removing.

On I.click(...) driver looks for element, finds it. Then element is removed. And click action cannot be done on removed element.

You should wait for some stable condition of DOM. By waitForElement(something stable after animation/DOM action/navigation) or similar

  • This isn't the right answer. Doing a wait doesn't fix the problem as codecept.js doesn't ever do the click but still passes. – Max Lynn Oct 02 '19 at 09:32