April 7, 2020
Hi Team, Im trying to click on the below button but i couldn't, below is the html code i have.
I tried with xpath like
driver.FindElementByXPath("//a[contains(text(),'https']").Click
driver.FindElementByXPath("//a[@href,'#']").Click ' this work, but this clicks on sign out drop down button
driver.FindElementByXPath("//a[@class,'btn btn-default']").Click
Could some one help me in this. Thanks
<a href="#" class="btn btn-default" data-bind="click : downloadFiles, visible: $root.attachmentsViewModel.files().length > 0">
<i class="fa fa-download js-app-action-el" aria-hidden="true"></i>
Download <strong data-bind="text:$root.attachmentsViewModel.files().length">5</strong> Files
</a>
October 5, 2010
Hi Rajsha,
If it's not publicly accessible or requires a login, can you at least view the page source code and copy/paste that into a text file.
There are some techniques of locating elements that require the entire page to be known, for example, locating the nth <a> tag. Without knowing how many <a> tags, or buttons, are on the page, I can't properly use that approach.
Phil
April 7, 2020
Hi Philip,
I found the solution for the button, below is the code that i have found to click on the button.
.FindElementByXPath("//a[@class='btn btn-default'][1]").Click
Since in the 4th post you stated (locating the nth <a> tag.) this gave me the clue to find the above code. There are 5 buttons total i the web page and the button i need is located the 2nd place of a> tag.
Thank you Philip for the idea.
Thanks
Rajsha
1 Guest(s)