官术网_书友最值得收藏!

Inspecting pages and elements in Google Chrome with Developer Tools

Similar to Mozilla Firefox, Google Chrome also provides a built-in feature to inspect pages and elements. We can move the mouse over a desired element on the page, right-click to open the pop-up menu, and then select the Inspect element option. This will open Developer tools in the browser, which displays information similar to that of Firefox, as shown in the following screenshot:

Similar to Firefox, we can also test XPath and CSS Selectors in Google Chrome Developer tools. Press Ctrl + F (on Mac, use Command + F) in the Elements tab. This will display a search box. Just enter XPath or CSS Selector, and matching elements will be highlighted in the tree, as shown in the following screenshot:

Chrome Developer Tools also provides a feature where you can get the XPath for an element by right-clicking on the desired element in the tree and selecting the Copy XPath option from the pop-up menu.

Similar to Mozilla Firefox and Google Chrome, you will find similar Developer tools in any major browser, including Microsoft Internet Explorer and Edge.

Browser developer tools come in really handy during the test-script development. These tools will help you to find the locator details for the elements with which you need to interact as part of the test. These tools parse the code for a page and display the information in a hierarchal tree. 

WebElements on a web page may not have all the attributes declared. It is up to the developer of the test script to select the attribute that uniquely identifies the WebElement on the web page for the automation.
主站蜘蛛池模板: 宜宾县| 浦东新区| 阜康市| 湖口县| 海南省| 资阳市| 彭州市| 崇左市| 宁波市| 改则县| 马山县| 海阳市| 庆安县| 娱乐| 太保市| 边坝县| 云梦县| 碌曲县| 信阳市| 彭阳县| 响水县| 宜阳县| 启东市| 赤水市| 定日县| 无锡市| 大冶市| 浑源县| 渝中区| 沙湾县| 石阡县| 通海县| 屏南县| 寿光市| 德惠市| 改则县| 开江县| 双江| 新巴尔虎右旗| 霍山县| 莆田市|