I have a dropdown menu in this format:
<div class="btn-group open"> <button data-click-navigates-to="http://10.0.6.2:81/ui/admin/trust/certificate/68bfbf56-0b66-11e5-8316-800e8235b886/pem">Export</button> <button class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" data-original-title="" title=""> <span class="caret"></span> <span class="sr-only">Toggle Dropdown</span> </button> <ul class="dropdown-menu" role="menu"> <li><a href="http://10.0.6.2:81/ui/admin/trust/certificate/68bfbf56-0b66-11e5-8316-800e8235b886/pem">as PEM</a></li> <li><a href="http://10.0.6.2:81/ui/admin/trust/certificate/68bfbf56-0b66-11e5-8316-800e8235b886/der">as DER</a></li> <li class="divider"></li> <li><a href="http://10.0.6.2:81/ui/admin/trust/key/68bfcc12-0b66-11e5-9e94-8fff4c944e9d/public/pem">key as public PEM</a></li> <li><a href="http://10.0.6.2:81/ui/admin/trust/key/68bfcc12-0b66-11e5-9e94-8fff4c944e9d/public/der">key as public DER</a></li> <li><a href="http://10.0.6.2:81/ui/admin/trust/key/68bfcc12-0b66-11e5-9e94-8fff4c944e9d/private/pem">key as private PEM</a></li> <li><a href="http://10.0.6.2:81/ui/admin/trust/key/68bfcc12-0b66-11e5-9e94-8fff4c944e9d/private/der">key as private DER</a></li> </ul> </div>
The menu provides a means to download certificates in various formats.
I am able to locate each link using an xpath in the format:
//*[contains(text(), 'Bruce')]/..//a[contains(text(), 'as PEM')]
However, when I run the test, the certificate output is made into a URL which, of course, doesn't exist and the page returns a 404 error.
When I click on the dropdown option directly the certificate downloads as expected.
I would appreciate advice on how to emulate that result - clicking the button and having the file download as obviously my xpath is not doing what I expect it to and being honest, I don't understand why not.
Kind regards, and many thanks.