selenium-how to click on link which is nested inside div -


i have div , hyperlink this:

<div id="food-add-actions" class="actions food_dialog fd_food_dialog_s-fndds2-f41210000">   <div class="right">      <a href="javascript://" class="food-add-button add button"><span></span><span>add food log</span></a>     <a href="javascript://" class="edit button"><span></span><span>edit</span></a>   </div> </div> 

how can click on edit hyperlink?

i tried below did not worked me

driver.findelement(by.classname("edit button")).click();  

the problem have have space in by.classname.

there question similar problem here.

webdriver classname space using java

you should able select by.css selector, such as.

by.css('.right a.button')  

Comments

Popular posts from this blog

.htaccess - htaccess convert request to clean url and add slash at the end of the url -

php - facebook and github login HWIOAuthBundle and FOSUserBundle in Symfony2.1 -

hadoop - Sqoop installation export and import from postgresql -