I need help testing a JavaScript script using Selenium, but I am running into an issue.
I cannot seem to find a specific element
that I want to click on. Here is a snippet of my JS code where I am trying to click on the Shipping option. I have tried using different locators like findElement by ID, link text, CSS selector, etc., but nothing seems to be working.
<ul
className="navbar-nav bg-black sidebar sidebar-dark accordion"
id="accordionSidebar"
>
<Link
className="sidebar-brand d-flex align-items-center justify-content-center"
to="/ONE"
>
<div className="sidebar-brand-text mx-3">
<img src={logo} width={220} height={60}/>
</div>
</Link>
<hr className="sidebar-divider my-0" />
<li className={`nav-item ${props.selectedTab === 'ONE' ? 'active' : ''}`}>
<Link className="nav-link" to="/ONE">
<i className="fas fa-fw fa-th" />
<span>ONE</span>
</Link>
</li>
<li className={`nav-item ${props.selectedTab === 'TWO' ? 'active' : ''}`}>
<Link className="nav-link" to="/TWO">
<i className="fas fa-fw fa-truck" />
<span>TWO</span>
</Link>
</li>
</ul>