How to locate the following element:
<a data-item-id="com.pyxis.greenhopper.jira:agile-velocity-chart" href="/jira/secure/RapidBoard.jspa?projectKey=RSWM&rapidView=3254&view=reporting&chart=velocityChart" tabindex="-1">Velocity Chart</a>
How to locate the following element:
<a data-item-id="com.pyxis.greenhopper.jira:agile-velocity-chart" href="/jira/secure/RapidBoard.jspa?projectKey=RSWM&rapidView=3254&view=reporting&chart=velocityChart" tabindex="-1">Velocity Chart</a>
You can use either of the following Locator Strategies:
cssSelector:
a[href^='/jira/secure/RapidBoard'][data-item-id$='agile-velocity-chart']
xpath:
//a[starts-with(@href, '/jira/secure/RapidBoard') and contains(@data-item-id, 'agile-velocity-chart')][text()='Velocity Chart']
The only thing which looks non-dynamic and human-readable is link text so the relevant XPath expression would be:
//a[text()='Velocity Chart']
you might also want to match the element using chart=velocityChart bit, if this is the case you can look up href attribute using XPath contains() function like:
//a[contains(@href,'velocityChart')]
More information: