Reputation: 184
I have been trying to click an element in a webpage by using this code
var testset = driver.FindElements(By.PartialLinkText("Reversal Detail Overview")) ;
testset[0].Click();
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)
when debugging I am getting the correct tag name of the another TAB
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.
Upvotes: 2
Views: 54
Reputation: 29362
any specific reason why are you PartialLinkText
and findElements
?
Did you try this instead :
var testset = driver.FindElement(By.LinkText("Reversal Detail Overview")) ;
testset.Click();
if not this, you may even try this :
var testset = driver.FindElement(By.CssSelector("li a[href*='#reversal_detail_overview']")) ;
testset.Click();
Upvotes: 1