I want to check to see if a certain window is open and if it is than to proceed to log out however if it is not than to open up the widget and then logout out.
The widget is inside of another frame. I don't want to have to switch frames just to see if the widget is open if I do not have to.
My Code:
window=driver.find_element_by_id("DR44")
if window.is_displayed():
userdropdown=driver.find_element_by_id("Menu").click()
logout=driver.find_element_by_id("df456").click()
else:
LaunchMenu=driver.find_element_by_id("launch").click()
bvWidget=driver.find_element_by_id("54353sfd").click()
launch= driver.find_element_by_id("3rfs").click()
userdropdown=driver.find_element_by_id("userMdfd243l").click()
logout=driver.find_element_by_id("efdf343").click()
My error: Unable to locate element
I want to check to see if the title of the widget is found on the page if so then proceed to log out and if not open up the widget and then log out.