<h2>Account Management</h2>
<table class="form-table">
<tr id="password" class="user-pass1-wrap">
<th><label for="pass1">New Password</label></th>
<td>
<input class="hidden" value=" " /><!-- #24364 workaround -->
<button type="button" id="wp-generate-pw" class="button button-
secondary wp-generate-pw hide-if-no-js">Generate Password</button>
<div class="wp-pwd hide-if-js">
<span class="password-input-wrapper">
In the source code above, i want to locate the button that has id "id='wp-generate-pw". I tried to locate by xpath
classButtonXpath= "//*[@id='wp-generate-pw']"
siteClassNameElement = self.driver.find_element_by_xpath(classButtonXpath)
siteClassNameElement.click()
But I get the following error: NoSuchElementException: Message: no such element: Unable to locate element : {"method":"xpath","selector":"//*[@id='wp-generate-pw']"
I tried to locate in many ways, but still i cant
Any ideas? Thanks