I have managed to login to GitHub and even automated the click on the User Dropdown menu, however cannot manage to get the innerHTML to be able to use assert to check that the user profile name matches.
below is the part of the code which is not working well. The error I am getting is that user-profile-link element cannot be found.
user_menu = browser.find_element_by_xpath(
"//*[@aria-label='View profile and more']")
user_menu.click() # till here it works to click on dropdown
# the following is not working
profile_link = browser.find_element_by_class_name("user-profile-link")
link_label = profile_link.get_attribute("innerHTML")
assert "kevincarbonaro" in link_label
Would appreciate some help to get this working and understand what I am doing wrong.
Thanks