Execute JavaScript in selenium to perform operations on HTML elements

Now we know how to identify html elements using only selenium or execute javascript in selenium, Now let’s see how we can perform actions on different web elements like textbox – how we can enter text Button – click How to get attribute of a html element… For input buttons //js.executeScript(“return document.getElementsByName(‘commit’)[0].click();”) //or //element =…

Run JavaScript locators using Selenium & Java

We have seen how to identify web elements using selenium locators…there are situations where selenium alone can’t able to identify web elements, there we can execute javaScript commands in selenium… JavaScript has it’s own locators to identify web elements: getElementById – Returns single element that matches the ID. getElementsByName – Returns list of web elements…

JSON Intro – syntax – datatypes

  JavaScript Object Notation   Used as a lightweight data sharing format in between server and web application, and also in between web applications. This is called as fat-free version of XML :D. Easy read / write format. A collection of “key” : “value” pairs. This can be represented as object, dictionary, hash table, keyed list…