Page 1 of 1

Select different kind of elements with one selector

Posted: Fri Jan 17, 2020 12:34 am
by doncorleone
I'm trying to make a selector that selects a button, which is an A element, but then on a different page it is a P element for whatever reason and the selector doesn't work there. When I try to add it with Add Samples to Selector I get an error that says "These are not the same kind of elements". Is there a way to avoid this error and have the same selector select both elements?

Re: Select different kind of elements

Posted: Tue Jan 21, 2020 4:51 am
by webmaster
There are a couple of ways to do this. One is to create a selector for each kind of element, and then use the + operator whenever you want to select any of the elements:

Code: Select all

+
   ·  Select.ButtonA
   ·  Select.ButtonP
If you're using a wizard you will only be able to select a specific selector, so just select any selector and then replace it with the code above.

The other option is to double click your selector to edit the JSON code and delete the full "tag" property (all 3 lines, including the comma), and then pressing the Save button. After doing this, you'll be able to add any elements to this selector, regardless of the tag name.