19:44:00.243 [DEBUG] i.g.h.e.r.DefaultStatsProcessor - Request 'product detail page - pdpTypeAJAX' failed for user 1: css((input[name='productCodePost'],Some(value))).findAll.transform.transformOption.noop extraction crashed: j.l.NullPointerException
I'm not sure if the NPE is happenng in my custom "random" function because I have no check on the list of elements or if the function should not be called at all because there's no list of elements and in fact the optional call after the transform had the purpose to optionally save the attribute if some value was retrieved.
Has anyone faced something similar with new java DSL?
Thanks
Michele
--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gatling/b04776a9-f339-416e-900e-31ce6954bd6fn%40googlegroups.com.
public class Foo extends Simulation {
private static Function<List<String>, String> random = list -> list.get(ThreadLocalRandom.current().nextInt(list.size()));
ScenarioBuilder scn = scenario("scn")
.exec(http("Search")
.get("https://computer-database.gatling.io/computers?f=MacBook")
.check(css("a", "href").findAll().transform(random).optional().saveAs("url"))
).exec(session -> {
System.out.println(session.getString("url"));
return session;
});
{
setUp(scn.injectOpen(atOnceUsers(1)));
}
}
To view this discussion on the web visit https://groups.google.com/d/msgid/gatling/cfe914b9-9efc-4d49-83c9-1b697364784fn%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Gatling User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gatling/_sfCtE2ua2U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gatling+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gatling/CAJw%3DiaQpnXM64HZEts%2BVyc_LAQp9pekcydN8dVsrH0V%3DUYKA1A%40mail.gmail.com.