Selenium あるある

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on. →
seya
May 30, 2018

Selenium あるある

seya

May 30, 2018

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

34 slides
  1. Drag & Dropイベントを注入するJSで(ry browser.execute(function (selectorDrag, selectorDrop) { // function for

    triggering mouse events var fireMouseEvent = function (type, elem, centerX, centerY var evt = document.createEvent('MouseEvents'); evt.initMouseEvent(type, true, true, window, 1, 1, 1, centerX elem.dispatchEvent(evt); }; var elemDrag = document.querySelector(selectorDrag); var elemDrop = document.querySelector(selectorDrop); if (!elemDrag || !elemDrop) return false; var pos = elemDrag.getBoundingClientRect(); var center1X = Math.floor((pos.left + pos.right) / 2); ・ ・ ・

More Decks by seya

Other Decks in Programming