Skip to main content

Posts

Showing posts with the label CSS Locators Selenium Webdriver

Selenium - CSS Locators

Here are some tips to use CSS locators in your selenium automation projects. Just go through this XML structure. I going to speak about some locators to get inside elements.  <div   id = 'testdiv' > <span> <a   href = 'http://sds1' > my Link2 </a> </span> <a   href = 'http://sds' > my Link1 </a> <div   class = 'myDiv1' > <a   href = 'sds' > my link3 </a> </div> <form> <input   class = "username" > </input> <input   class = "alias" > </input> <input   type = "hidden"   name = "vid"   value = "442bbdf4-9226-41cd-801e-0d065a16cc52" > <input   type = "hidden"   name = "lf_cid"   value = "LF_c10cf6d6" > </form> </div> Direct Child: css=div > a               //This will give you 'My Link1' element Child or Su...