Java Selenium using browser debugging tools to implement the method _java

Source: Internet
Author: User
Tags xpath

In an automated test based on UI elements, whether it is a desktop UI Automation test or a Web UI Automation test. First we need to find and identify UI elements.

In web-based UI automation testing, testers need to understand some of the knowledge of HTML, CSS, and JavaScript, and also need to learn to use the debugging capabilities of various browsers

To find elements on a Web UI page, you must first understand the DOM structure of the page, the attributes of the elements, and even the invocation information of some JavaScript. Now the mainstream browsers are bringing a lot of powerful tools

Reading Table of Contents

    1. Google Chrome
    2. Internet Explorer or Edge
    3. Firefox's Firebug Plugin
    4. Use the Firefinder plug-in to test XPath statements

Google Chrome

Google Chrome has its own web development debugging tool, which enables you to launch this tool in 3 ways

Method One: Press F12 shortcut key

Method Two: Click on the top right corner of the icon->more tools->developer Tools menu command, open Developer Tools, and then click the "Arrow" icon, and then select the element you want to find. Take a look at the following animated demo

Method Three: Mouse over the UI element you want, click the right mouse button, select the Inspect Element menu command

We can also use Chrome to get the XPath of the element directly.

Internet Explorer or Edge

Microsoft's own browser also comes with "developer tools," Using the Tools menu or F12 to launch

Firefox's Firebug Plugin

Firefox is the best browser supported by selenium and recommends installing Firebug Plug-ins in Firefox. It's also easy to find page elements with Firebug

The Firebug method of invocation is exactly the same as the Chrome debugging tool above. This is not a detailed explanation.

Use the Firefinder plug-in to test XPath statements

In automated testing, we often write XPath, and we can use the Firefinder plug-in to verify that the XPath statement we wrote is correct

The above is the Java Selenium use browser debugging tool data collation follow-up to continue to supplement the relevant information, thank you for your support of this site!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.