You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by minodora <mi...@yahoo.com> on 2015/10/15 07:17:50 UTC

Opacity element

Hello,

I'm trying to change the opacity to a hidden element from DOM, in JMeter
using WebDriver and JavaScript,
but all my ideas are exhausted.

Can you please tell me how do to that?
Best regards,
Minodora



--
View this message in context: http://jmeter.512774.n5.nabble.com/Opacity-element-tp5723347.html
Sent from the JMeter - Dev mailing list archive at Nabble.com.

Re: Opacity element

Posted by "glinius@live.com" <gl...@live.com>.
I don't know why would you need that as the change will only be applicable to
particular that browser session and won't persist, but just in case to give
you an idea, it can be done via  executeScript()
<https://code.google.com/p/selenium/wiki/FrequentlyAskedQuestions#Q:_How_do_I_execute_Javascript_directly?>  
method. 

For instance the following code:

 1. Opens "example.com" website
 2. Waits for 5 seconds (mention "Example Domain" black bold line)
 3. Sets its opacity to 0
 4. Waits for another 5 seconds (you won't be able to see "Example Domain"
line at this stage)


> WDS.browser.get('http://example.com')
> java.lang.Thread.sleep(5000)
> WDS.browser.executeScript('document.getElementsByTagName("h1")[0].setAttribute("style","opacity:0.0;
> -moz-opacity:0.0; filter:alpha(opacity=0)");')
> java.lang.Thread.sleep(5000)

See  The WebDriver Sampler: Your Top 10 Questions Answered
<https://blazemeter.com/blog/webdriver-sampler-your-top-10-questions-answered>  
guide for more JMeter WebDriver Sampler tips and tricks.



--
View this message in context: http://jmeter.512774.n5.nabble.com/Opacity-element-tp5723347p5723348.html
Sent from the JMeter - Dev mailing list archive at Nabble.com.