-
Notifications
You must be signed in to change notification settings - Fork 3
/
section_3_notes.txt
47 lines (34 loc) · 918 Bytes
/
section_3_notes.txt
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
47
Section 3 - Creating our first test
1. Copy and paste exmplae code from Webdriver.io:
var webdriverio = require('webdriverio');
var options = {
desiredCapablities: {
browserName: 'chrome'
}
};
var client = webdriverio.remote(options);
client
.init()
.url('https://duckduckgo.com/')
.setValue('#search_from_input_homepage', 'WebdriverIO')
.click('#search_button_homepage')
.getTitle().then(function(title){
console.log('Title is: '+title);
})
.end();
2. Examples of sychronous and asynchronous:
Synchronous:
var result = databse.query("SELECT * FROM exampleTable");
console.log("Query has finished");
console.log("Hello world");
Output:
Query has finished
Hello world
Asynchronous:
databse.query("SELECT * FROM exampleTable", function(result){
console.log("Query has finished");
});
console.log("Hello world");
Output:
Hello world
Query has finished