Is there any way to re run the failed testcase from the page where it got failed instead of running the testcase from beginning in Selenium Java ?
As per the TestNG documentation for rerunning, Every time tests fail in a suite, TestNG creates a file called
testng-failed.xml in the output directory. This XML file contains the necessary information to rerun only these methods that failed, allowing you to quickly reproduce the failures without having to run the entirety of your tests. So, you just need to do like this
java -classpath testng.jar;%CLASSPATH% org.testng.TestNG -d test-outputs test-outputs\testng-failed.xml
This is the manual approach, for the automatic way you need to implement a login for Retry Test using TestNG Listener
IRetryAnalyzer to handle max-retry count and all.
There are many similar threads that have been discussed on same topic.
Hope this helps!!