WEBVTT

1
00:00:00.040 --> 00:00:03.319
<v Speaker 1>All right, time to really get into web Driver EO.

2
00:00:03.759 --> 00:00:05.480
<v Speaker 2>I know you guys are super interested in this.

3
00:00:05.639 --> 00:00:09.160
<v Speaker 1>Oh yeah, definitely. This is like the framework everyone's talking.

4
00:00:08.960 --> 00:00:11.839
<v Speaker 2>About right now, and for a good reason, right, totally totally.

5
00:00:11.919 --> 00:00:14.519
<v Speaker 1>Yeah. So, you know, maybe you're starting a new project,

6
00:00:14.599 --> 00:00:16.320
<v Speaker 1>or maybe you just want to be in the no

7
00:00:16.719 --> 00:00:19.640
<v Speaker 1>whatever it is. You sent in a really cool excerpt

8
00:00:19.640 --> 00:00:23.679
<v Speaker 1>to kick things off, practical web Driver EO. Nice choice.

9
00:00:23.800 --> 00:00:25.480
<v Speaker 2>Yeah, that's a great book, and we have.

10
00:00:25.480 --> 00:00:27.320
<v Speaker 1>Our expert here to break it all down, you know,

11
00:00:27.640 --> 00:00:29.239
<v Speaker 1>especially all the technical stuff.

12
00:00:29.000 --> 00:00:31.559
<v Speaker 2>So absolutely happy to help make sense of it all perfect.

13
00:00:31.760 --> 00:00:36.920
<v Speaker 1>So web DRIVERYO. It's not just another framework, right. It's

14
00:00:36.960 --> 00:00:40.799
<v Speaker 1>built on no JS, right, which basically means like it

15
00:00:40.880 --> 00:00:42.119
<v Speaker 1>s beaks JavaScript like.

16
00:00:42.079 --> 00:00:44.679
<v Speaker 2>A native Yeah, it's perfect if your application is already

17
00:00:44.759 --> 00:00:46.479
<v Speaker 2>using a lot of javascripts exactly.

18
00:00:47.079 --> 00:00:51.520
<v Speaker 1>Okay, But like the big question, why would someone choose

19
00:00:51.520 --> 00:00:56.119
<v Speaker 1>web Driver EO over say, Selenium or even Cyprus.

20
00:00:56.439 --> 00:00:58.920
<v Speaker 2>Oh that's a great question, and that's where the practical

21
00:00:59.000 --> 00:01:01.880
<v Speaker 2>in your source really comes in. You know, Webdriver YO

22
00:01:02.039 --> 00:01:05.680
<v Speaker 2>is known for being super flexible. Sometimes Selenium it can

23
00:01:05.719 --> 00:01:09.359
<v Speaker 2>feel a little bit rigid, Okay, yeah, especially if you're

24
00:01:09.359 --> 00:01:12.599
<v Speaker 2>working with like elements on a web page that change

25
00:01:12.640 --> 00:01:15.079
<v Speaker 2>a lot, or you need to do some really complex

26
00:01:15.120 --> 00:01:18.760
<v Speaker 2>stuff right right, webdriver Yo gives you a lot more control.

27
00:01:19.040 --> 00:01:21.400
<v Speaker 1>I see, I see. And in the source they talk

28
00:01:21.480 --> 00:01:25.519
<v Speaker 1>about the package dot Jason file pretty early on. Yeah,

29
00:01:25.680 --> 00:01:30.079
<v Speaker 1>which you know, any no JS developer knows that file

30
00:01:30.280 --> 00:01:32.079
<v Speaker 1>like the back of their hand for sure. But the

31
00:01:32.159 --> 00:01:35.560
<v Speaker 1>cool thing is the book doesn't like dwell on the basics.

32
00:01:35.760 --> 00:01:37.599
<v Speaker 1>It jumps right into the stuff that can be a

33
00:01:37.640 --> 00:01:41.719
<v Speaker 1>real headache, you know, like managing all those dependencies, Oh absolutely,

34
00:01:41.760 --> 00:01:43.879
<v Speaker 1>and especially making sure all the versions play nice with

35
00:01:43.959 --> 00:01:46.000
<v Speaker 1>each other, which oh boy.

36
00:01:45.959 --> 00:01:47.599
<v Speaker 2>Yeah version mismatches a node.

37
00:01:47.640 --> 00:01:49.439
<v Speaker 1>I mean, don't even get me started.

38
00:01:49.599 --> 00:01:50.400
<v Speaker 2>It's a whole thing.

39
00:01:50.480 --> 00:01:52.719
<v Speaker 1>The author definitely seems to know where people will get

40
00:01:52.719 --> 00:01:53.200
<v Speaker 1>tripped up.

41
00:01:53.239 --> 00:01:54.560
<v Speaker 2>It's like it's like they've been there.

42
00:01:54.879 --> 00:01:58.599
<v Speaker 1>Yeah, exactly, like they've seen it all. So the source

43
00:01:59.159 --> 00:02:02.719
<v Speaker 1>it suggests like some proactive stuff you can do, like

44
00:02:03.120 --> 00:02:07.120
<v Speaker 1>using a lock file to basically freeze those dependencies. Yeah,

45
00:02:07.239 --> 00:02:10.319
<v Speaker 1>and also just like updating regularly so you don't fall too.

46
00:02:10.280 --> 00:02:12.280
<v Speaker 2>Far back for sure, keep things fresh, you know.

47
00:02:12.520 --> 00:02:15.840
<v Speaker 1>Yeah. Absolutely. Have you ever had like a full on

48
00:02:15.960 --> 00:02:17.120
<v Speaker 1>dependency nightmare?

49
00:02:17.199 --> 00:02:19.759
<v Speaker 2>Oh? Yeah, absolutely? I mean who hasn't spent hours and

50
00:02:19.840 --> 00:02:22.080
<v Speaker 2>hours debugging just to realize, oh it's.

51
00:02:21.960 --> 00:02:26.479
<v Speaker 1>Some tiny little version contact. Yeah it's the worst. But okay,

52
00:02:27.000 --> 00:02:30.560
<v Speaker 1>enough about setup woes. What really caught my eye in

53
00:02:30.599 --> 00:02:35.759
<v Speaker 1>this source was like this amazing section on locator strategies.

54
00:02:36.039 --> 00:02:38.879
<v Speaker 1>Oh yeah, it's like a masterclass in how to find

55
00:02:38.919 --> 00:02:40.759
<v Speaker 1>exactly what you need on a web page.

56
00:02:41.000 --> 00:02:44.360
<v Speaker 2>Locators. That's the foundation of any good automation framework. And

57
00:02:44.400 --> 00:02:46.919
<v Speaker 2>the source it goes into like all these different types,

58
00:02:47.039 --> 00:02:50.800
<v Speaker 2>is it the ton I, DCSs, selectors, X path, even

59
00:02:50.879 --> 00:02:52.039
<v Speaker 2>just planelink text.

60
00:02:52.159 --> 00:02:53.120
<v Speaker 1>It's pretty impressive.

61
00:02:53.439 --> 00:02:55.960
<v Speaker 2>But it's not just knowing they exist, right, it's about

62
00:02:56.039 --> 00:02:57.159
<v Speaker 2>choosing the right one.

63
00:02:57.280 --> 00:02:59.199
<v Speaker 1>Oh, that's where the strategy comes in. Yes, The source

64
00:02:59.240 --> 00:03:02.800
<v Speaker 1>talks about finding the most reliable locator, you know, like

65
00:03:03.039 --> 00:03:05.280
<v Speaker 1>if you have a logo and it has a unique ID.

66
00:03:05.520 --> 00:03:07.719
<v Speaker 2>Yeah, Like, if it's a static ID, go for it,

67
00:03:08.039 --> 00:03:09.199
<v Speaker 2>use that exactly.

68
00:03:09.400 --> 00:03:11.919
<v Speaker 1>That's probably your best bet. But if you have stuff

69
00:03:11.919 --> 00:03:14.439
<v Speaker 1>on the page that's always changing.

70
00:03:14.240 --> 00:03:16.680
<v Speaker 2>Oh, dynamically generated concept.

71
00:03:16.240 --> 00:03:18.719
<v Speaker 1>Yeah, that's when things get a little bit tricky. Totally.

72
00:03:19.159 --> 00:03:22.560
<v Speaker 2>The source it says like IDs should be your go

73
00:03:22.639 --> 00:03:25.599
<v Speaker 2>to whenever you can, because they tend to be the

74
00:03:25.599 --> 00:03:28.439
<v Speaker 2>most stable. Okay, makes sense, But when you're dealing with

75
00:03:28.520 --> 00:03:31.599
<v Speaker 2>more complex stuff CSS selectors they can give you a

76
00:03:31.599 --> 00:03:35.599
<v Speaker 2>lot more flexibility. XPath can be super powerful. But it's

77
00:03:35.639 --> 00:03:39.159
<v Speaker 2>also like if the structure of the web page changes,

78
00:03:39.240 --> 00:03:40.360
<v Speaker 2>it can break your.

79
00:03:40.199 --> 00:03:43.120
<v Speaker 1>Tests right right, it's more fragile exactly. It's almost like

80
00:03:43.159 --> 00:03:45.599
<v Speaker 1>you need to be a detective, you know, looking at

81
00:03:45.599 --> 00:03:48.680
<v Speaker 1>the web page's HTML, like searching for clues. That's a

82
00:03:48.680 --> 00:03:51.319
<v Speaker 1>great analogy, trying to find that perfect locator.

83
00:03:51.360 --> 00:03:53.960
<v Speaker 2>It's and the source it even gives you tips on

84
00:03:54.159 --> 00:03:58.280
<v Speaker 2>using your browsers, developer tools, you know, to inspect elements

85
00:03:58.319 --> 00:04:02.000
<v Speaker 2>and test out different locators. Yeah, it encourages you to experiment,

86
00:04:02.000 --> 00:04:03.759
<v Speaker 2>get your hands dirty, which I really like.

87
00:04:03.879 --> 00:04:07.400
<v Speaker 1>Yeah totally. So, okay, we've got our elements, they're all

88
00:04:07.439 --> 00:04:10.360
<v Speaker 1>locked down, Now what can we actually de with them?

89
00:04:10.439 --> 00:04:12.000
<v Speaker 2>That's where the fun begins, right.

90
00:04:12.120 --> 00:04:15.080
<v Speaker 1>This source goes deep, deep into this amazing world of

91
00:04:15.120 --> 00:04:15.960
<v Speaker 1>browser commands.

92
00:04:16.040 --> 00:04:17.920
<v Speaker 2>Oh yeah, it's like having superpowers.

93
00:04:18.040 --> 00:04:22.360
<v Speaker 1>It really is. Like switching between windows, no problem, piece

94
00:04:22.399 --> 00:04:25.519
<v Speaker 1>of cake, Taking screenshots of the entire page, like the

95
00:04:25.560 --> 00:04:28.600
<v Speaker 1>whole layout, easy psy and get this. You can even

96
00:04:28.639 --> 00:04:32.759
<v Speaker 1>inject JavaScript for those moments when you'd need ultimate control.

97
00:04:33.600 --> 00:04:35.199
<v Speaker 2>That's where things get really interesting.

98
00:04:35.360 --> 00:04:38.639
<v Speaker 1>For example, you know, you imagine you have a website

99
00:04:38.920 --> 00:04:41.120
<v Speaker 1>and you have users all over the world.

100
00:04:41.120 --> 00:04:42.639
<v Speaker 2>Oh yeah, international users.

101
00:04:42.720 --> 00:04:46.120
<v Speaker 1>The source it gives an example of how to simulate geolocation.

102
00:04:46.399 --> 00:04:48.639
<v Speaker 1>Oh wow, so you can see how the site behaves

103
00:04:48.639 --> 00:04:52.279
<v Speaker 1>if you were in like I don't know the rebuta triangle.

104
00:04:52.319 --> 00:04:53.040
<v Speaker 2>That's pretty cool.

105
00:04:53.120 --> 00:04:55.959
<v Speaker 1>Maybe not the best place for vacation, but you get

106
00:04:55.959 --> 00:04:56.480
<v Speaker 1>the idea.

107
00:04:56.680 --> 00:04:58.800
<v Speaker 2>Yeah, I get it. So that's what makes webdriver yos

108
00:04:58.839 --> 00:04:59.319
<v Speaker 2>so awesome.

109
00:04:59.439 --> 00:05:00.399
<v Speaker 1>It really is powerful.

110
00:05:00.639 --> 00:05:03.959
<v Speaker 2>It's not just about like clicking buttons or filling in forms.

111
00:05:04.040 --> 00:05:09.680
<v Speaker 2>It's about recreating real world scenarios like location based services.

112
00:05:09.199 --> 00:05:12.319
<v Speaker 1>And stuff exactly. And the source it doesn't just tell

113
00:05:12.360 --> 00:05:15.120
<v Speaker 1>you like, hey, here's this cool feature, right, it tells

114
00:05:15.120 --> 00:05:16.879
<v Speaker 1>you why it matters.

115
00:05:16.639 --> 00:05:17.399
<v Speaker 2>Yeah the way.

116
00:05:17.439 --> 00:05:21.600
<v Speaker 1>So like simulating geolocation, it's not just a neat trick.

117
00:05:22.519 --> 00:05:26.360
<v Speaker 1>It's actually super important for testing features. You know, like

118
00:05:26.560 --> 00:05:31.360
<v Speaker 1>if you have location based search, targeted content, even stuff

119
00:05:31.360 --> 00:05:32.920
<v Speaker 1>like delivery services.

120
00:05:32.519 --> 00:05:33.319
<v Speaker 2>You know makes sense.

121
00:05:33.720 --> 00:05:35.800
<v Speaker 1>It adds a whole new dimension to how you think

122
00:05:35.800 --> 00:05:36.439
<v Speaker 1>about testing.

123
00:05:36.560 --> 00:05:38.160
<v Speaker 2>It's about thinking outside the box.

124
00:05:38.279 --> 00:05:40.839
<v Speaker 1>Yeah, totally, okay, so we can find elements we can

125
00:05:40.879 --> 00:05:43.240
<v Speaker 1>interact with them, but what about making sure they actually

126
00:05:43.240 --> 00:05:44.319
<v Speaker 1>work the way they're supposed to go.

127
00:05:44.360 --> 00:05:46.480
<v Speaker 2>Oh, that's where assertions come in, right, exactly.

128
00:05:46.759 --> 00:05:48.879
<v Speaker 1>And this source goes deep into the world of web

129
00:05:48.959 --> 00:05:50.079
<v Speaker 1>drive reo assertions.

130
00:05:50.120 --> 00:05:52.399
<v Speaker 2>They're like checkpoints for your application.

131
00:05:52.560 --> 00:05:55.279
<v Speaker 1>Yeah, exactly. So it's not enough to just like poke

132
00:05:55.319 --> 00:05:57.279
<v Speaker 1>around and see if things kind of work right. You

133
00:05:57.399 --> 00:06:00.399
<v Speaker 1>got to be specific, like this element must do this.

134
00:06:00.399 --> 00:06:02.879
<v Speaker 2>Yeah, and then you check if that's actually true.

135
00:06:03.040 --> 00:06:06.759
<v Speaker 1>Yeah. And this source it goes way beyond the basics,

136
00:06:06.800 --> 00:06:09.879
<v Speaker 1>Like there are all these specialized assertions that webdriver Yo

137
00:06:09.959 --> 00:06:10.240
<v Speaker 1>give you.

138
00:06:10.319 --> 00:06:12.160
<v Speaker 2>Oh it's awesome, right, it's like going from a basic

139
00:06:12.240 --> 00:06:14.839
<v Speaker 2>checkup to a full blown medical scam.

140
00:06:15.040 --> 00:06:18.240
<v Speaker 1>Love that analogy. So the source it starts with this

141
00:06:18.279 --> 00:06:21.279
<v Speaker 1>assertion is existing. Oh yeah, I no, it checks if

142
00:06:21.319 --> 00:06:24.600
<v Speaker 1>an element is actually there, you know, in the dom.

143
00:06:24.600 --> 00:06:27.720
<v Speaker 1>But here's the thing, and the source points this out. Yeah,

144
00:06:27.720 --> 00:06:31.800
<v Speaker 1>it's subtle, is existing. It won't actually fail your test

145
00:06:32.160 --> 00:06:33.319
<v Speaker 1>if the element's missing.

146
00:06:33.839 --> 00:06:35.759
<v Speaker 2>Right. It's more about gathering information.

147
00:06:36.000 --> 00:06:36.839
<v Speaker 1>So it's like a scalp.

148
00:06:37.000 --> 00:06:38.079
<v Speaker 2>Yeah, like a little spy.

149
00:06:38.279 --> 00:06:42.040
<v Speaker 1>Hey this element there, Yep, it's there, or Nope, can't

150
00:06:42.040 --> 00:06:42.560
<v Speaker 1>find it.

151
00:06:43.000 --> 00:06:44.839
<v Speaker 2>And then you decide what to do with that.

152
00:06:44.839 --> 00:06:47.720
<v Speaker 1>Information exactly exactly. Maybe you want to wait for it

153
00:06:47.759 --> 00:06:49.560
<v Speaker 1>to show up, or maybe you want to handle it

154
00:06:49.600 --> 00:06:50.680
<v Speaker 1>gracefully if it's not there.

155
00:06:50.759 --> 00:06:53.519
<v Speaker 2>Right, It's all about flexibility and being in control, you know.

156
00:06:53.639 --> 00:06:57.959
<v Speaker 1>Totally totally, And if you do want an assertion that's like, hey,

157
00:06:58.040 --> 00:07:01.240
<v Speaker 1>this element better be here or we have a problem.

158
00:07:01.399 --> 00:07:02.519
<v Speaker 2>Yeah, like a hard stop.

159
00:07:02.759 --> 00:07:06.759
<v Speaker 1>Yeah, the source recommends to exist or to be present.

160
00:07:07.319 --> 00:07:08.639
<v Speaker 2>Those are your go to for sure.

161
00:07:08.720 --> 00:07:13.600
<v Speaker 1>Okay, what about elements that are there but they're like hiding.

162
00:07:13.360 --> 00:07:14.480
<v Speaker 2>Oh you mean visible? Yeah?

163
00:07:14.560 --> 00:07:18.839
<v Speaker 1>Yeah, visibility. As users we take it for granted totally,

164
00:07:18.879 --> 00:07:21.279
<v Speaker 1>but an automation, huge.

165
00:07:21.000 --> 00:07:25.360
<v Speaker 2>Deal huge, So that's where you use is displayed. It's

166
00:07:25.360 --> 00:07:28.360
<v Speaker 2>like saying, hey, not only should this element be there,

167
00:07:28.399 --> 00:07:31.120
<v Speaker 2>but it should be visible too, like a user could

168
00:07:31.120 --> 00:07:34.160
<v Speaker 2>actually see it makes sense, And just like before, you've

169
00:07:34.160 --> 00:07:37.839
<v Speaker 2>got a stronger version to be displayed or too visible.

170
00:07:37.959 --> 00:07:38.519
<v Speaker 1>Oh I like that.

171
00:07:38.600 --> 00:07:41.040
<v Speaker 2>Yeah, if you need to be absolutely sure.

172
00:07:40.879 --> 00:07:43.319
<v Speaker 1>Yeah totally. Oh and the source even talks about this

173
00:07:43.639 --> 00:07:46.319
<v Speaker 1>cool assertion to be visible in viewport.

174
00:07:46.560 --> 00:07:48.040
<v Speaker 2>Oh yeah that's a good one.

175
00:07:48.079 --> 00:07:50.079
<v Speaker 1>This one's like next level thing.

176
00:07:50.319 --> 00:07:52.480
<v Speaker 2>He checks if the element's not just visible, but if

177
00:07:52.480 --> 00:07:54.399
<v Speaker 2>it's actually in the part of the page the user

178
00:07:54.439 --> 00:07:55.759
<v Speaker 2>can see without scrawling right.

179
00:07:55.680 --> 00:07:57.680
<v Speaker 1>Right, because you could have a super long web page.

180
00:07:57.879 --> 00:08:00.360
<v Speaker 2>Yeah, and technically an element could be visible, but if

181
00:08:00.360 --> 00:08:02.399
<v Speaker 2>you've got to scroll down a mile to find it,

182
00:08:02.480 --> 00:08:04.319
<v Speaker 2>is it really visible exactly?

183
00:08:04.399 --> 00:08:06.360
<v Speaker 1>It's like you got to think like a user, you know,

184
00:08:06.800 --> 00:08:09.720
<v Speaker 1>how are they actually experiencing thisally? Totally? Okay, So we've

185
00:08:09.720 --> 00:08:13.759
<v Speaker 1>got presence, we've got visibility. What about elements that are

186
00:08:13.879 --> 00:08:17.920
<v Speaker 1>visible but you can't like interact with them, like a

187
00:08:17.920 --> 00:08:19.480
<v Speaker 1>button that's disabled or something.

188
00:08:19.560 --> 00:08:21.199
<v Speaker 2>Yeah, that's a good one. So the source it goes

189
00:08:21.199 --> 00:08:23.959
<v Speaker 2>into that too. You can check if an element is

190
00:08:24.079 --> 00:08:27.319
<v Speaker 2>enabled or disabled using like to be enabled and to

191
00:08:27.360 --> 00:08:28.040
<v Speaker 2>be disabled.

192
00:08:28.079 --> 00:08:30.439
<v Speaker 1>Ah okay, so you're making sure those interactive elements are

193
00:08:30.480 --> 00:08:32.799
<v Speaker 1>actually like working exactly.

194
00:08:32.960 --> 00:08:35.759
<v Speaker 2>And checkboxes, Oh, don't get me started on checkboxes.

195
00:08:35.799 --> 00:08:37.240
<v Speaker 1>It can be a real pain to test.

196
00:08:37.440 --> 00:08:42.120
<v Speaker 2>The source it highlights is selected and to be selected.

197
00:08:42.720 --> 00:08:45.360
<v Speaker 2>Use those to check if a checkboxes you know, checked

198
00:08:45.440 --> 00:08:48.879
<v Speaker 2>or not. Right might seem small, but it's important. Like

199
00:08:48.919 --> 00:08:51.480
<v Speaker 2>think about accepting terms and conditions on a website.

200
00:08:51.600 --> 00:08:53.919
<v Speaker 1>Yeah, if that checkbox isn't checked, you might not be

201
00:08:53.960 --> 00:08:55.360
<v Speaker 1>able to do anything exactly.

202
00:08:55.720 --> 00:08:58.759
<v Speaker 2>It's those little things that can make or break the

203
00:08:58.840 --> 00:09:00.879
<v Speaker 2>whole user experience, and.

204
00:09:00.840 --> 00:09:03.679
<v Speaker 1>Web Driver EO gives you the power to test all

205
00:09:03.720 --> 00:09:04.279
<v Speaker 1>of it.

206
00:09:04.279 --> 00:09:06.639
<v Speaker 2>It does, yeah, and you know it's cool the source.

207
00:09:06.720 --> 00:09:09.440
<v Speaker 2>It goes beyond just listing assertions. It actually gives you

208
00:09:09.559 --> 00:09:13.320
<v Speaker 2>a whole example of like a real world test case.

209
00:09:13.759 --> 00:09:16.480
<v Speaker 2>Oh nice, yeah, for a user loginflow, so.

210
00:09:16.440 --> 00:09:18.600
<v Speaker 1>You can see everything in action exactly.

211
00:09:18.720 --> 00:09:21.279
<v Speaker 2>You see how web driver EYO can do like end

212
00:09:21.320 --> 00:09:23.919
<v Speaker 2>to end testing, not just little isolated checks.

213
00:09:24.120 --> 00:09:27.159
<v Speaker 1>I love that. And it uses like the Page Object

214
00:09:27.200 --> 00:09:30.240
<v Speaker 1>Model POM to keep everything organized, right m h.

215
00:09:30.639 --> 00:09:31.840
<v Speaker 2>POMM is the way to go.

216
00:09:31.960 --> 00:09:34.279
<v Speaker 1>So it starts by like making sure all the important

217
00:09:34.320 --> 00:09:37.000
<v Speaker 1>elements are there, like the logo, the input fields, you know,

218
00:09:37.120 --> 00:09:39.120
<v Speaker 1>all that good stuff, and then it makes sure they're

219
00:09:39.200 --> 00:09:40.320
<v Speaker 1>visible and enabled.

220
00:09:40.519 --> 00:09:42.919
<v Speaker 2>Yeah, got to make sure they're ready for action exactly.

221
00:09:43.120 --> 00:09:45.360
<v Speaker 1>Then it's like, okay, let's simulate a user typing in

222
00:09:45.399 --> 00:09:47.799
<v Speaker 1>their username and password. And here's what I really like

223
00:09:47.840 --> 00:09:50.919
<v Speaker 1>about it. It doesn't just assume everything's going to work perfectly.

224
00:09:51.039 --> 00:09:52.320
<v Speaker 2>Oh yeah, that's key.

225
00:09:52.399 --> 00:09:56.600
<v Speaker 1>It uses those conditional statements if and else right, so

226
00:09:56.639 --> 00:09:58.919
<v Speaker 1>it can handle like if an element is missing or

227
00:09:58.960 --> 00:10:02.600
<v Speaker 1>if it's disabled. It and like log a warning or something.

228
00:10:02.639 --> 00:10:05.480
<v Speaker 2>Yeah, instead of just crashing the whole test exactly.

229
00:10:05.799 --> 00:10:08.320
<v Speaker 1>So it's like built in resilience. Yeah, you know, not

230
00:10:08.399 --> 00:10:10.720
<v Speaker 1>every cast needs to be a straight up pass or fail.

231
00:10:10.840 --> 00:10:12.720
<v Speaker 2>Sometimes you just want to know, like, hey, what could

232
00:10:12.759 --> 00:10:13.399
<v Speaker 2>go wrong here?

233
00:10:13.600 --> 00:10:17.759
<v Speaker 1>Exactly. It's about finding that sweet spot between being thorough

234
00:10:17.960 --> 00:10:19.519
<v Speaker 1>and also being realistic, you know.

235
00:10:19.600 --> 00:10:21.679
<v Speaker 2>And the source does a great job of showing you

236
00:10:21.679 --> 00:10:22.159
<v Speaker 2>how to do that.

237
00:10:22.279 --> 00:10:26.320
<v Speaker 1>Yeah, it really does. So all this talk about assertions,

238
00:10:26.399 --> 00:10:29.200
<v Speaker 1>it brings up another super important part of web Drive

239
00:10:29.279 --> 00:10:29.919
<v Speaker 1>REO testing.

240
00:10:30.399 --> 00:10:30.759
<v Speaker 2>Waits.

241
00:10:31.159 --> 00:10:35.120
<v Speaker 1>Oh yeah, waits essential. The source dedicates a good Yeah. Basically,

242
00:10:35.120 --> 00:10:37.279
<v Speaker 1>you just pause the test for a certain amount of time.

243
00:10:37.440 --> 00:10:39.480
<v Speaker 2>You have the application a chance to catch up.

244
00:10:39.679 --> 00:10:42.440
<v Speaker 1>It's like saying, okay, everyone, take a deep breath, count

245
00:10:42.480 --> 00:10:44.960
<v Speaker 1>to ten and then we'll continue. I like that, but

246
00:10:45.039 --> 00:10:48.440
<v Speaker 1>for more dynamic situations, you need something a little smarter, right.

247
00:10:48.440 --> 00:10:50.080
<v Speaker 2>Yeah, Like wait for display.

248
00:10:50.159 --> 00:10:51.720
<v Speaker 1>Oh yeah, that one's super useful.

249
00:10:51.919 --> 00:10:54.960
<v Speaker 2>It waits for an element to actually become visible on

250
00:10:55.080 --> 00:10:55.639
<v Speaker 2>the page.

251
00:10:55.840 --> 00:10:58.799
<v Speaker 1>So you're not just waiting for an arbitrary amount of time, right,

252
00:10:59.000 --> 00:11:00.919
<v Speaker 1>You're waiting for a special thing to happen.

253
00:11:01.200 --> 00:11:05.159
<v Speaker 2>That's where you see web Driver EOS flexibility and action.

254
00:11:05.279 --> 00:11:08.080
<v Speaker 1>And the cool thing is you can customize the time

255
00:11:08.120 --> 00:11:10.919
<v Speaker 1>out period so you can control how long you're willing

256
00:11:10.960 --> 00:11:13.840
<v Speaker 1>to wait, you know, and the polling interval, like how

257
00:11:13.879 --> 00:11:16.159
<v Speaker 1>often it checks to see if the condition's been met.

258
00:11:16.240 --> 00:11:19.320
<v Speaker 2>It's like fine tuning your patience level exactly exactly.

259
00:11:19.600 --> 00:11:21.919
<v Speaker 1>And then you've got weight for enabled that waits for

260
00:11:21.960 --> 00:11:24.480
<v Speaker 1>an element to become enabled so you can actually interact

261
00:11:24.519 --> 00:11:24.799
<v Speaker 1>with it.

262
00:11:24.919 --> 00:11:27.000
<v Speaker 2>Yeah, like a button that's initially grayed out.

263
00:11:27.200 --> 00:11:30.840
<v Speaker 1>Yeah know, at wait for exist. No one waits for

264
00:11:30.879 --> 00:11:33.759
<v Speaker 1>an element to like actually exist in the dom.

265
00:11:33.879 --> 00:11:36.360
<v Speaker 2>Web driver eyo gives you all the tools to handle

266
00:11:36.399 --> 00:11:38.720
<v Speaker 2>those tricky asynchronous operations.

267
00:11:39.000 --> 00:11:43.279
<v Speaker 1>It does, but the real star of the show when

268
00:11:43.279 --> 00:11:46.679
<v Speaker 1>it comes to waits is wait until.

269
00:11:46.440 --> 00:11:48.600
<v Speaker 2>Oh yeah, wait until. That's the big one.

270
00:11:48.639 --> 00:11:52.200
<v Speaker 1>This one's like ultimate flexibility. It's like a magic wand

271
00:11:52.320 --> 00:11:54.120
<v Speaker 1>you can define your own custom condition.

272
00:11:54.559 --> 00:11:57.360
<v Speaker 2>The source it gives a great example of using it

273
00:11:57.440 --> 00:12:00.720
<v Speaker 2>to wait for an element to have specific tech content.

274
00:12:00.919 --> 00:12:02.799
<v Speaker 2>Oh super powerful.

275
00:12:02.360 --> 00:12:05.960
<v Speaker 1>So like you're not limited to just the pre defined conditions, right,

276
00:12:06.600 --> 00:12:08.080
<v Speaker 1>you can get as creative as you need to be.

277
00:12:08.200 --> 00:12:11.320
<v Speaker 2>It's all about tailoring your weights to your specific.

278
00:12:10.759 --> 00:12:14.080
<v Speaker 1>Needs totally, and you still have control, like you can

279
00:12:14.120 --> 00:12:16.440
<v Speaker 1>set a time out, you can set a custom message

280
00:12:16.440 --> 00:12:18.440
<v Speaker 1>if it times out. You can even control how often

281
00:12:18.480 --> 00:12:19.519
<v Speaker 1>it checks for the condition.

282
00:12:19.960 --> 00:12:21.000
<v Speaker 2>Super customizable.

283
00:12:21.120 --> 00:12:24.600
<v Speaker 1>Okay, so weights, they're absolutely crucial, and this source does

284
00:12:24.600 --> 00:12:27.679
<v Speaker 1>a fantastic job of explaining like all the ins and

285
00:12:27.720 --> 00:12:30.279
<v Speaker 1>outs it does. Now, let's talk frameworks. We touched on

286
00:12:30.279 --> 00:12:33.440
<v Speaker 1>them briefly before, but this source it really gets into

287
00:12:33.440 --> 00:12:35.759
<v Speaker 1>the specifics of Cucumber and Typescript.

288
00:12:36.120 --> 00:12:39.159
<v Speaker 2>Yeah, frameworks they bring structure to your test code, you know,

289
00:12:39.200 --> 00:12:42.120
<v Speaker 2>they help you organize everything right, and the source it

290
00:12:42.200 --> 00:12:44.000
<v Speaker 2>highlights the benefits of each one.

291
00:12:44.120 --> 00:12:45.480
<v Speaker 1>Yeah, it does a great job of that.

292
00:12:45.799 --> 00:12:50.200
<v Speaker 2>So Cucumber it's all about that behavior driven development approach,

293
00:12:50.320 --> 00:12:54.039
<v Speaker 2>you know BDD. It's perfect for teams that really want

294
00:12:54.080 --> 00:12:56.440
<v Speaker 2>to collaborate and they want to make sure their tests

295
00:12:56.480 --> 00:13:00.440
<v Speaker 2>are understandable to like everyone involved, not just the developers.

296
00:13:00.480 --> 00:13:02.879
<v Speaker 1>Yeah, it's like bridging that gap between the technical folks

297
00:13:02.879 --> 00:13:05.519
<v Speaker 1>and the you know, the non technical folks exactly. And

298
00:13:05.559 --> 00:13:09.000
<v Speaker 1>then you've got Typescript, which brings that like lovely type

299
00:13:09.039 --> 00:13:11.080
<v Speaker 1>safety to the JavaScript world.

300
00:13:11.120 --> 00:13:14.200
<v Speaker 2>Oh yeah, Typescript is a life savers, especially when you're

301
00:13:14.200 --> 00:13:16.480
<v Speaker 2>working on a big, complex project.

302
00:13:16.600 --> 00:13:20.399
<v Speaker 1>It can really help catch errors early on. Absolutely, so

303
00:13:20.440 --> 00:13:22.879
<v Speaker 1>it really comes down to like what does your team need,

304
00:13:23.440 --> 00:13:24.519
<v Speaker 1>what are your preferences.

305
00:13:24.720 --> 00:13:27.559
<v Speaker 2>It's all about finding the right tools for the job totally.

306
00:13:28.039 --> 00:13:30.759
<v Speaker 1>And the source it even walks you through how to

307
00:13:30.840 --> 00:13:34.879
<v Speaker 1>set up both frameworks with webdriveryo like step by step.

308
00:13:35.000 --> 00:13:36.200
<v Speaker 2>Yeah, it's super helpful.

309
00:13:36.440 --> 00:13:39.679
<v Speaker 1>Okay, before we move on to the really fun stuff. Yeah,

310
00:13:39.720 --> 00:13:41.120
<v Speaker 1>actually writing the test scripts.

311
00:13:41.240 --> 00:13:42.840
<v Speaker 2>I know I'm excited for that, me too.

312
00:13:43.480 --> 00:13:47.679
<v Speaker 1>But first let's talk about the configuration file wato dot

313
00:13:47.720 --> 00:13:48.559
<v Speaker 1>com dot js.

314
00:13:48.879 --> 00:13:50.399
<v Speaker 2>Oh yeah, the control center.

315
00:13:50.480 --> 00:13:53.399
<v Speaker 1>It's like mission control for your webdriver real project.

316
00:13:54.600 --> 00:13:57.639
<v Speaker 2>And the source. It gives a great overview of all

317
00:13:57.679 --> 00:14:02.240
<v Speaker 2>the different configuration options there, from logging levels and services

318
00:14:02.240 --> 00:14:04.720
<v Speaker 2>to reporters and capabilities. It's all there.

319
00:14:04.919 --> 00:14:08.720
<v Speaker 1>It's pretty impressive. And the source it really emphasizes like

320
00:14:08.759 --> 00:14:11.559
<v Speaker 1>you got to understand what each option does you know, like,

321
00:14:11.600 --> 00:14:13.200
<v Speaker 1>how does it actually affect your tests?

322
00:14:13.279 --> 00:14:15.639
<v Speaker 2>Yeah, it's about making informed choices exactly.

323
00:14:15.679 --> 00:14:17.720
<v Speaker 1>Don't just copy and paste stuff without knowing what it's

324
00:14:17.720 --> 00:14:18.320
<v Speaker 1>doing exactly.

325
00:14:18.360 --> 00:14:20.240
<v Speaker 2>Got to understand the why behind the what.

326
00:14:20.759 --> 00:14:22.960
<v Speaker 1>And the source it does a great job of explaining

327
00:14:22.960 --> 00:14:23.679
<v Speaker 1>all those whys.

328
00:14:23.919 --> 00:14:25.799
<v Speaker 2>It's like having a personalized setup guide.

329
00:14:25.799 --> 00:14:33.080
<v Speaker 1>You know, totally, totally. So we've covered installation, locators, commands, assertions, frameworks, configuration. Wow,

330
00:14:33.120 --> 00:14:36.159
<v Speaker 1>that's a lot, I know, right, Yeah, it's incredible how

331
00:14:36.240 --> 00:14:39.000
<v Speaker 1>much this source manages to pack into like a short excerpt.

332
00:14:39.200 --> 00:14:41.720
<v Speaker 1>It's a good foundation though, it is, and I think

333
00:14:41.799 --> 00:14:44.080
<v Speaker 1>it sets us up perfectly to actually start writing those

334
00:14:44.120 --> 00:14:44.720
<v Speaker 1>test scripts.

335
00:14:44.840 --> 00:14:47.639
<v Speaker 2>Yeah, which is what we'll be diving into next time exactly.

336
00:14:48.279 --> 00:14:50.919
<v Speaker 1>But before we jump into all that practical stuff, let's

337
00:14:51.000 --> 00:14:53.320
<v Speaker 1>just pause for a minute and let everything we've talked

338
00:14:53.360 --> 00:14:54.960
<v Speaker 1>about today sink in.

339
00:14:55.279 --> 00:14:56.759
<v Speaker 2>You know, yeah, take a breath there.

340
00:14:56.840 --> 00:14:58.799
<v Speaker 1>It's a lot, but it's exciting it is.

341
00:14:59.000 --> 00:15:02.039
<v Speaker 2>And with this found foundation, I mean, you guys are

342
00:15:02.039 --> 00:15:04.720
<v Speaker 2>well on your way to becoming web driver EO masters.

343
00:15:05.000 --> 00:15:08.759
<v Speaker 2>That's the goal, and building super robust and reliable tests

344
00:15:08.799 --> 00:15:11.360
<v Speaker 2>for your applications, whatever those applications might be.

345
00:15:11.679 --> 00:15:14.639
<v Speaker 1>That's the dream, right, all right, welcome back to our

346
00:15:14.679 --> 00:15:16.200
<v Speaker 1>web driver Yo, deep dive.

347
00:15:16.360 --> 00:15:17.919
<v Speaker 2>I'm excited for this part, me too.

348
00:15:18.639 --> 00:15:23.879
<v Speaker 1>Last time we laid down all the groundwork, like installation locators, commands,

349
00:15:24.360 --> 00:15:26.279
<v Speaker 1>all the essential there's like getting a sneak peek into

350
00:15:26.320 --> 00:15:29.360
<v Speaker 1>the frameworks toolkit, right, but now it's time to see

351
00:15:29.399 --> 00:15:31.200
<v Speaker 1>how those tools actually work in practice.

352
00:15:31.360 --> 00:15:32.320
<v Speaker 2>Let's get hands on.

353
00:15:32.600 --> 00:15:36.919
<v Speaker 1>Exactly and this source practical web Driver. Yo, it's a

354
00:15:36.960 --> 00:15:39.679
<v Speaker 1>perfect guide for this part of the journey. It doesn't

355
00:15:39.679 --> 00:15:41.799
<v Speaker 1>just tell you what to do, it shows you how

356
00:15:41.799 --> 00:15:44.000
<v Speaker 1>to do it right the right way. Yeah, like how

357
00:15:44.039 --> 00:15:46.919
<v Speaker 1>to write test scripts that are clean, easy to maintain,

358
00:15:47.000 --> 00:15:50.679
<v Speaker 1>and super reliable. That's what we want exactly. So the

359
00:15:50.759 --> 00:15:53.840
<v Speaker 1>source it starts off with this design pattern that's like

360
00:15:54.000 --> 00:15:57.559
<v Speaker 1>super popular in the testing world, the Page Object model

361
00:15:57.919 --> 00:15:58.799
<v Speaker 1>or POM.

362
00:15:58.960 --> 00:16:00.320
<v Speaker 2>Oh yeah, POM got love.

363
00:16:00.879 --> 00:16:03.279
<v Speaker 1>I've heard people talk about it, but honestly, this source

364
00:16:03.360 --> 00:16:04.480
<v Speaker 1>finally made it click for me.

365
00:16:04.799 --> 00:16:06.840
<v Speaker 2>Yeah. POM can be a game changer for sure.

366
00:16:06.919 --> 00:16:10.000
<v Speaker 1>It's all about bringing order to the chaos, right, Like

367
00:16:10.360 --> 00:16:13.559
<v Speaker 1>thinking of your application is a collection of pages, and

368
00:16:13.679 --> 00:16:17.639
<v Speaker 1>each page has its own like unique elements and interactions.

369
00:16:17.799 --> 00:16:20.120
<v Speaker 2>Right And instead of having your test code all over

370
00:16:20.159 --> 00:16:24.000
<v Speaker 2>the place, you create separate classes for each page. Ah,

371
00:16:24.240 --> 00:16:26.639
<v Speaker 2>so you can keep everything organized and easy to find.

372
00:16:26.720 --> 00:16:30.000
<v Speaker 1>It's like creating a blueprint for each page exactly. So, Like,

373
00:16:30.159 --> 00:16:31.799
<v Speaker 1>if you have a log in page, you'd have a

374
00:16:31.799 --> 00:16:34.159
<v Speaker 1>log in page class. Yeah, and that class would have

375
00:16:34.200 --> 00:16:37.919
<v Speaker 1>all the locators for like the username field, the password field,

376
00:16:37.960 --> 00:16:39.080
<v Speaker 1>the log in button.

377
00:16:39.440 --> 00:16:42.799
<v Speaker 2>And the methods for actually interacting with those elements too.

378
00:16:42.960 --> 00:16:46.720
<v Speaker 1>Ah okay, okay, so instead of having like this cryptic

379
00:16:46.799 --> 00:16:49.000
<v Speaker 1>code all over your test scripts, you'd have these nice,

380
00:16:49.080 --> 00:16:50.960
<v Speaker 1>clean method calls right exactly.

381
00:16:51.000 --> 00:16:53.080
<v Speaker 2>It makes your code so much more readable.

382
00:16:53.159 --> 00:16:56.480
<v Speaker 1>It's like writing a story, yeah, about how your tests

383
00:16:56.480 --> 00:16:57.879
<v Speaker 1>are interacting with the application.

384
00:16:58.080 --> 00:17:00.799
<v Speaker 2>And if the layout of the page changes, you only

385
00:17:00.840 --> 00:17:05.279
<v Speaker 2>need to update the page object class. Oh, you don't

386
00:17:05.319 --> 00:17:06.839
<v Speaker 2>have to touch all your test scripts.

387
00:17:06.920 --> 00:17:08.799
<v Speaker 1>That makes updating so much easier.

388
00:17:08.519 --> 00:17:12.000
<v Speaker 2>Exactly, makes your code less fragile, less likely to break

389
00:17:12.160 --> 00:17:13.480
<v Speaker 2>when things change, and.

390
00:17:13.440 --> 00:17:17.720
<v Speaker 1>The source it actually walks you through an example of implementing.

391
00:17:17.319 --> 00:17:21.960
<v Speaker 2>POM, Yeah, step by step surprisingly straightforward. It is. Yeah,

392
00:17:22.000 --> 00:17:25.079
<v Speaker 2>you create a folder for your page objects, and then

393
00:17:25.119 --> 00:17:27.599
<v Speaker 2>you define a class for each page okay, with all

394
00:17:27.640 --> 00:17:29.960
<v Speaker 2>your locators and your methods nice and organized.

395
00:17:30.119 --> 00:17:33.000
<v Speaker 1>I love it. It's like building a library of reusable

396
00:17:33.000 --> 00:17:34.519
<v Speaker 1>components for your tests.

397
00:17:34.480 --> 00:17:37.799
<v Speaker 2>Exactly, And as your application grows, your library grows with it.

398
00:17:38.039 --> 00:17:44.079
<v Speaker 1>Awesome. Okay, so POM is definitely a game changer. What

399
00:17:44.519 --> 00:17:49.000
<v Speaker 1>other like golden nuggets of wisdom does this source have

400
00:17:49.119 --> 00:17:51.440
<v Speaker 1>about writing really good test scripts?

401
00:17:51.640 --> 00:17:53.559
<v Speaker 2>Well, it talks a lot about helper functions.

402
00:17:53.799 --> 00:17:56.599
<v Speaker 1>Oh, helper functions are the best, like your little helpers, like.

403
00:17:56.559 --> 00:18:00.319
<v Speaker 2>Your sidekicks, exactly. They handle those repetitive tasks that pop

404
00:18:00.400 --> 00:18:01.519
<v Speaker 2>up all the time and testing.

405
00:18:01.640 --> 00:18:03.279
<v Speaker 1>Yeah, the stuff you don't want to write over and.

406
00:18:03.240 --> 00:18:06.000
<v Speaker 2>Over again, exactly. So the source gives some good examples,

407
00:18:06.039 --> 00:18:07.319
<v Speaker 2>like a take screenshot function.

408
00:18:07.440 --> 00:18:08.240
<v Speaker 1>Oh, that's a good one.

409
00:18:08.319 --> 00:18:11.359
<v Speaker 2>Yeah. It captures a snapshot of the current page, so

410
00:18:11.359 --> 00:18:14.720
<v Speaker 2>you can see exactly what's happening exactly. Super useful for debugging,

411
00:18:14.960 --> 00:18:15.920
<v Speaker 2>you know, or.

412
00:18:15.920 --> 00:18:18.119
<v Speaker 1>If you need to document something, or even if you

413
00:18:18.119 --> 00:18:20.279
<v Speaker 1>want to make those cool time laps videos of your

414
00:18:20.319 --> 00:18:21.039
<v Speaker 1>tests running.

415
00:18:21.240 --> 00:18:24.079
<v Speaker 2>Yeah, helper functions can be as simple or as complex

416
00:18:24.119 --> 00:18:25.039
<v Speaker 2>as you need them to be.

417
00:18:25.440 --> 00:18:27.799
<v Speaker 1>The key is to find those tasks that you're doing

418
00:18:27.799 --> 00:18:31.119
<v Speaker 1>over and over again and then just like encapsulate them

419
00:18:31.119 --> 00:18:32.319
<v Speaker 1>into a reusable function.

420
00:18:32.480 --> 00:18:36.440
<v Speaker 2>Yeah, keep your code dry, you know, don't repeat yourself.

421
00:18:36.480 --> 00:18:39.519
<v Speaker 1>Exactly. It makes everything cleaner and easier to read, and

422
00:18:39.559 --> 00:18:41.240
<v Speaker 1>you're less likely to make mistakes.

423
00:18:41.640 --> 00:18:45.440
<v Speaker 2>Absolutely. So we've talked about POM for structure, we've talked

424
00:18:45.440 --> 00:18:48.960
<v Speaker 2>about helper functions for reusability. What about the data that

425
00:18:49.000 --> 00:18:50.559
<v Speaker 2>we actually use in our tests?

426
00:18:50.680 --> 00:18:52.519
<v Speaker 1>Yeah, that's a good point. You can't just use any

427
00:18:52.559 --> 00:18:53.799
<v Speaker 1>old data right right.

428
00:18:53.839 --> 00:18:57.680
<v Speaker 2>It needs to be meaningful relevant to the scenarios you're testing.

429
00:18:57.880 --> 00:19:00.400
<v Speaker 1>So like, if you're testing a log in form, you

430
00:19:00.440 --> 00:19:05.359
<v Speaker 1>wouldn't just use like test user and password as the credentials.

431
00:19:04.880 --> 00:19:07.799
<v Speaker 2>Right, No way, you'd want to test with valid email addresses,

432
00:19:07.920 --> 00:19:11.160
<v Speaker 2>different password links, special characters, all that good stuff.

433
00:19:11.279 --> 00:19:14.039
<v Speaker 1>So you're testing how the app actually behaves in the

434
00:19:14.079 --> 00:19:17.839
<v Speaker 1>real world exactly, And the source suggests storing all that

435
00:19:17.880 --> 00:19:19.599
<v Speaker 1>test data in separate files.

436
00:19:19.799 --> 00:19:21.680
<v Speaker 2>Oh yeah, that's a good practice.

437
00:19:21.720 --> 00:19:24.640
<v Speaker 1>So instead of hard coding values directly in your test scripts,

438
00:19:24.920 --> 00:19:27.839
<v Speaker 1>you'd put them in like JSON or CSV files.

439
00:19:28.359 --> 00:19:30.319
<v Speaker 2>It makes things so much easier to manage.

440
00:19:30.400 --> 00:19:32.079
<v Speaker 1>Yeah, if you need to update something, you only have

441
00:19:32.119 --> 00:19:33.880
<v Speaker 1>to change in one place exactly.

442
00:19:34.279 --> 00:19:36.440
<v Speaker 2>And you can even use different test data files for

443
00:19:36.480 --> 00:19:39.559
<v Speaker 2>different environments like development, staging, production.

444
00:19:39.759 --> 00:19:43.000
<v Speaker 1>It's all about organization, right, making your code easy to maintain.

445
00:19:43.440 --> 00:19:46.279
<v Speaker 1>Oh and the source it also talks about code readability.

446
00:19:46.480 --> 00:19:47.440
<v Speaker 2>Yeah that's important.

447
00:19:47.599 --> 00:19:49.880
<v Speaker 1>It might seem obvious, but when you're deep in the code,

448
00:19:50.319 --> 00:19:52.640
<v Speaker 1>it's easy to forget that other people might need to

449
00:19:52.680 --> 00:19:53.319
<v Speaker 1>read it someday.

450
00:19:53.519 --> 00:19:55.640
<v Speaker 2>Yeah, got to make sure your code makes sense to others,

451
00:19:55.799 --> 00:19:56.400
<v Speaker 2>not just to you.

452
00:19:58.400 --> 00:20:01.759
<v Speaker 1>It's like writing a novel that only you can understand exactly.

453
00:20:02.240 --> 00:20:05.480
<v Speaker 2>So the source reminds us to use clear variable names,

454
00:20:05.839 --> 00:20:09.759
<v Speaker 2>function names, to follow coding conventions, and to add comments.

455
00:20:10.079 --> 00:20:11.200
<v Speaker 1>Yeah, comments are key.

456
00:20:11.279 --> 00:20:12.960
<v Speaker 2>They explain why you're doing something.

457
00:20:13.359 --> 00:20:15.599
<v Speaker 1>So your code is like a pleasure to read, not

458
00:20:15.640 --> 00:20:16.200
<v Speaker 1>a nightmare.

459
00:20:16.279 --> 00:20:20.960
<v Speaker 2>Exactly. So we've got POM forra structure, helper functions for reusability,

460
00:20:21.359 --> 00:20:25.079
<v Speaker 2>meaningful test data, and readable code. It's like we built

461
00:20:25.079 --> 00:20:28.240
<v Speaker 2>a toolkit for writing amazing web drivery o tests. It

462
00:20:28.279 --> 00:20:30.519
<v Speaker 2>feels that way, and the source it leaves us with

463
00:20:30.599 --> 00:20:34.079
<v Speaker 2>this reminder that web driver eyo is always evolving, right,

464
00:20:34.200 --> 00:20:37.799
<v Speaker 2>New features come out, best practices change, The community is

465
00:20:37.839 --> 00:20:40.119
<v Speaker 2>constantly finding new and better ways to do things.

466
00:20:40.279 --> 00:20:42.799
<v Speaker 1>That's like any craft, right, you never stop learning.

467
00:20:43.160 --> 00:20:46.880
<v Speaker 2>That's what makes it so exciting. So keep exploring, keep experimenting,

468
00:20:47.359 --> 00:20:49.480
<v Speaker 2>and don't be afraid to push the limits of what

469
00:20:49.599 --> 00:20:50.799
<v Speaker 2>web drivery o can do.

470
00:20:51.240 --> 00:20:54.599
<v Speaker 1>I love that this deep dive has been incredible. It

471
00:20:54.640 --> 00:20:56.960
<v Speaker 1>has I feel like I can tackle any web driver

472
00:20:57.039 --> 00:20:57.759
<v Speaker 1>EO challenge.

473
00:20:57.799 --> 00:20:59.680
<v Speaker 2>Now I feel that way too, and don't forget the

474
00:20:59.720 --> 00:21:01.079
<v Speaker 2>commune is there to support you.

475
00:21:01.279 --> 00:21:02.319
<v Speaker 1>Yeah, that's a good point.

476
00:21:02.400 --> 00:21:05.599
<v Speaker 2>So ask questions, share your experiences, and contribute back to

477
00:21:05.599 --> 00:21:09.480
<v Speaker 2>the project if you can. Happy testing, all right, welcome

478
00:21:09.559 --> 00:21:12.039
<v Speaker 2>back for round three of our web driver Yo, deep dive.

479
00:21:12.079 --> 00:21:13.960
<v Speaker 1>I'm ready to get my hands dirty and actually write

480
00:21:13.960 --> 00:21:14.680
<v Speaker 1>some test scripts.

481
00:21:14.720 --> 00:21:16.960
<v Speaker 2>That's what we're here for, right, to put all that

482
00:21:17.000 --> 00:21:18.880
<v Speaker 2>theory into practice exactly.

483
00:21:19.359 --> 00:21:22.839
<v Speaker 1>And our source Practical web Driver eyo, it's like the

484
00:21:22.880 --> 00:21:24.480
<v Speaker 1>perfect coding buddy for this part.

485
00:21:24.839 --> 00:21:27.279
<v Speaker 2>It really is. It goes beyond just the concepts and

486
00:21:27.319 --> 00:21:30.119
<v Speaker 2>gets into the nitty gritty of like writing good code right,

487
00:21:30.200 --> 00:21:32.200
<v Speaker 2>like best practices and stuff exactly.

488
00:21:32.279 --> 00:21:35.319
<v Speaker 1>So the source jumps right in with this design pattern

489
00:21:35.759 --> 00:21:40.000
<v Speaker 1>that's like a staple in the testing order page object model.

490
00:21:40.079 --> 00:21:42.839
<v Speaker 1>Oh yeah, po eom, I've heard of it, but this

491
00:21:43.000 --> 00:21:44.839
<v Speaker 1>source it finally made it click for.

492
00:21:44.839 --> 00:21:48.400
<v Speaker 2>Me, Pom. It's all about bringing order to your test code,

493
00:21:48.480 --> 00:21:48.640
<v Speaker 2>you know.

494
00:21:48.759 --> 00:21:49.839
<v Speaker 1>Okay, yeah, I can see that.

495
00:21:49.920 --> 00:21:53.519
<v Speaker 2>Instead of having codes scattered everywhere, you create these separate

496
00:21:53.559 --> 00:21:55.920
<v Speaker 2>classes for each page of your application.

497
00:21:56.160 --> 00:21:57.160
<v Speaker 1>Ah, that makes sense.

498
00:21:57.240 --> 00:22:00.599
<v Speaker 2>So each class it holds all the location for the

499
00:22:00.799 --> 00:22:03.599
<v Speaker 2>elements on that page and all the methods for interacting

500
00:22:03.640 --> 00:22:04.000
<v Speaker 2>with them.

501
00:22:04.319 --> 00:22:06.839
<v Speaker 1>So like if you have a log in page, you'd

502
00:22:06.839 --> 00:22:08.960
<v Speaker 1>have a log in page class, and it would have

503
00:22:09.240 --> 00:22:12.079
<v Speaker 1>the locator for the username field, the password field, the

504
00:22:12.079 --> 00:22:13.160
<v Speaker 1>log in button, all.

505
00:22:13.000 --> 00:22:16.240
<v Speaker 2>That exactly, and it would also have the methods for

506
00:22:16.359 --> 00:22:19.799
<v Speaker 2>like entering the username, entering the password, clicking the button.

507
00:22:19.960 --> 00:22:23.759
<v Speaker 1>Ah okay, So instead of having like lines of code

508
00:22:23.759 --> 00:22:26.319
<v Speaker 1>define those elements and interact with them scattered throughout your

509
00:22:26.359 --> 00:22:30.079
<v Speaker 1>test scripts, you have these nice clean method calls in

510
00:22:30.119 --> 00:22:31.359
<v Speaker 1>your page.

511
00:22:31.240 --> 00:22:34.759
<v Speaker 2>Object class exactly. So your test scripts become much more readable.

512
00:22:35.000 --> 00:22:36.559
<v Speaker 2>You know, they're almost like telling a story.

513
00:22:37.039 --> 00:22:39.759
<v Speaker 1>I like that. Yeah. So if the design of the

514
00:22:39.799 --> 00:22:42.559
<v Speaker 1>log in page changes, you only have to update the

515
00:22:42.559 --> 00:22:44.000
<v Speaker 1>login page class exactly.

516
00:22:44.079 --> 00:22:45.680
<v Speaker 2>You don't have to go hunting through all your pest

517
00:22:45.680 --> 00:22:47.240
<v Speaker 2>scripts and update them individually.

518
00:22:47.519 --> 00:22:49.680
<v Speaker 1>That would be a nightmare, especially if you have a

519
00:22:49.680 --> 00:22:50.319
<v Speaker 1>lot of tests.

520
00:22:50.519 --> 00:22:54.119
<v Speaker 2>POM makes your code way more maintainable, way less likely

521
00:22:54.160 --> 00:22:56.039
<v Speaker 2>to break when things change, and you can.

522
00:22:55.960 --> 00:22:57.640
<v Speaker 1>Reuse those page object classes too.

523
00:22:57.720 --> 00:23:00.839
<v Speaker 2>Right. Oh, absolutely, If multiple tests need to interact with

524
00:23:00.880 --> 00:23:03.720
<v Speaker 2>the login page, you just use the same login page class.

525
00:23:03.880 --> 00:23:05.880
<v Speaker 1>You're not duplicating code, right.

526
00:23:05.880 --> 00:23:08.480
<v Speaker 2>Which means less chance of introducing errors.

527
00:23:09.000 --> 00:23:12.039
<v Speaker 1>Love it and this source it walks you through like

528
00:23:12.039 --> 00:23:14.920
<v Speaker 1>a step by step example of how to actually implement

529
00:23:15.000 --> 00:23:17.079
<v Speaker 1>POM in a web driver yo project.

530
00:23:17.319 --> 00:23:19.960
<v Speaker 2>Yeah, it's surprisingly straightforward once you get the hang of it.

531
00:23:20.039 --> 00:23:24.400
<v Speaker 1>Okay, so POM huge win. What other like pro tips

532
00:23:24.680 --> 00:23:28.400
<v Speaker 1>does this source have for writing really good test scripts?

533
00:23:28.920 --> 00:23:30.640
<v Speaker 2>Well, it talks a lot about helper functions.

534
00:23:30.640 --> 00:23:32.759
<v Speaker 1>Oh yeah, helper functions. Those are life savers.

535
00:23:32.799 --> 00:23:35.559
<v Speaker 2>They're like your little helpers ready to tackle those repetitive

536
00:23:35.640 --> 00:23:37.119
<v Speaker 2>tasks that pop up and testing.

537
00:23:37.160 --> 00:23:39.599
<v Speaker 1>I'm all about saving time and effort, so I'm definitely

538
00:23:39.599 --> 00:23:40.720
<v Speaker 1>a fan of helper functions.

539
00:23:40.759 --> 00:23:43.839
<v Speaker 2>The source gives a bunch of great examples, like what, well,

540
00:23:43.839 --> 00:23:45.480
<v Speaker 2>like a take screenshot fuck?

541
00:23:45.559 --> 00:23:47.680
<v Speaker 1>Oh yeah, that would be super useful, so you don't

542
00:23:47.680 --> 00:23:49.640
<v Speaker 1>have to manually take screenshots all the time.

543
00:23:49.960 --> 00:23:53.480
<v Speaker 2>Exactly. It can automatically capture a screenshot of the current

544
00:23:53.559 --> 00:23:56.519
<v Speaker 2>page and save it to a specific location.

545
00:23:56.440 --> 00:24:00.240
<v Speaker 1>Perfect for debugging or for documentation or even and like

546
00:24:00.480 --> 00:24:02.839
<v Speaker 1>if you want to make a cool time lapse video

547
00:24:02.920 --> 00:24:04.279
<v Speaker 1>of your tests running.

548
00:24:04.160 --> 00:24:07.240
<v Speaker 2>Exactly, And it gives an example of a weight for

549
00:24:07.279 --> 00:24:08.279
<v Speaker 2>pitch to load function.

550
00:24:08.480 --> 00:24:09.640
<v Speaker 1>Okay, and what does that one do?

551
00:24:09.960 --> 00:24:12.680
<v Speaker 2>It waits for a specific condition to be met before

552
00:24:12.720 --> 00:24:13.720
<v Speaker 2>the test continues.

553
00:24:13.920 --> 00:24:17.079
<v Speaker 1>Ah, so make sure the page is actually ready before

554
00:24:17.079 --> 00:24:18.880
<v Speaker 1>the test tries to do anything right.

555
00:24:18.960 --> 00:24:22.599
<v Speaker 2>That's super important for handling those asynchronous operations, you know,

556
00:24:22.920 --> 00:24:24.440
<v Speaker 2>like when things happen out of order.

557
00:24:24.839 --> 00:24:28.640
<v Speaker 1>Yeah, those can be tricky. So basically, helper functions can

558
00:24:28.680 --> 00:24:30.720
<v Speaker 1>be anything you need them to be, as long as

559
00:24:30.759 --> 00:24:32.960
<v Speaker 1>they're helping you avoid writing the same code over.

560
00:24:32.799 --> 00:24:35.759
<v Speaker 2>And over exactly. If you find yourself doing something repeatedly,

561
00:24:36.359 --> 00:24:37.880
<v Speaker 2>turn it into a helper function.

562
00:24:38.519 --> 00:24:42.000
<v Speaker 1>Makes sense. Okay, So we've got structure with POM, we've

563
00:24:42.039 --> 00:24:45.079
<v Speaker 1>got reusability with helper functions. What about the data we

564
00:24:45.160 --> 00:24:47.680
<v Speaker 1>use in our tests? Is that important? Oh?

565
00:24:47.799 --> 00:24:49.960
<v Speaker 2>The data you use is super important. You can't just

566
00:24:50.039 --> 00:24:50.880
<v Speaker 2>use random.

567
00:24:50.599 --> 00:24:52.559
<v Speaker 1>Stuff, right, It needs to be relevant to what.

568
00:24:52.519 --> 00:24:55.200
<v Speaker 2>You're testing exactly. So if you're testing a log in form,

569
00:24:55.240 --> 00:24:58.839
<v Speaker 2>you wouldn't just use like test user and password as

570
00:24:58.960 --> 00:25:00.519
<v Speaker 2>the credentials.

571
00:25:00.119 --> 00:25:02.759
<v Speaker 1>Right, No, you'd want to use a variety of data

572
00:25:02.799 --> 00:25:07.519
<v Speaker 1>like valid email addresses, different password lengths, maybe some special

573
00:25:07.599 --> 00:25:08.519
<v Speaker 1>characters to.

574
00:25:08.519 --> 00:25:12.240
<v Speaker 2>See how the application handles different inputs exactly.

575
00:25:12.680 --> 00:25:15.359
<v Speaker 1>And the source recommends keeping your test data separate.

576
00:25:15.519 --> 00:25:19.720
<v Speaker 2>Yeah, put it in external files like JSON or CSV files.

577
00:25:19.759 --> 00:25:22.000
<v Speaker 1>Ah. Okay, so instead of hard coding it in your

578
00:25:22.039 --> 00:25:24.720
<v Speaker 1>test scripts, you keep it organized in these.

579
00:25:24.559 --> 00:25:27.319
<v Speaker 2>Separate files exactly. That way, if you need to update

580
00:25:27.319 --> 00:25:29.319
<v Speaker 2>the data, you only have to change it in one place.

581
00:25:29.559 --> 00:25:32.119
<v Speaker 1>That's much easier than searching through all your test scripts.

582
00:25:32.480 --> 00:25:34.559
<v Speaker 2>And you can even use different test data files for

583
00:25:34.599 --> 00:25:38.359
<v Speaker 2>different environments like development, staging, production.

584
00:25:38.480 --> 00:25:41.359
<v Speaker 1>So you can tailor your tests to each environment exactly.

585
00:25:41.799 --> 00:25:44.039
<v Speaker 2>And speaking of tailoring, the source also talks about the

586
00:25:44.079 --> 00:25:45.880
<v Speaker 2>importance of code readability.

587
00:25:46.200 --> 00:25:49.160
<v Speaker 1>Oh, readability, that's a good one. Sometimes I get so

588
00:25:49.240 --> 00:25:51.319
<v Speaker 1>focused on making the code work I forget that other

589
00:25:51.319 --> 00:25:52.359
<v Speaker 1>people might need to read it.

590
00:25:52.519 --> 00:25:55.079
<v Speaker 2>Yeah, it's easy to get tunnel vision, but it's super

591
00:25:55.119 --> 00:25:58.000
<v Speaker 2>important to write code that's easy for others to understand.

592
00:25:58.119 --> 00:26:00.359
<v Speaker 1>It's like if you wrote a novel that own you

593
00:26:00.359 --> 00:26:03.359
<v Speaker 1>could understand, no one else could enjoy it exactly.

594
00:26:03.440 --> 00:26:06.480
<v Speaker 2>So the source it gives some good tips like using

595
00:26:06.519 --> 00:26:11.559
<v Speaker 2>clear and descriptive variable names, following coding conventions, adding comments

596
00:26:11.599 --> 00:26:13.359
<v Speaker 2>to explain why you're doing something.

597
00:26:13.599 --> 00:26:15.920
<v Speaker 1>Yeah, comments are super helpful, especially when you're coming back

598
00:26:15.920 --> 00:26:17.240
<v Speaker 1>to code you haven't looked at in a while.

599
00:26:17.240 --> 00:26:19.079
<v Speaker 2>They're like little notes to your future self.

600
00:26:19.319 --> 00:26:21.759
<v Speaker 1>Okay, so we've covered a lot in this deep dive

601
00:26:21.799 --> 00:26:26.759
<v Speaker 1>into web drive yo. From the basics of setup and locators.

602
00:26:26.160 --> 00:26:28.519
<v Speaker 2>To those powerful commands and assertions, to.

603
00:26:28.480 --> 00:26:31.400
<v Speaker 1>The art of writing clean and maintainable test scripts using

604
00:26:31.440 --> 00:26:34.480
<v Speaker 1>pom Helper functions and meaningful.

605
00:26:34.079 --> 00:26:37.839
<v Speaker 2>Test data, and always remembering that code readability is key.

606
00:26:38.119 --> 00:26:40.200
<v Speaker 1>It's been a journey. I feel like I have a

607
00:26:40.240 --> 00:26:42.640
<v Speaker 1>solid foundation in web drive Yo now me too.

608
00:26:42.839 --> 00:26:45.400
<v Speaker 2>And the best part is this is just the beginning.

609
00:26:45.920 --> 00:26:48.480
<v Speaker 2>Web drive Rio is constantly evolving.

610
00:26:48.640 --> 00:26:50.119
<v Speaker 1>That's exciting it is.

611
00:26:50.079 --> 00:26:54.000
<v Speaker 2>So keep learning, keep experimenting, and don't be afraid to

612
00:26:54.039 --> 00:26:57.519
<v Speaker 2>push the boundaries of what's possible with this awesome framework.

613
00:26:57.880 --> 00:27:00.200
<v Speaker 1>I'm ready for the challenge. And you know, one thing

614
00:27:00.240 --> 00:27:03.079
<v Speaker 1>that's been really cool throughout this whole deep dive is

615
00:27:03.119 --> 00:27:05.599
<v Speaker 1>the sense of community around webdriver io.

616
00:27:05.799 --> 00:27:07.680
<v Speaker 2>Oh yeah, the community is amazing.

617
00:27:07.759 --> 00:27:11.400
<v Speaker 1>Everyone's so helpful and supportive, always willing to share their

618
00:27:11.440 --> 00:27:12.559
<v Speaker 1>knowledge and experience.

619
00:27:12.680 --> 00:27:14.720
<v Speaker 2>It's one of the best parts of working with open

620
00:27:14.759 --> 00:27:15.519
<v Speaker 2>source software.

621
00:27:15.680 --> 00:27:20.359
<v Speaker 1>Absolutely so to everyone listening. If you're interested in learning

622
00:27:20.359 --> 00:27:23.440
<v Speaker 1>more about webdriver io, don't be afraid to reach out

623
00:27:23.480 --> 00:27:25.160
<v Speaker 1>to the community, ask questions, get.

624
00:27:25.039 --> 00:27:28.000
<v Speaker 2>Involved, and most importantly, have fun with it. Testing can

625
00:27:28.039 --> 00:27:30.160
<v Speaker 2>be a lot of fun, especially with a tool as

626
00:27:30.240 --> 00:27:31.599
<v Speaker 2>powerful as webdriver Io.

627
00:27:32.039 --> 00:27:35.680
<v Speaker 1>I couldn't agree more so until next time, happy testing everyone,
