I have couple of elements like this:
<g transform="matrix">
<image xlink:href="data:image/png" width="48">
</g>
<g transform="matrix">
<image xlink:href="specyfic" width="48">
</g>
<g transform="matrix">
<image xlink:href="specyfic" width="48">
</g>
I want to select element which would NOT have 'specifyc' in name. The problem is that sometimes there are couple of that NOT elements and sometimes there are none. The NON specyfic image count is always one.
I cannot accomplish that because of ':' in attribute name.
I tried this:
public static getEventIconOnMap: ElementFinder =
element.all(by.css('image[width="48"]:not(image[xlink\\:href*="specyfic"'))).last();
Your code does not make much sense to me and have no idea how to test it, but I think the following code will work. Try escaping the character like this:
public static getEventIconOnMap: ElementFinder =
element.all(by.css('image:not([xlink\:href*=specyfic]')).last();
Here is a CSS selector that works, so adjust this to your code:
image:not([xlink\:href*=specyfic]) {
// your code
}
Here is a working fiddle - it's not the exact code you are using, but I wrote it as a css selector: https://jsfiddle.net/x4gsr658/
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