I want to assert if the checkbox is selected before test select. I've tried it with
if driver.find_element_by_id('checkbox-id').is_selected():
and with
if driver.find_element_by_id('checkbox-id').get_attribute('checked'):
but both ways it lasts for 10 seconds, which equals my timeout.
When I've tried to do the same with the button: 
if driver.find_element_by_id('button-id').get_attribute('disabled')
it's done instantly. Why is that?
            Asked
            
        
        
            Active
            
        
            Viewed 122 times
        
    0
            
            
        
        Ja2ger
        
- 26
 - 5
 
- 
                    Perhaps the button is more nested or farther down/up in the DOM than the checkbox? Maybe there's some flag to search from the top down or vice versa. I found this which could lead somewhere (https://stackoverflow.com/questions/28151071/selenium-takes-a-long-time-to-find-an-element-is-there-something-i-can-do). – pyknight202 Jul 23 '21 at 13:59
 - 
                    I believe it's not nesting in DOM, because it always works fine, never crashed, but every time last full timeout time. If I set timeout for 30 sec, it will wait full 30 sec on every checkbox. – Ja2ger Jul 26 '21 at 10:36