An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.
One of a set of tools we're offering as a way of saying thank you for being a part of the community.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class TestFrame extends JFrame {
public TestFrame() {
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(1);
}
});
JButton b = new JButton("Click me");
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEven
JPanel p = new JPanel();
p.add(new JTextField(15));
JButton button = (JButton)ae.getSource();
Container c = button.getParent();
c.add(p);
pack();
}
});
getContentPane().setLayout
getContentPane().add(b);
pack();
show();
}
public static void main(String[] args) {
new TestFrame();
}
}