javascript - Highlight selenium clicks using AOP -


i trying plug in js element highlighting selenium framework. have code:

@aspect public class highlightaspect {  @pointcut("execution(* *.click())") private void allclickmethods(){}  @before("allclickmethods()") public void proxyclick(proceedingjoinpoint joinpoint){     webelement element = (webelement)joinpoint.gettarget();     highlight(element, "green"); }  private void highlight(webelement element, string color) {     browser.getbrowser().executescript("arguments[0].style.backgroundcolor = '"+color+"'",  element);     } } 

i initialize spring context in 'main' class like:

private static configurableapplicationcontext ctx = new classpathxmlapplicationcontext("spring_config.xml"); 

and src/main/resources/spring_config.xml looks like:

<aop:aspectj-autoproxy /> ...     <bean             id="highlightaspect"             class="com.<my_name_space>.highlightaspect">     </bean> ... 

i don't receive exceptions jvm, when add logger proxyclick see method didn't happen executed. please, me make work.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -