I'm working on a script using Selenium and Chrome, but I'm facing issues with selecting and clicking on two specific elements. Let's take a look at the HTML code for these elements:
HTML of Element 1:
<td class="menuItem" id="tWlans" style=""><a href="frameWlan.html"
id="cWlans" accesskey="W" onmouseover="highlight('Wlans')"
onmouseout="removeHighlight('Wlans')" onclick="selectTab('Wlans')"
onfocus="highlight('Wlans')" onblur="removeHighlight('Wlans')"
target="mainFrame"><u>W</u>LANs</a></td>
HTML of Element 2:
<td class="listNoPad">
<input type="TEXT" name="1.6.7.wlan_id" class="statictextboxlink"
onclick="editThisWlan(this.value,this.name)" readonly="" size="7" value="7">
</td>
I've attempted to select the element by both id and XPath, but neither method seems to work.
function siteNavigate() {
sleep(4500);
driver.findElement(By.xpath('//*[@id="cWlans"]')).click();
//driver.findElement(By.id('cWlans')).click();
}
Any help or suggestions would be greatly appreciated.
Edit:
// JavaScript functions
...
// CSS styles
...
// Additional scripts
...
Edit 2: Error message from Node.js:
// Error details
...