Check state of switch button on website

Hello,

For my automation project I want to check the state of a switch button on a website.

The problem is that the ui element is always recognized identically (no matter if the button shows “ON” or “OFF”). I tried ‘get text’ (output is empty) and ‘get attribute’ (always shows “enabled”) activities to find the status of this button but it does not work (shows always the same attributes).

I want to disable the push function of this website (so I want to check if the push function is disabled, if not then click to disable).

I’m running out of ideas. Any adivce how I can check the button and disable if needed?

Here is a link to the website for an example stock: Alphabet Aktie • Alphabet A (Google Aktie) • onvista

Thanks.

Hi @SenorChang

Get Attribute may work in this scenario, try using different attribute which shows the state of the Toggle button. Indicate the element again by using Get attribute activity and search for the best attribute.

Orelse

Check after Toggling the button to ‘on’ check any of the element is changing in all over the page. If any of the element changes then use that element to check Toggle is off or on.

Hope it helps!!

Thanks. For the last part of your answer: I already tried that but the selector is always the same (no matter if it is on or off).

Which attributes could I check? I checked the ‘aastate’ attribute.

aastate attribute will not work in this scenario… @SenorChang

Search for the attribute which shows on or off, enabled or disabled, True or False. If you are not able to figure out share me the screenshot of all attributes which shows in the Get Attribute activity.

Hope you understand!!

1 Like

How can I find all the attributes? If I use get attribute activity I have to specify the attribute I want to check.

@SenorChang

try to use get visible text activity from classic menu

also in get attribute try cookie…I see the value is changing in it

image
image

cheers

1 Like

No, Click on down arrow button beside the field where you have highlighted. Then it will show the list of attributes, it’s values and descriptions. Then select the attribute which useful for you… @SenorChang

Hope you understand!!

Thank you so much! You solved my issue.

1 Like