This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- testing/marionette/driver.js 2017-06-07 12:34:43.000000000 +0100 | |
+++ testing/marionette/driver.js 2017-06-07 16:08:25.014583900 +0100 | |
@@ -887,7 +887,8 @@ | |
} | |
opts.timeout = timeout; | |
- let wargs = evaluate.fromJSON(args, this.curBrowser.seenEls, sb.window); | |
+ let container = {frame: sb.window, shadowRoot: undefined}; | |
+ let wargs = evaluate.fromJSON(args, this.curBrowser.seenEls, container); | |
let evaluatePromise = evaluate.sandbox(sb, script, wargs, opts); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
from selenium.webdriver.remote.webelement import WebElement | |
import os.path | |
# JavaScript: HTML5 File drop | |
# source : https://gist.github.com/florentbr/0eff8b785e85e93ecc3ce500169bd676 | |
# param1 WebElement : Drop area element | |
# param2 Double : Optional - Drop offset x relative to the top/left corner of the drop area. Center if 0. | |
# param3 Double : Optional - Drop offset y relative to the top/left corner of the drop area. Center if 0. | |
# return WebElement : File input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
import time | |
# JavaScript: HTML5 Drag and drop script | |
# param1 (WebElement): Source element to drag | |
# param2 (WebElement): Optional - target element for the drop | |
# param3 (int): Optional - Drop offset x relative to the target if any or source element | |
# param4 (int): Optional - Drop offset y relative to the target if any or source element | |
# param4 (int): Optional - Delay in milliseconds (default = 1ms) for dragging and dropping | |
# param5 (string): Optional - Key pressed (alt or ctrl or shilf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JS_TAB_FOCUS = open('tab-focus.js', 'r').read() | |
# focus the next element | |
elem_next = driver.execute_scrit(JS_TAB_FOCUS, false) | |
elem_next.send_keys("abcd") | |
# focus the previous element | |
elem_prev = driver.execute_scrit(JS_TAB_FOCUS, true) | |
elem_prev.click() |
NewerOlder