-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-script.js
More file actions
43 lines (35 loc) · 1.04 KB
/
Copy pathtest-script.js
File metadata and controls
43 lines (35 loc) · 1.04 KB
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
const { Builder } = require('selenium-webdriver');
(async () => {
let driver = await new Builder()
.usingServer('https://hub-cloud.browserstack.com/wd/hub')
.withCapabilities({
'browserName': 'chrome',
'bstack:options': {
'os': 'Windows',
'osVersion': '10',
'projectName': 'BrowserStack Sample',
'buildName': 'bstack-demo',
'sessionName': 'My Test',
}
})
.build();
const executorConfig = {
action: 'setSessionName',
arguments: {
name: 'Login Test - Chrome'
}
};
await driver.executeScript('browserstack_executor: ' + JSON.stringify(executorConfig), []);
await driver.get('https://www.google.com');
const title = await driver.getTitle();
console.log('Page title is: ' + title);
const statusConfig = {
action: 'setSessionStatus',
arguments: {
status: 'passed',
reason: 'Title fetched successfully'
}
};
await driver.executeScript('browserstack_executor: ' + JSON.stringify(statusConfig), []);
await driver.quit();
})();