How to do Parameterization/Data driven testing using selenium in Python
Question: I'm learning automation, and i have a few set of login id's and i'm trying to
login and logout in amazon.com website and with a set of login id's and
password which are in a excel file.

Issue what i'm facing is to figure out how to hover over the "hello" in the
amazon home page and click on login. I have tried mouse_hover(), click using
xpath. However what i want to do is that after i get into the login page i
want to login using different login id's and logout again and do the same with
different login id's/password.

Here's the code i'm trying to do.

    
    
    import unittest 
    
    from selenium import webdriver
    from selenium.webdriver.support.ui import Select
    
    
    # create a new Firefox session
    driver = webdriver.Firefox()
    driver.implicitly_wait(30)
    driver.maximize_window()
    
    # navigate to the application home page
    driver.get("http://www.amazon.com/")
    
    
    if  'Sign Out' in driver.page_source:
        pass
    else:
        mouse_over("//*[@id='nav-link-yourAccount]")
        hover = driver.find_element_by_xpath("//*[@id='nav-link-yourAccount]")
        hover.click()
        logi = driver.find_element_by_xpath("//*[@id='nav-flyout-ya-signin']")
        logi.click()
    #    username = driver.find_element_by_id("login_login_username")
    #    username.send_keys("student2")
    #    password= driver.find_element_by_id("login_login_password")
    #    password.send_keys("Testing1")
    #    loginbutton=driver.find_element_by_id("login_submit")
    #    loginbutton.click()
    


Answer: Remove this line from the code

    
    
    mouse_over("//*[@id='nav-link-yourAccount]")
    

Correct x-path-:

    
    
    hover = driver.find_element_by_xpath("//*[@id='nav-link-yourAccount']")
    

rest part is ok.

