@@ -37,11 +37,7 @@ driver.get("https://www.selenium.dev/selenium/web/inputs.html")
37
37
is_email_visible = driver.find_element(By.NAME, "email_input").is_displayed()
38
38
{{< /tab >}}
39
39
{{< tab header="CSharp" >}}
40
- //Navigate to the url
41
- driver.Url = "https://www.selenium.dev/selenium/web/inputs.html ";
42
-
43
- //Get boolean value for is element display
44
- Boolean is_email_visible = driver.FindElement(By.Name("email_input")).Displayed;
40
+ {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L18-L23" >}}
45
41
{{< /tab >}}
46
42
{{< tab header="Ruby" text=true >}}
47
43
{{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L12">}}
@@ -79,16 +75,9 @@ driver.get("https://www.selenium.dev/selenium/web/inputs.html")
79
75
# Returns true if element is enabled else returns false
80
76
value = driver.find_element(By.NAME, 'button_input').is_enabled()
81
77
{{< /tab >}}
82
- {{< tab header="CSharp" >}}
83
- // Navigate to Url
84
- driver.Navigate().GoToUrl("https://www.selenium.dev/selenium/web/inputs.html ");
85
-
86
- // Store the WebElement
87
- IWebElement element = driver.FindElement(By.Name("button_input"));
88
-
89
- // Prints true if element is enabled else returns false
90
- System.Console.WriteLine(element.Enabled);
91
- {{< /tab >}}
78
+ {{< tab header="CSharp" >}}
79
+ {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L25-L28" >}}
80
+ {{< /tab >}}
92
81
{{< tab header="Ruby" text=true >}}
93
82
{{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L17">}}
94
83
{{< /tab >}}
@@ -124,13 +113,9 @@ driver.get("https://www.selenium.dev/selenium/web/inputs.html")
124
113
# Returns true if element is checked else returns false
125
114
value = driver.find_element(By.NAME, "checkbox_input").is_selected()
126
115
{{< /tab >}}
127
- {{< tab header="CSharp" >}}
128
- // Navigate to Url
129
- driver.Navigate().GoToUrl("https://www.selenium.dev/selenium/web/inputs.html ");
130
-
131
- // Returns true if element ins checked else returns false
132
- bool value = driver.FindElement(By.Name("checkbox_input")).Selected;
133
- {{< /tab >}}
116
+ {{< tab header="CSharp" >}}
117
+ {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L30-L33" >}}
118
+ {{< /tab >}}
134
119
{{< tab header="Ruby" text=true >}}
135
120
{{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L22">}}
136
121
{{< /tab >}}
@@ -162,13 +147,9 @@ driver.get("https://www.selenium.dev/selenium/web/inputs.html")
162
147
# Returns TagName of the element
163
148
attr = driver.find_element(By.NAME, "email_input").tag_name
164
149
{{< /tab >}}
165
- {{< tab header="CSharp" >}}
166
- // Navigate to Url
167
- driver.Navigate().GoToUrl("https://www.selenium.dev/selenium/web/inputs.html ");
168
-
169
- // Returns TagName of the element
170
- string attr = driver.FindElement(By.Name("email_input")).TagName;
171
- {{< /tab >}}
150
+ {{< tab header="CSharp" >}}
151
+ {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L35-L38" >}}
152
+ {{< /tab >}}
172
153
{{< tab header="Ruby" text=true >}}
173
154
{{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L27">}}
174
155
{{< /tab >}}
@@ -206,16 +187,9 @@ driver.get("https://www.selenium.dev/selenium/web/inputs.html")
206
187
# Returns height, width, x and y coordinates referenced element
207
188
res = driver.find_element(By.NAME, "range_input").rect
208
189
{{< /tab >}}
209
- {{< tab header="CSharp" >}}
210
- // Navigate to Url
211
- driver.Navigate().GoToUrl("https://www.selenium.dev/selenium/web/inputs.html ");
212
-
213
- var res = driver.FindElement(By.Name("range_input"));
214
- // Return x and y coordinates referenced element
215
- System.Console.WriteLine(res.Location);
216
- // Returns height, width
217
- System.Console.WriteLine(res.Size);
218
- {{< /tab >}}
190
+ {{< tab header="CSharp" >}}
191
+ {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L40-L47" >}}
192
+ {{< /tab >}}
219
193
{{< tab header="Ruby" text=true >}}
220
194
{{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L32">}}
221
195
{{< /tab >}}
@@ -250,17 +224,10 @@ driver.get('https://www.selenium.dev/selenium/web/colorPage.html')
250
224
251
225
# Retrieves the computed style property 'color' of linktext
252
226
cssValue = driver.find_element(By.ID, "namedColor").value_of_css_property('background-color')
253
-
254
- {{< /tab >}}
255
- {{< tab header="CSharp" >}}
256
-
257
- // Navigate to Url
258
- driver.Navigate().GoToUrl("https://www.selenium.dev/selenium/web/colorPage.html ");
259
-
260
- // Retrieves the computed style property 'color' of linktext
261
- String cssValue = driver.FindElement(By.Id("namedColor")).GetCssValue("background-color");
262
-
263
- {{< /tab >}}
227
+ {{< /tab >}}
228
+ {{< tab header="CSharp" >}}
229
+ {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L49-L51" >}}
230
+ {{< /tab >}}
264
231
{{< tab header="Ruby" text=true >}}
265
232
{{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L38">}}
266
233
{{< /tab >}}
@@ -293,13 +260,9 @@ driver.get("https://www.selenium.dev/selenium/web/linked_image.html")
293
260
# Retrieves the text of the element
294
261
text = driver.find_element(By.ID, "justanotherlink").text
295
262
{{< /tab >}}
296
- {{< tab header="CSharp" >}}
297
- // Navigate to url
298
- driver.Url="https://www.selenium.dev/selenium/web/linked_image.html ";
299
-
300
- // Retrieves the text of the element
301
- String text = driver.FindElement(By.Id("justanotherlink")).Text;
302
- {{< /tab >}}
263
+ {{< tab header="CSharp" >}}
264
+ {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L53-L56" >}}
265
+ {{< /tab >}}
303
266
{{< tab header="Ruby" text=true >}}
304
267
{{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L43">}}
305
268
{{< /tab >}}
@@ -337,16 +300,9 @@ email_txt = driver.find_element(By.NAME, "email_input")
337
300
# Fetch the value property associated with the textbox
338
301
value_info = email_txt.get_attribute("value")
339
302
{{< /tab >}}
340
- {{< tab header="CSharp" >}}
341
- //Navigate to the url
342
- driver.Url="https://www.selenium.dev/selenium/web/inputs.html ";
343
-
344
- //identify the email text box
345
- IWebElement emailTxt = driver.FindElement(By.Name(("email_input")));
346
-
347
- //fetch the value property associated with the textbox
348
- String valueInfo = eleSelLink.GetAttribute("value");
349
- {{< /tab >}}
303
+ {{< tab header="CSharp" >}}
304
+ {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L58-L63" >}}
305
+ {{< /tab >}}
350
306
{{< tab header="Ruby" text=true >}}
351
307
{{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L48">}}
352
308
{{< /tab >}}
0 commit comments