“Synthesizing Web Element Locators”, Kartik Bajaj, Karthik Pattabiraman, and Ali Mesbah.
In Proceedings of the IEEE/ACM International Conference on Automated Software Engineering (ASE), 11 pages, 2015
[PDF

Abstract

To programmatically interact with the user interface of a web application, element locators are used to select and retrieve elements from the Document Object Model (DOM). Element locators are used in JavaScript code, Cascading stylesheets, and test cases to interact with the runtime DOM of the webpage. Constructing these element locators is, however, challenging due to the dynamic nature of the DOM. We find that locators written by web developers can be quite complex, and involve selecting multiple DOM elements. We present an automated technique for synthesizing DOM element locators using examples provided interactively by the developer. The main insight in our approach is that the problem of synthesizing complex multi-element locators can be expressed as a constraint solving problem over the domain of valid DOM states in a web application. We implemented our synthesis technique in a tool called LED, which provides an interactive drag and drop support inside the browser for selecting positive and negative examples. We find that LED supports at least 86% of the locators used in the JavaScript code of deployed web applications, and that the locators synthesized by LED have a recall of 98% and a precision of 63%. LED is fast, taking only 0.23 seconds on average to synthesize a locator.

BibTeX

@inproceedings{kartik:ase15,
  author = {Bajaj, Kartik and Pattabiraman, Karthik and Mesbah, Ali},
  title = {Synthesizing Web Element Locators},
  booktitle = {Proceedings of the IEEE/ACM International Conference on Automated Software Engineering (ASE)},
  publisher = {IEEE Computer Society},
  pages = {11 pages},
  year = {2015},
  url = {http://salt.ece.ubc.ca/publications/docs/ase15-led.pdf}
}