One of my tags has the following structure:
<ul id="genres-bar" >
After a user selects the "Romance" check box, the background changes and the tag becomes:
<ul id="genres-bar" class=" romance">
I'm trying to figure out how to access and verify this attribute. Essentially, I want to confirm that the color change has taken place.
Upon inspecting the code, I noticed this specific CSS snippet being applied when the check box is clicked:
#movies.gen-romance .m-gen-R {
background-color: #FF0000;
}
The snippet disappears when the check box is unchecked.
Since I am new to HTML, CSS, XPaths, etc., I'm finding it challenging to locate similar questions or answers online. However, I did come across a solution in Java that seems relevant but I am struggling to adapt it to my issue:
access css class properties in selenium
Here is what I have tried so far in terms of locating the element:
verify {@driver.find_element(:xpath, '//*[@id="genres-bar" @class=" romance"]')}