I need help getting the xpath or link from this html
<div class="g-btn g-hyperlink " id="s99AB6D3E3FBF404BA01A344322BFA0EE263_2_1"><a onmousemove="window.status='';" onmouseout="window.status='';" name="" href="javascript:;" id="s99AB6D3E3FBF404BA01A344322BFA0EE263_2_1_anchorId" onfocus="DCT.Util.setFocusField('s99AB6D3E3FBF404BA01A344322BFA0EE263_2_1_anchorId');" onclick="DCT.Util.customOnClick(this,"",{InsertTextAtCursorAction:0,showReminderMessages:0,skipScrollToTop:0});DCT.Util.setFocusField('s99AB6D3E3FBF404BA01A344322BFA0EE263_2_1_anchorId');DCT.Util.processInterviewButtonAnchor('a_s99AB6D3E3FBF404BA01A344322BFA0EE263_2_1_div',"","");" onblur=""><div class="g-btn-l"></div><div class="g-btn-m"><span class="g-btn-text" ext:qtip="" data-tip="" fieldref="Done" xmlns:ext="urn:ext">Cancel</span></div><div class="g-btn-r"></div></a></div>
I'm trying to click in a link but I'm having a hard time getting the xpath .
I have try this
Driver.FindElement(By.XPath(@"onclick,s99AB6D3E3FBF404BA01A344322BFA0EE263_2_1_anchorId")).Click();
}
and this
{Driver.FindElement(By.LinkText("Done")).Click();}
When I do this {
Driver.FindElement(By.XPath(@"onclick,s99AB6D3E3FBF404BA01A344322BFA0EE263_2_1_anchorId")).Click();
I get this error
Unable to locate an element with the xpath expression onclick,s99AB6D3E3FBF404BA01A344322BFA0EE263_2_1_anchorId because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string 'onclick,s99AB6D3E3FBF404BA01A344322BFA0EE263_2_1_anchorId' is not a valid
XPath expression.
When I try this
{
Driver.FindElement(By.LinkText("Done")).Click();}
I get this error
OpenQA.Selenium.ElementClickInterceptedException: element click intercepted: Element <a onmousemove="window.status='';" onmouseout="window.status='';" name="" href="javascript:;" id="sF6195287351B43A7BC7610F2A63626FA263_2_1_anchorId" onfocus="DCT.Util.setFocusField('sF6195287351B43A7BC7610F2A63626FA263_2_1_anchorId');" onclick="DCT.Util.customOnClick(this,"",{InsertTextAtCursorAction:0,showReminderMessages:0,skipScrollToTop:0});DCT.Util.setFocusField('sF6195287351B43A7BC7610F2A63626FA263_2_1_anchorId');DCT.Util.processInterviewButtonAnchor('a_sF6195287351B43A7BC7610F2A63626FA263_2_1_div',"","");" onblur="">...</a> is not clickable at point (310, 605). Other element would receive the click: <div id="s_p900F519A82CE4AE6BA9F48EAF71BBF95144_3_1" class="downLayout x_ statusBar">...</div>