Issue
My project used to work properly but suddenly i get this error.Code works at another computer but the very same code does not work on my machine.By the way i'm sure code is working cause i pull it from github and tried on another pc.
04:15:54.290 [main] INFO stepdefinitions.hook.Hooks - ---------------Test Automation has started------------ 04:15:54.292 [main] INFO stepdefinitions.hook.Hooks - Test Scenario : Validate that passenger flight information 04:15:54.293 [main] INFO stepdefinitions.hook.Hooks - Browser type ----> chrome
Step failed io.cucumber.core.exception.CucumberException: Failed to instantiate class stepdefinitions.BasicStepDefs at Caused by: org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":".your-reservation"}
I tried to pull again but nothing changed.
Solution
From the provided stack trace:
Caused by: org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":".your-reservation"}
Somewhere in your code you are looking for the element with the class 'your-reservation', but it cannot be found not found.
Check the 'getNumberOfReservation' method in the 'HotelConfirmationPage' class.
You are interacting with the mentioned element in the 'BaseStep' class.
Answered By - sashkins
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.