1

We are using javascript and the datepicker also contain the aria-disable=ture/false. Can anyone help me how to test either the aria-disabled=ture or false based on the condition. Please help me how to resolve this problem in selenium IDE not in selenium Web driver.

1 Answer 1

1

You have to use the store attribute command :

enter image description here

store attribute command finds the element using CSS locator and gets the attribute value mentioned after the '@' symbol. Then the value is stored to the specified variable in the value field.

For instance:

For getting the data-questionid for the below element:

<div class="question" data-questionid="42375" id="question">

we set target for store attribute as :

css=div#question@data-questionid

here,

div#question

is the css locator for a tag with div and id as question, the attribute that we need is mentioned after the @ symbol. In this case we needed data-questionid. In your case it will be aria-disabled

To validate this you can use the assert command:

The assert command expects the variable that contains an actual result as the target, and the expected value in the Value field

Remember, that for all other commands we mention the variable as ${variablename} but for assert we need to use it as variablename

2
  • thank you so much. It works for me
    – Zuni
    Commented Feb 3, 2020 at 10:44
  • Please accept the answer by clicking the tick sign
    – PDHide
    Commented Feb 3, 2020 at 11:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.