If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Question regarding CSS classes

I am new to web programming so not sure if I am posting this in the correct forum.
My question is regarding classes in CSS, I am trying to automate a web page, that runs only on IE, using python + selenium, the issue i am facing is as follows:

There is a drop down list, which I guess dynamically populates the options, if i look at the source code the line shows up as:

with my automation script when ever the class name is present in the above line I am able to select any of the options & when it is not present, i cannot select the options in the drop down list. I wanted to know the reason why half the time class field is present & half the time it is missing?

whereas if the field "class=valid" is present in the htms/css then -"Select(self.driver.find_element_by_class_name("valid")).select_by_visible_text(dpname)" works fine.

Here is the line from the webpage which sometimes have a class name & sometimes it does not.
<SELECT name=targetFirmwareVersion groupName="Firmware Jobs" displayName="Firmware Job" nodePath="$property.nodePath.value">
<SELECT name=targetFirmwareVersion class="valid" groupName="Firmware Jobs" displayName="Firmware Job" nodePath="$property.nodePath.value">

has a class name 'class="valid"' & sometimes it doesn't, when the class field is present I am able to select the options & when it is not present I am not able to select any thing

I know this is not the right place to post a selenium/python question but my question here is to understand why this particular element of the web page sometimes has "class=valid" and sometimes it doesn't. If I get some understanding I can try to modify my python code to get this thing to work.