Need to count items on a web page - WPM or SAM?

I need to be able to verify that there are a certain number of objects on a web page. The content of the objects will change - I just need to know that there are six objects showing. Can that be done with WPM or SAM? Does it depend on what type of objects they are. I would appreciate any thoughts you may have on how to accomplish this. Thank you.

  • You can definitely do this with SAM, depending on what the objects are it may not be easy.

    I dont think there's anything good in WPM for this, but you could potentially do some weird stuff like:

    Lets say there's a webpage with 6 circles in fixed positions, when an object isn't showing it's blank space but the other circles dont rearrange

    - Add a step for verification of each circle. Transaction would fail on the first of these to not show, may not check the rest
    - Add a step verifying all 6, if not all 6 then fails, has the benefit of screenshotting whatever's missing

    - If they were clickable elements when they exist you could click each one in turn, would fail on no element if the element is actually gone.

    In SAM this would be like webrequest the website, parse it for the information you need somehow, format and return the output to a status/count/message. Some Pandas script if you're pythonic I guess.

    I imagine there's a cleaner API call to use somewhere

  • Perhaps use a script to count the number of objects then run the script using SAM.