public static Page toElement(final LoadRunnerVUVisitor visitor, final MethodCall method, final MethodcallContext ctx) {
Preconditions.checkNotNull(method);
ImmutablePage.Builder pageBuilder = ImmutablePage.builder();
final PostRequest postRequest = buildRequest(visitor, method);
if(postRequest == null) {
visitor.readSupportedFunctionWithWarn(method.getName(), ctx, "There is not any body parameter for the following LR function");
return null;
}
visitor.readSupportedFunction(method.getName(), ctx);
pageBuilder.addChilds(postRequest);
final List<Header> recordedHeaders = getHeadersFromRecordedFile(postRequest.getRecordedFiles().flatMap(RecordedFiles::recordedRequestHeaderFile));
MethodUtils.extractItemListAsStringList(visitor, method.getParameters(), EXTRARES, Optional.of(pageBuilder))
.ifPresent(stringList -> getUrlList(stringList, getUrlFromMethodParameters(visitor.getLeftBrace(), visitor.getRightBrace(), method))
.forEach(url -> pageBuilder.addChilds(buildGetRequestFromURL(visitor, url, Optional.empty(), recordedHeaders))));
return pageBuilder.name(MethodUtils.normalizeString(visitor.getLeftBrace(), visitor.getRightBrace(), method.getParameters().get(0)))
.thinkTime(0)
.build();
}