testing applications encountered another problem. I need to click element by exact text, so i found a solution where I use cssContainingText and each,then if statment to comapre text and select certain element, but I think maybe is a better solution for that purpous?
Second questions: somewhere on stackoverflow I read that
element.click().then(){
dosomething;
});
will cause that 'dosomething;' will perform after click, I try this and it doesn't work, how to make that 'dosomething;' will perform after click;
You can use by.xpath
as a selector:
By exact text
element(by.xpath('.//*[.="text"]'))
By css class with exact text
element(by.xpath('.//*[.="text" and class="some-css-class"]'))
You can find a lot of xpath examples online. There's also a tester you can use.
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