lundi 26 février 2018

Unable to locate element using Selenium Webdriver

I am having sticky nav bar which has few list elements where each contains href element. When I tried to locate element I am getting the error. Following is my HTML code :

 <div class="nav" id="sticky">
                <div class="container">
                    <ul class="main-nav">
                        <li><a href="Dashboard.aspx">Dashboard</a></li>
                        <li><a href="../MEFAcademicDash/StudentUI/StudentHome.aspx"
                            title="Academic Dashboard">Academic</a></li>
                        <li><a href="Notices.aspx">Notices</a></li>

I want to locate Academic through Webdriver, I am getting the error like this Unable to locate the element. org.openqa.selenium.NoSuchElementException: Unable to locate element: /html/body/div/form/div[5]/div[1]/ul/li[2]/a

Aucun commentaire:

Enregistrer un commentaire