I used WebDriver sampler and wrote selenium Javascript-. I created an array and saved those elements. Now I want to know which element is maxed and minimum. so how is it found, is there any built-in function ? or any other logic?
1 Answer
What do you mean by "array"?
If this is just a "normal" JavaScript Array - it has built-in sort()
function so if the array contains just simple numeric values you can just call this function and the smallest element will have index 0
and the largest element will have the index of array size - 1
For more complex structures we need to see how does the array looks like as we're not telepathic enough to guess what do you have inside the array and what is the expected outcome.
Be aware that JMeter is a pure Java application hence you have access to full power of the JDK in case of more complex transformations/calculations are required
References: