Click on a tab element inside a webpage is not working


I have been trying to click an element in a webpage by using this code

var testset = driver.FindElements(By.PartialLinkText("Reversal Detail Overview")) ;

But when I am trying to click the element using the exact text shown in the Jscript of the page it is clicking some other element(Yellow color in the picture) inside the active tab but not the seperate tab(Green color in the picture)

enter image description here

when debugging I am getting the correct tag name of the another TAB

enter image description here

Not sure where I am going wrong. Can anyone please help me to click on the reversal detail overview tab control that is highlighted in green. Thanks in advance.


any specific reason why are you PartialLinkText and findElements ?

Did you try this instead :

var testset = driver.FindElement(By.LinkText("Reversal Detail Overview")) ;

if not this, you may even try this :

var testset = driver.FindElement(By.CssSelector("li a[href*='#reversal_detail_overview']")) ;

Answered By – cruisepandey

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published