Forum Discussion

abhishek1997's avatar
abhishek1997
Contributor
11 months ago
Solved

How to verify if a web element is selected or not

Hello Team,   How to verify if a web element is selected or not. For example, see the attached screenshot. If Button A is clicked Label A will be selected. So we have to verify the whether Label A ...
  • abhishek1997's avatar
    abhishek1997
    11 months ago

    I tried in different way, it worked for me

     

    def isSelected():
    ele = homePage.FindElement("xpath")
    eleClass = str(ele.getAttribute("class"))
    if "highlighted" in eleClass :
    Log.Message("The element is selected")
    else:
    Log.Message("The element is not selected")