
:max_bytes(150000):strip_icc()/04_Inspect_Element_Internet_Explorer-756549-4bbad38d90374e288db153b0d747a451.jpg)
String Pattern: It will contain id, the class attribute, and HTML tag.ġ- So here we would be picking up HTML tag name, id and class attribute. So for this user needs to press Command+F (In Mac) or Ctrl+F (In Windows) to open the find box.

So the first step that we need to perform is to open the find box on developer console.
#MACBOOK INSPECT ELEMENT CHROME CODE#
Recently this find box on developer tool has got a mighty hand to find HTML code using String Pattern, Xpath, and CSS Selector which earlier was not possible except searching string pattern. Option 1: Using Find box (Search in HTML Code) of Developer Tool.

These all locators are mainly used in fineElement() or findElements() method in Selenium WebDriver to identify WebElements on any of the web pages for which we are going to write the script. This is a very important section Because this is going to give you a perspective to validate your locators before using it in code. Searching and Validating already written XPath, CSS Selector Now we are moving to the next stage of this post where we are going to search specific tag, id, XPath and CSS Selector. Now we are familiar with all the ways to highlight HTML code and we are also familiar with the ways to open Chrome Developer Tool. Option 2: Open Developer Tool using any of the above-mentioned ways and Click on Select icon on developer tool and click on an element for which we want to see the HTML code. So as an automation engineer we need to write our XPath or CSS Selector by seeing various attributes of selected HTML code. In this example, we are taking google home page and here we are keeping our cursor in the search box and performing right click and selecting Inspect.Īfter Selecting the Inspect option from the context menu, It will open the element view of developer tool where it will highlight the HTML code. Option 1: Select Element and Right Click and From the context menu, Select Inspect Option. Highlighting HTML code of any element using the developer tool

#MACBOOK INSPECT ELEMENT CHROME ANDROID#
A comprehensive list of those shortcuts can be found here.The most important part in any kind of automation is, identifying various elements over which we want to perform an action and when it comes to web application or android application automation using Selenium WebDriver or Appium, we fall for Chrome, Firefox or Internet Explorer to find the right set of XPath or CSS selector. If you're a QA Analyst and would be using Chrome developer tools almost daily then it would be advantageous to become familiar with the rest of the keyboard shortcuts that the Chrome Inspect Element tool has to offer.
