Issue Description:
I am currently facing a problem setting up a Selenium webdriver in Java. Every time I attempt to navigate to this specific webpage: Expected Website, I get redirected to the Unintended Website. This redirection occurs regardless of which driver I use (Firefox, Chrome, Edge), and despite trying various solutions, I have been unable to prevent it. It seems that some JavaScript executing during page loading might be causing this unwanted redirection.
Interestingly, when I try to access the same website using a standard browser, I successfully reach the Expected Website as desired.
Objective:
To successfully load the following website using a Selenium webdriver: Expected Website
Additional Details:
The code snippet I have implemented so far:
System.setProperty("webdriver.gecko.driver", "E:/Downloads/geckodriver.exe");
File pathToBinary = new File(
"C:/Program Files (x86)/Mozilla Firefox/firefox.exe");
FirefoxBinary ffBinary = new FirefoxBinary(pathToBinary);
FirefoxProfile firefoxProfile = new FirefoxProfile();
driver = new FirefoxDriver(ffBinary,firefoxProfile);
driver.get("https://www.liketoknow.it/featured");
try {
Thread.sleep(10000);
}catch (InterruptedException e) {}
driver.quit();