Get the label and link of a button with a certain id

This is my first project with UI.Vision and I cannot figure out which command to use to check if a button with a certain id exists on a page and, if so, extract its label and link.

I presume the storeAttribute command should be used to put the actual label and link into variables. But I cannot figure out the syntax of the command. The information at storeAttribute, store Attribute - Selenium IDE Commands Tutorial is not comprehensible to me. Using the Find button is of no use, as it finds the button by the label, not by the id.

I could not find an example among the demo code to show how to do this.

Here is the relevant html:
<a id="my_button" class="button" href="/some_page/">Yes! Show me how</a>

This should work:

  • storeAttribute | id=my_button@href | a
  • storeText | id=my_button | b - for the button text (label)

Thanks. That does the trick. Is there a URL where all the attributes that storeAttribute can detect (href, etc.) are listed?

storeAttributes operates on the DOM. It can extract whatever attributes the element supports and is used by the website!

So there is no list of possible attributes hardcoded inside UI Vision. Instead the attributes depend on the element. For example an image element <img> has the attribute “height” but a link element <a> has not. For a list of all possible elements and their attributes see here: HTML attribute reference - HTML: HyperText Markup Language | MDN

If you click on an element in this table - e. g <img> - it brings you to page that lists all supported attributes. For <img> that would be <img>: The Image Embed element - HTML: HyperText Markup Language | MDN