Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Cyber Security
  3. Question
Cyber Security

What are the steps to deal with ui-sref in selenium?

Asked by Larry Huffer Oct 18, 2022 649 views 1 answer
Share

About this question

The Context:


I'm using selenium in java to click on a link to navigate to the other page of the application.


The Problem:


The application is made in angular-js wherein I tried to click on the Link, but strange it logs out me directly.


But if I hit the same URL manually, after login it works fine. I'm not sure Where I'm having a mistake here.


The link I'm trying to click


About
tried and tested but not working Locators:
driver.findElement(By.xpath("//a[@href='#/about']")
driver.findElement(By.xpath("//a[.='About']")

As soon as the URL is hit, it logs me out with a URL as


https: MY_HOST_URL/login.html#about
Not sure why and how login.html gets appended here.

I even tried to hit the full URL after login through the script but again it redirects to the same URL as


https://MY_HOST_URL/login.html#about

Your answer

1 Answer

More Cyber Security discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Cyber Security Blogs

Guides, tips and career advice on Cyber Security from JanBask experts.