Help with selectors

selection

#1

I am in activesg website. I am trying to book a timeslot. There two types of buttons, one is red means unavailable and another one is black means available. I am trying to use Element exists to fin black button if yes, click on it. However. it cannot identify between black or red buttons

Inspector code for red button:

Inspector for black button:

there are differences in the codes as you can see but in UiExplorer, I can’t find any difference in code…

Kindly help.

Thank you xoxo


#2

I don’t have access to the website, but seems like the “black” button should have name attribute (in this case timeslots[] while the red has no name attribute.
Maybe you can start with that?


#3

@sangasangasanga

You can compare all properties of both the buttons from Property Explorer. There has to be some difference.

Then you can use get attribute for the found property and then can make out which one to click.

Thanks,
Madhura


#4

@sangasangasanga
The html inspect image you provided are not clear. But from the image i can say, there is a separate class added for the Red Button with css property background-color: #c33825;
You can use this class name to differentiate between two buttons and create your selector. Please provide website access or more clear image displaying all properties to analyze further.
Hope this is helpful!


#5

@ajeed myactive.sg is a local website for public.

both buttons have the same name attributes.

Black button:

Red button:

both seems to have the same attributes though :frowning:

@Madhuraj yes i agree there has to be some difference but but the properties seems the same :frowning:


#6

@Madhavi sorry for the unclear html inspect image:

black button:
image

red button:
image

yes, the css property background-colour differs for both, but I cannot find that property in selector editor.

I even tried to manually add the css property background colour in but my syntax is wrong. :frowning: pls help


#7

Hi @sangasangasanga,
I think you should extend your selector to “input” element instead of “label”. The different between red and black input is based on enable/disable. Use the get attribute of “aastate” of the element to differentiate between red and black, and you may find your answer.


#8

@ajeed I have tried like you said, however the aastate is enabled for both black and red buttons.

Below is for red button:


#9

The red button has a separate class attribute :disabled
Use that to create a selector.


#10

@Madhavi it isn’t showing in the UI explorer


#11

Is its possible to share the web page link. I cant inspect and let you know.


#12

@Madhavi it is Singapore’s local public website. You can change google’s region to singapore and access that website


#13

@sangasangasangaI am able to access website. but not getting how to navigate to specified page.


#14

@Madhavi You have to login with your email id and click on facilities. And search for badminton and any click on any result and you will be able to navigate to the page i am referring to