Unable to locate element for LABEL with the xpath expression -


i trying below xpath label, not able locate element.

driver.findelement(by.xpath("//div[label[contains(text(),'patient's name']]")).isenabled();

(firepath : .//*[@id='update_patient_profile']/div/div[1]/label)

below html source field.

<form id="update_patient_profile" action="/subscriber/" method="post" name="update_patient_profile">    <div class="subscriberaddpatient">      <div class="formdata nameinputs">    <label for="first_name">patient's name</label>   <input id="first_name" class="left namerule" type="text" onblur="resettxtadd($(this))" onfocus="emptyfieldadd($(this))" onclick="emptyfieldadd($(this))" name="first_name" value="first name" maxlength="24"/> 

can suggest me xpath label.

you should use below xpath

 //*[@id='update_patient_profile']//div[2]/label[.='patient's name'] 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -