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

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.
主站蜘蛛池模板: 阳江市| 洛浦县| 重庆市| 新兴县| 陇川县| 泸西县| 登封市| 冷水江市| 奉新县| 运城市| 哈密市| 亚东县| 嘉鱼县| 靖宇县| 松潘县| 彰武县| 徐闻县| 辽宁省| 梧州市| 淳安县| 周至县| 双辽市| 沙洋县| 克东县| 绵竹市| 吉林市| 渑池县| 徐闻县| 广丰县| 象州县| 金沙县| 临西县| 固镇县| 武穴市| 余姚市| 寻甸| 北流市| 永顺县| 永丰县| 宁都县| 休宁县|