Remove the while loop and run this .click() function that will help you to click on the desired button present in that XPath. If you want to see the next page then import the package using:
import java.util.concurrent.TimeUnit;
then, inside the code try
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
That will work for you.