@@ -43,12 +43,8 @@ driver.Url = "https://www.selenium.dev/selenium/web/inputs.html";
43
43
//Get boolean value for is element display
44
44
Boolean is_email_visible = driver.FindElement(By.Name("email_input")).Displayed;
45
45
{{< /tab >}}
46
- {{< tab header="Ruby" >}}
47
- # Navigate to the url
48
- driver.get("https://www.selenium.dev/selenium/web/inputs.html ");
49
-
50
- #fetch display status
51
- val = driver.find_element(name: 'email_input').displayed?
46
+ {{< tab header="Ruby" text=true >}}
47
+ {{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L12">}}
52
48
{{< /tab >}}
53
49
{{< tab header="JavaScript" text=true >}}
54
50
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L16-L17">}}
@@ -93,13 +89,9 @@ IWebElement element = driver.FindElement(By.Name("button_input"));
93
89
// Prints true if element is enabled else returns false
94
90
System.Console.WriteLine(element.Enabled);
95
91
{{< /tab >}}
96
- {{< tab header="Ruby" >}}
97
- # Navigate to url
98
- driver.get 'https://www.selenium.dev/selenium/web/inputs.html '
99
-
100
- # Returns true if element is enabled else returns false
101
- ele = driver.find_element(name: 'button_input').enabled?
102
- {{< /tab >}}
92
+ {{< tab header="Ruby" text=true >}}
93
+ {{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L17">}}
94
+ {{< /tab >}}
103
95
{{< tab header="JavaScript" text=true >}}
104
96
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L23-L24">}}
105
97
{{< /tab >}}
@@ -139,13 +131,9 @@ driver.Navigate().GoToUrl("https://www.selenium.dev/selenium/web/inputs.html");
139
131
// Returns true if element ins checked else returns false
140
132
bool value = driver.FindElement(By.Name("checkbox_input")).Selected;
141
133
{{< /tab >}}
142
- {{< tab header="Ruby" >}}
143
- # Navigate to url
144
- driver.get 'https://www.selenium.dev/selenium/web/inputs.html '
145
-
146
- # Returns true if element is checked else returns false
147
- ele = driver.find_element(name: "checkbox_input").selected?
148
- {{< /tab >}}
134
+ {{< tab header="Ruby" text=true >}}
135
+ {{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L22">}}
136
+ {{< /tab >}}
149
137
{{< tab header="JavaScript" text=true >}}
150
138
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L30-L31">}}
151
139
{{< /tab >}}
@@ -181,13 +169,9 @@ driver.Navigate().GoToUrl("https://www.selenium.dev/selenium/web/inputs.html");
181
169
// Returns TagName of the element
182
170
string attr = driver.FindElement(By.Name("email_input")).TagName;
183
171
{{< /tab >}}
184
- {{< tab header="Ruby" >}}
185
- # Navigate to url
186
- driver.get 'https://www.selenium.dev/selenium/web/inputs.html '
187
-
188
- # Returns TagName of the element
189
- attr = driver.find_element(name: "email_input").tag_name
190
- {{< /tab >}}
172
+ {{< tab header="Ruby" text=true >}}
173
+ {{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L27">}}
174
+ {{< /tab >}}
191
175
{{< tab header="JavaScript" text=true >}}
192
176
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L37-L38">}}
193
177
{{< /tab >}}
@@ -232,13 +216,9 @@ System.Console.WriteLine(res.Location);
232
216
// Returns height, width
233
217
System.Console.WriteLine(res.Size);
234
218
{{< /tab >}}
235
- {{< tab header="Ruby" >}}
236
- # Navigate to url
237
- driver.get 'https://www.selenium.dev/selenium/web/inputs.html '
238
-
239
- # Returns height, width, x and y coordinates referenced element
240
- res = driver.find_element(name: "range_input").rect
241
- {{< /tab >}}
219
+ {{< tab header="Ruby" text=true >}}
220
+ {{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L32">}}
221
+ {{< /tab >}}
242
222
{{< tab header="JavaScript" text=true >}}
243
223
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L45">}}
244
224
{{< /tab >}}
@@ -281,14 +261,8 @@ driver.Navigate().GoToUrl("https://www.selenium.dev/selenium/web/colorPage.html"
281
261
String cssValue = driver.FindElement(By.Id("namedColor")).GetCssValue("background-color");
282
262
283
263
{{< /tab >}}
284
- {{< tab header="Ruby" >}}
285
-
286
- # Navigate to Url
287
- driver.get 'https://www.selenium.dev/selenium/web/colorPage.html '
288
-
289
- # Retrieves the computed style property 'color' of linktext
290
- cssValue = driver.find_element(: id , 'namedColor').css_value('background-color')
291
-
264
+ {{< tab header="Ruby" text=true >}}
265
+ {{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L38">}}
292
266
{{< /tab >}}
293
267
{{< tab header="JavaScript" text=true >}}
294
268
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L76-L78">}}
@@ -326,13 +300,9 @@ driver.Url="https://www.selenium.dev/selenium/web/linked_image.html";
326
300
// Retrieves the text of the element
327
301
String text = driver.FindElement(By.Id("justanotherlink")).Text;
328
302
{{< /tab >}}
329
- {{< tab header="Ruby" >}}
330
- # Navigate to url
331
- driver.get 'https://www.selenium.dev/selenium/web/linked_image.html '
332
-
333
- # Retrieves the text of the element
334
- text = driver.find_element(: id , 'justanotherlink').text
335
- {{< /tab >}}
303
+ {{< tab header="Ruby" text=true >}}
304
+ {{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L43">}}
305
+ {{< /tab >}}
336
306
{{< tab header="JavaScript" text=true >}}
337
307
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L84-L86">}}
338
308
{{< /tab >}}
@@ -377,16 +347,9 @@ IWebElement emailTxt = driver.FindElement(By.Name(("email_input")));
377
347
//fetch the value property associated with the textbox
378
348
String valueInfo = eleSelLink.GetAttribute("value");
379
349
{{< /tab >}}
380
- {{< tab header="Ruby" >}}
381
- # Navigate to the url
382
- driver.get("https://www.selenium.dev/selenium/web/inputs.html ");
383
-
384
- #identify the email text box
385
- email_element=driver.find_element(name: 'email_input')
386
-
387
- #fetch the value property associated with the textbox
388
- emailVal = email_element.attribute("value");
389
- {{< /tab >}}
350
+ {{< tab header="Ruby" text=true >}}
351
+ {{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L48">}}
352
+ {{< /tab >}}
390
353
{{< tab header="JavaScript" text=true >}}
391
354
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L55-L59">}}
392
355
{{< /tab >}}
0 commit comments