Skip to content

Category: Questions

Cypress: if element exist then do something

I am having a problem with if element exist then do something. As an example: the problem here is that cypress aborts the test if the button doesn’t exist but that’s exactly when cypress shouldn’t abort, it should do nothing and continue. I need a solution for Answer One way you do it is to …

Remove data containing string from object

I want to ask how do I remove strings from data. Lets say I have a data: how do I remove ManufacturerName and Device Name because they do not have numbers? Answer The simplest method – if you’re happy with mutating the object rather than creating a new one – is to iterate over the object pro…

how to manipulate image before display in contenteditable element?

I need to manipulate img element before inserting it into a contenteditable div. here next is my attempt. to do .. add EditorImgs class to the image assign add src to that image Answer When using document.execCommand(‘insertImage’), the third argument should be the URL, not an image element. If yo…