Azure-devops-docs: The sample script fails

Created on 22 Apr 2019  Â·  5Comments  Â·  Source: MicrosoftDocs/azure-devops-docs

driver.FindElement(By.XPath("//ol[@id='b_results']/li/h2/a/strong[3]")).Click();

This line returns error.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri1 devops-cictech devopprod doc-bug stale-issue

All 5 comments

It seems the bing website changed since this article is posted. The correct xpath is //*[@id='b_results']/li[2]/div[1]/h2/a

The correct xpath seems to now be //*[@id='b_results']/li[1]/div[1]/h2/a

The xpath changes as soon as the 'azure pipelines' site moves up or down the bing search results. Maybe it is not a good idea to use a search engines search results page as an example here.

Then I suggest using this instead: By.LinkText("Azure Pipelines | Microsoft Azure")

This issue hasn't been updated in more than 180 days, so we've closed it. If you feel the issue is still relevant and needs fixed, please reopen it and we'll take another look. We appreciate your feedback and apologize for any inconvenience.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adnanebrahimi picture adnanebrahimi  Â·  3Comments

dtamai picture dtamai  Â·  3Comments

KacperMucha picture KacperMucha  Â·  3Comments

o-o00o-o picture o-o00o-o  Â·  3Comments

LennartAJansson picture LennartAJansson  Â·  3Comments