Blazemeter / CitrixPlugin

A repository for the Citrix Plugin for JMeter
Apache License 2.0
11 stars 2 forks source link

End Clause 'Window Gets Foreground' to late #59

Open XerOpsNL opened 1 year ago

XerOpsNL commented 1 year ago

Citrix Interaction End Clause 'Window Gets Foreground' is to late with quick windows. (see logging below) The plugin sees de window with caption 'Voer bewegingscode in', but it still gets an timeout on "Window Gets Foreground" End Clause. The end clause works but is it is not garenteed it is still active/ on the foreground.

`2022-09-15 10:19:37,301 DEBUG o.a.j.c.GenericController: Calling next on: class org.apache.jmeter.control.GenericController 2022-09-15 10:19:37,301 DEBUG o.a.j.t.p.AbstractProperty: merging in class org.apache.jmeter.testelement.property.CollectionProperty 2022-09-15 10:19:37,301 DEBUG c.b.j.c.s.CitrixBaseSampler: Use Client from CitrixSessionHolder 2022-09-15 10:19:37,316 DEBUG c.b.j.c.s.CitrixBaseSampler: On sampler Klik verrekijker, Citrix client is running: true whereas policy is REQUIRED 2022-09-15 10:19:37,316 DEBUG c.b.j.c.c.AbstractCitrixClient: Adds a listener, Total: 1 2022-09-15 10:19:37,316 DEBUG c.b.j.c.s.CitrixBaseSampler: On sampler Klik verrekijker starts listening Citrix client before sampling operations 2022-09-15 10:19:37,316 DEBUG c.b.j.c.s.InteractionSampler: Thread Group 1-1 on sampler Klik verrekijker samples click at pos X=1240, Y=575 (rel=false) with butt=[LEFT] and modifiers=[] 2022-09-15 10:19:37,316 TRACE c.b.j.c.c.AbstractCitrixClient: Relays mouse button query with bUp=false, position=java.awt.Point[x=1240,y=575], origPosition=null, btns=[LEFT] and modifiers=[] to 1 listeners 2022-09-15 10:19:37,316 TRACE c.b.j.c.c.AbstractCitrixClient: Relays mouse button query with bUp=true, position=java.awt.Point[x=1240,y=575], origPosition=null, btns=[LEFT] and modifiers=[] to 1 listeners 2022-09-15 10:19:37,316 TRACE c.b.j.c.s.InteractionSampler: Thread Group 1-1 MOUSE_CLICK waits 996ms before next mouse click 2022-09-15 10:19:37,412 DEBUG c.b.j.c.c.w.e.SessionAdapter: onWindowForeground: windowID=66586 2022-09-15 10:19:37,413 DEBUG c.b.j.c.c.w.WinCitrixClient: Potential foreground window: 66586 2022-09-15 10:19:37,419 DEBUG c.b.j.c.c.w.e.SessionAdapter: onWindowCreate: window=[ID=66586, caption=Voer bewegingscode in, style=0x96c80000, extendedStyle=0x100101] 2022-09-15 10:19:37,428 DEBUG c.b.j.c.c.w.WinCitrixClient: Sets window info:[caption=Voer bewegingscode in, area=java.awt.Rectangle[x=527,y=407,width=229,height=131]] to window 66586 2022-09-15 10:19:37,428 DEBUG c.b.j.c.c.w.WinCitrixClient: Confirm window 66586 as foreground. 2022-09-15 10:19:37,428 DEBUG c.b.j.c.c.w.WinCitrixClient: Switches foreground to window 66586 with caption 'Voer bewegingscode in' 2022-09-15 10:19:37,428 DEBUG c.b.j.c.c.AbstractCitrixClient: Relays FOREGROUND window event to 1 listeners 2022-09-15 10:19:37,495 DEBUG o.a.j.v.ViewResultsFullVisualizer: Expanded: [[Root]] 2022-09-15 10:19:37,495 DEBUG o.a.j.v.ViewResultsFullVisualizer: Elements: [Root] 2022-09-15 10:19:37,905 DEBUG c.b.j.c.c.w.e.WindowAdapter: onLargeIconChange for window 66586: largeIconHash=d0ad781b4f866144e79f2c67d1274ba6 2022-09-15 10:19:37,906 DEBUG c.b.j.c.c.w.e.WindowAdapter: onSmallIconChange for window 66586: smallIconHash=2e741538f5592da24fe834cefc630916 2022-09-15 10:19:38,315 DEBUG c.b.j.c.c.AbstractCitrixClient: Removes a listener, Total: 0 2022-09-15 10:19:38,315 DEBUG c.b.j.c.s.CitrixBaseSampler: Stops listening Citrix client after sampling operations 2022-09-15 10:19:38,315 DEBUG c.b.j.c.s.CitrixBaseSampler: On sampler Klik verrekijker waits for end clause using WINDOW_FOREGROUND strategy 2022-09-15 10:19:38,315 DEBUG c.b.j.c.c.ClauseHelper: Builds predicate for clause WINDOW_FOREGROUND with expected value='Voer bewegingscode in' 2022-09-15 10:19:38,315 DEBUG c.b.j.c.c.AbstractCitrixClient: Adds a listener, Total: 1 2022-09-15 10:19:38,315 DEBUG c.b.j.c.c.s.c.ListeningStrategy: Starts listening Citrix windows events at 1663229978315 with timeout=10000 2022-09-15 10:19:48,327 DEBUG c.b.j.c.c.AbstractCitrixClient: Removes a listener, Total: 0 2022-09-15 10:19:48,327 DEBUG c.b.j.c.c.s.c.ListeningStrategy: Stops listening Citrix windows events at 1663229988327 with expired=true 2022-09-15 10:19:48,327 DEBUG c.b.j.c.s.CitrixBaseSampler: On sampler Klik verrekijker didn't get snapshot using strategy WINDOW_FOREGROUND 2022-09-15 10:19:48,342 DEBUG c.b.j.c.c.w.WinCitrixClient: Screenshot saved in .. 2022-09-15 10:19:48,358 DEBUG c.b.j.c.c.w.WinCitrixClient: Deletes screenshot .. 2022-09-15 10:19:48,358 DEBUG c.b.j.c.s.CitrixBaseSampler: On sampler Klik verrekijker created a default snapshot WINDOW_FOREGROUND 2022-09-15 10:19:48,412 ERROR c.b.j.c.s.CitrixBaseSampler: Sample error CLAUSE_TIMEOUT com.blazemeter.jmeter.citrix.sampler.SamplerRunException: Check of end clause has failed. at com.blazemeter.jmeter.citrix.sampler.CitrixBaseSampler.checkClause(CitrixBaseSampler.java:244) ~[citrix-jmeter-0.7.6.jar:?] at com.blazemeter.jmeter.citrix.sampler.CitrixBaseSampler.sample(CitrixBaseSampler.java:274) ~[citrix-jmeter-0.7.6.jar:?] at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651) ~[ApacheJMeter_core.jar:5.5] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570) ~[ApacheJMeter_core.jar:5.5] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501) ~[ApacheJMeter_core.jar:5.5] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268) ~[ApacheJMeter_core.jar:5.5] at java.lang.Thread.run(Thread.java:834) ~[?:?] 2022-09-15 10:19:48,412 DEBUG o.a.j.t.TestBeanHelper: Preparing class org.apache.jmeter.extractor.JSR223PostProcessor 2022-09-15 10:19:48,412 DEBUG o.a.j.t.TestBeanHelper: Setting scriptLanguage=groovy 2022-09-15 10:19:48,412 DEBUG o.a.j.t.TestBeanHelper: Setting parameters= 2022-09-15 10:19:48,412 DEBUG o.a.j.t.TestBeanHelper: Setting filename= 2022-09-15 10:19:48,412 DEBUG o.a.j.t.TestBeanHelper: Setting cacheKey=true 2022-09-15 10:19:48,412 DEBUG o.a.j.t.TestBeanHelper: Setting script=import com.blazemeter.jmeter.citrix.sampler.CitrixSessionHolder; import com.blazemeter.jmeter.citrix.client.CitrixClient; import com.blazemeter.jmeter.citrix.client.WindowInfo; import com.blazemeter.jmeter.citrix.client.handler.CitrixClientHandler;

String windowTitle = "";

log.info("@@@@@@@@@@@@@@@@@@@@@@@@@ Window titels @@@@@@@@@@@@@@@@@@@@@@@@@");

CitrixClient client = CitrixSessionHolder.getClient(); if (client != null) { log.info(sprintf("@@@@@@@@@@@@@@@@@@@@@@@@@: %s", "client != null")); log.info(sprintf("@@@@@ Klik verrekijker"));

client.getWindowInfos().forEach((window) -> {
    String title = window.getCaption();
    log.info(sprintf("@@@@@ Window: %s", title));
});

}

return true

2022-09-15 10:19:48,427 INFO o.a.j.e.J.JSR223 PostProcessor1: @@@@@@@@@@@@@@@@@@@@@@@@@ Window titels @@@@@@@@@@@@@@@@@@@@@@@@@ 2022-09-15 10:19:48,427 INFO o.a.j.e.J.JSR223 PostProcessor1: @@@@@@@@@@@@@@@@@@@@@@@@@: client != null 2022-09-15 10:19:48,427 INFO o.a.j.e.J.JSR223 PostProcessor1: @@@@@ Klik verrekijker 2022-09-15 10:19:48,427 INFO o.a.j.e.J.JSR223 PostProcessor1: @@@@@ Window: ICA Seamless Host Agent 2022-09-15 10:19:48,427 INFO o.a.j.e.J.JSR223 PostProcessor1: @@@@@ Window: C:\Windows\system32\cmd.exe 2022-09-15 10:19:48,427 INFO o.a.j.e.J.JSR223 PostProcessor1: @@@@@ Window: DONNA Planbord -- 20220905-SD-20220911 : 20220905-SD-20220911 2022-09-15 10:19:48,427 INFO o.a.j.e.J.JSR223 PostProcessor1: @@@@@ Window: 2022-09-15 10:19:48,427 INFO o.a.j.e.J.JSR223 PostProcessor1: @@@@@ Window: Voer bewegingscode in 2022-09-15 10:19:48,427 INFO o.a.j.e.J.JSR223 PostProcessor1: @@@@@ Window: Windows sign-in 2022-09-15 10:19:48,427 INFO o.a.j.e.J.JSR223 PostProcessor1: @@@@@ Window: UsrLogon.cmd 2022-09-15 10:19:48,427 DEBUG o.a.j.c.GenericController: Calling next on: class org.apache.jmeter.control.GenericController `

3dgiordano commented 1 year ago

Hi @XerOpsNL

I understand that you are trying to make a diagnosis of a problem that you are facing. Perhaps it is better that you tell us what your problem is first so that we can tell you what could be the best alternative strategy to solve it.

We discourage the use of creating waits around window states because there are identified issues around their handling. One of them is the one you mention, the timing between event and listener, another is in the internal structure of getWindowInfos which can get out of sync with the real state. It is in the plans to fix them in future versions.

But for now what we can do is give you information on how you can manage to solve it using a different strategy.