-1

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 1

1

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

enter image description here

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:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.