Skip to Main Content
Mastering Selenium WebDriver 3.0 - Second Edition
book

Mastering Selenium WebDriver 3.0 - Second Edition

by Mark Collin
June 2018
Beginner to intermediate content levelBeginner to intermediate
376 pages
8h 58m
English
Packt Publishing
Content preview from Mastering Selenium WebDriver 3.0 - Second Edition

Working with offsets

Let's make the drag-and-drop code a little bit more complicated. We are going to change the main page markup and the JavaScript slightly to make it more challenging to automate.

First of all, we are going to change the HTML code by adding a <span> element in each draggable element. We are going to move the text for the element into this <span>, as follows:

 <ul> <li> <div id="one" href="#" class="draggable"> <span>one</span> </div> </li> <li> <div id="two" href="#" class="draggable"> <span>two</span> </div> </li> <li> <div id="three" href="#" class="draggable"> <span>three</span> </div> </li> <li> <div id="four" href="#" class="draggable"> <span>four</span> </div> </li> <li> <div id="five" href="#" class="draggable"> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Selenium WebDriver 3 Practical Guide - Second Edition

Selenium WebDriver 3 Practical Guide - Second Edition

Pallavi Sharma, UNMESH GUNDECHA, Satya Avasarala

Publisher Resources

ISBN: 9781788299671Supplemental Content