I have an eCommerce website where, when I try to place an Order where it redirects to a Paypal Page. When I Login as a Paypal user, it redirects to another checkout screen where
In this situations problem might be one of the two below reasons.
1.If its redirecting to new window and without switching to new window you cannot access any locator of new window. You can use the below code to switch window
String Parent_Window = driver.getWindowHandle();
//Get Parent window handle befor child window opens
String winHandleBefore = _driver.getWindowHandle();
for (String winHandle : _driver.getWindowHandles()) {
// Switch to child window
if( Parent_Window != winHandle )
driver.switchTo().window(winHandle);
}
Perform the action in child window and switch back to parent window.
Hope this will work.