Hi pretty much new to this and I've tried to verify title using selenium with python. The title im inputting is correct however the code isn't recognizing it. I've tried it 3 different ways but im either getting element not found, a string object error or the assert is failing even though the title of the page is correct. I've commented out the first 2 i've attempted but kept them in so you can see what I tried and got the error with:
from selenium import webdriver
driver = webdriver.Chrome(executable_path="C:\webdrivers\chromedriver.exe")
driver.get(url="http://demostore.supersqa.com/my-account/")
driver.implicitly_wait(5)
#assert "My account - DemoStore" in driver.title
#the above assert doesnt work gives element not found
#driver.title().contain("My account - DemoStore")
#the above assert doesnt work gets string object error
try:
assert 'My account - DemoStore' in driver.title
print('Assertion test pass')
except Exception as e:
print('Assertion test failed', format(e))