Selenium fetches URL but wont click href - no error in console

20 views
Skip to first unread message

Jonathan Clark

unread,
Jun 6, 2018, 9:19:16 AM6/6/18
to seleniu...@googlegroups.com

I am running Selenium to test a specific area of my companies webpage. What I am trying to do seems relatively easy in theory, but I have ran into several obstacles. Can someone please tell me why the URL is opening but won't select the "Services" Hyperlink?

Below is a snippet of the code:

 System.setProperty("webdriver.ie.driver",
"Path to IE/IEDriverServer_64.exe");

WebDriver driver = new InternetExplorerDriver();

DesiredCapabilities caps = DesiredCapabilities.internetExplorer();



driver.get("https://www.ups.com/us/en/Home.page");
driver.manage().window().maximize();

driver.findElement(By.xpath(".//*/div[@id='ups-header']/nav[@id='ups- 
navItems']/ul[@class='ups-navItems_primary']/li[@class='ups-navMenu ups- 
menu'][3]/a[@id='ups-menuLinks2']")).click();

As I stated earlier, in theory this should open up UPS's homepage and select the "Services" tab on the top right of the page. Instead it just goes to UPS.com homepage and stays there.

I have driver.findElement(By.xpath........); in this example but I have tried findElement(By.name & partialLinkText

Can anyone give me a solution besides update to latest version(s)?

Metadata: Windows 10, JAVA 10, Internet Explorer (Unfortunately) 11.4.

Thanks in advance!



--
Thanks,

Jonathan
Reply all
Reply to author
Forward
0 new messages