mardi 24 mars 2015

How to test an element with protractor that has no id or class?

I am new to protractor and am trying to test various elements within the code (code that I did not write).


here is an example of some of the code:



<ul class="primary_menu"> <li class=""> <a href="http&#x3a;&#x2f;&#x2f;localhost&#x3a;8080&#x2f;web&#x2f;aaaa_customer&#x2f;home" > Home</a> </li>


as can be seen above this element does not have an ID and the class is empty. therefore how do I access this? below is some code that I wrote to access an element that had an ID:



browser.driver.findElement(by.id('header-search-link')).click();


I have also tried to access an element by.css but it did not work for the problem above.


any help would be great


Aucun commentaire:

Enregistrer un commentaire