-
Notifications
You must be signed in to change notification settings - Fork 0
/
testingframeparent.js
46 lines (32 loc) · 1.17 KB
/
testingframeparent.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* Created by evangelineireland on 1/12/15.
*/
var webdriver = require("selenium-webdriver");
function createDriver() {
var browser = new webdriver.Builder()
.usingServer('http://localhost:4444/wd/hub')
.withCapabilities({'browserName':'chrome'})
.build();
browser.manage().timeouts().setScriptTimeout(10000);
return browser;
}
var browser = createDriver();
browser.get('file:///Users/evangelineireland/Sites/CODAP-experiments/testframeparent.html');
var iframeTag = browser.findElement(webdriver.By.tagName("iframe"));
browser.switchTo().frame(iframeTag);
var trials = browser.findElement(webdriver.By.name("numTrials"));
trials.clear();
trials.sendKeys('200');
var runButton = browser.findElement(webdriver.By.name('run'));
runButton.click();
/*browser.findElement(webdriver.By.id("iframe1"));
browser.switchTo().frame("iframe1");
var trials = browser.findElement(webdriver.By.id("numTrialsId"));
trials.clear();
trials.sendKeys('200');
var runButton = browser.findElement(webdriver.By.id('runButton'));
runButton.click();*/
//browser.getTitle().then(function(title) {
// require('assert').equal('webdriver - Google Search', title);
// });
//browser.quit();