I have some buttons with the same text on the same page, how can i locate one of them if I want to use both element(by.buttonText("")) and element(by.css(""))?
thanks
It depends on your approach and how your HTML tag looks like.
If there is a unique attribute, you can use that.
e.g. element(by.cssContainingText('[class="something unique"]', 'Button 1'))
Another way is to get the element or DIV holding the button.
e.g. element(by.id('DIV-ID')).element(by.buttonText('Button 1'))
If you can share your html tag, it would be much easier.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With