java - How to Check if paginate button is enabled or disabled -
i have webpage there options navigate other pages @ bottom. example, previous,1,2,3,4,next. want check if 'next' button enabled or disabled using java selenium webdriver. can me in scenario? please refer following html snippet
<div id="paginate"> <ul class="pagination"> <li id="paginate_previous" class="paginate_button previous" tabindex="0"> <a href="#">previous</a> </li> <li class="paginate_button " tabindex="0"> <a href="#">1</a> </li> <li class="paginate_button " tabindex="0"> <a href="#">2</a> </li> <li id="paginate_next" class="paginate_button next disabled" tabindex="0"> <a href="#">next</a> </li> </ul>
find element paginate_next
id , use isenabled()
:
webelement nextpage = driver.findelement(by.id("paginate_next")); nextpage.isenabled(); // returns true/false
Comments
Post a Comment