-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdropdown.test.js
More file actions
48 lines (37 loc) · 1.34 KB
/
Copy pathdropdown.test.js
File metadata and controls
48 lines (37 loc) · 1.34 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
44
45
46
47
48
describe("drop down handling", function(){
it.skip("select drop down value by text", function(){
browser.url("https://www.facebook.com/")
$('#day').selectByVisibleText('10')
$('#month').selectByVisibleText('Apr')
$('#year').selectByVisibleText('1990')
browser.pause(3000)
})
it.skip("select drop down value by index", function(){
browser.url("https://www.facebook.com/")
$('#day').selectByIndex(3)
$('#month').selectByIndex(9)
$('#year').selectByIndex(13)
browser.pause(3000)
})
it.skip("select drop down value by attribute value", function(){
browser.url("https://www.facebook.com/")
$('#day').selectByAttribute('value',"25")
$('#month').selectByAttribute('value',"7")
$('#year').selectByAttribute('value',"2015")
browser.pause(3000)
})
it("get all the values from dropdown", function(){
browser.url("https://www.facebook.com/")
let list = $$('#month option');
console.log('length is ', list.length)
for(let i = 0; i<list.length; i++){
const element = list[i];
console.log(i, element.getText())
if(element.getText() === 'Mar'){
element.click();
break;
}
}
browser.pause(3000)
})
})