Using selenium and python to create some GUI tests. I'm testing to make sure a button is present and blue ("active") before clicking on it...but sometimes the color is hex and sometimes it's rgb, so I need to check either one of those in my web driver wait.
Here's what I have:
xpath = str(locator) + "[contains(@style, 'background: rgb(223, 239, 252)')]"
WebDriverWait(self.driver, 10).until(EC.presence_of_element_located((By.XPATH, xpath)))
Now this works, but I want to add OR 'background: #2E6E9E' as a condition to move on from the wait.
I used this post to find out how to condition a wait on a css style.
Also, an example of what would be passed into locator would be
"//button[@id='button1']"
So xpath would be
"//button[@id='button1'][contains(@style, 'background: rgb(223, 239, 252)')]"