I know there's a
driver.navigate().back()
but that's not what I'm looking for.
Let's say a user is on PageA, they click on a submit button which takes them to a submit page. On that page, there are two buttons: change selection and confirm. Confirm takes them to the next page, but change selection takes them back to the page they were on.
It's not always going to be PageA, a user can be on PageB, PageC, etc. So, I was wondering if there is a way to return the PageFactory of whatever page the user was previously on? I haven't been able to find anything so far