Page 1 of 1

Need to disable certain DOM elements on a webpage

PostPosted: Wed Dec 14, 2016 1:56 pm
by JJohnson
Afternoon.

You guys have a cool product, but I want to disable a particular DOM element in the web page I'm testing...

Can eValid do that?

Thanks

Re: Need to disable certain DOM elements on a webpage

PostPosted: Thu Dec 15, 2016 1:05 pm
by eValid
JJohnson wrote:Afternoon.

You guys have a cool product, but I want to disable a particular DOM element in the web page I'm testing...

Can eValid do that?

Thanks


Very good question; thanks for asking JJohnson.

Usually it is very impolite to manipulate the contents of the DOM of the current page in any way because such an action violates a "prime directive" of testing:

Don't modify what you are testing if you want your results to be meaningful.

That said, yes, we can imagine times when you want to disable something in a DOM element.

First, find the element in question, using eValid IndexFind/IndexFindEx commands:

http://www.e-valid.com/Products/Documen ... ement.html

http://www.e-valid.com/Products/Documen ... nt.ex.html

Next you need to look at the contents of that element so you know which "property" you are dealing with.

For this you use the PageMap for that particular index:

http://www.e-valid.com/Products/Documen ... p.gui.html

Now comes the interesting part.

You can use the DOM Element Value extraction/insertion commands:

http://www.e-valid.com/Products/Documen ... ation.html

First you use ValueSet value to put the string you want to insert into the internal variable "elementValue", and then you use the ValuePutElement wid name "frame-path" command to put your own stuff in the DOM.

WARNING: This can be unhealthy in regard to the bevavior of the web page...so caution is strongly advised.

--eValid Support