We always have concerns about writing Dynamic Xpath. So, I've listed below some ways to write xpath with example. If you face any problem, Contact Us:
1) Based on location
2) Using Single Attributes
3) Using Multiple Attributes
4) Using functions
All examples are based on following HTML Code:
input class="search-field" name="s" placeholder="Search …" title="Search for:" type="search" value=""