Skip to content

Commit 559f4be

Browse files
Delta456harsha509
andauthored
[java] show relevant code for elements/information (#2194)[deploy site]
Co-authored-by: Sri Harsha <[email protected]>
1 parent 7eecdbd commit 559f4be

File tree

5 files changed

+43
-43
lines changed

5 files changed

+43
-43
lines changed

examples/java/src/test/java/dev/selenium/elements/InformationTest.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,27 @@ public void informationWithElements() {
1919
// Navigate to Url
2020
driver.get("https://www.selenium.dev/selenium/web/inputs.html");
2121

22-
// isDisplayed
22+
// isDisplayed
2323
// Get boolean value for is element display
2424
boolean isEmailVisible = driver.findElement(By.name("email_input")).isDisplayed();
2525
assertEquals(isEmailVisible,true);
2626

27-
//isEnabled
28-
//returns true if element is enabled else returns false
27+
// isEnabled
28+
// returns true if element is enabled else returns false
2929
boolean isEnabledButton = driver.findElement(By.name("button_input")).isEnabled();
3030
assertEquals(isEnabledButton,true);
3131

32-
//isSelected
33-
//returns true if element is checked else returns false
32+
// isSelected
33+
// returns true if element is checked else returns false
3434
boolean isSelectedCheck = driver.findElement(By.name("checkbox_input")).isSelected();
3535
assertEquals(isSelectedCheck,true);
3636

37-
//TagName
38-
//returns TagName of the element
37+
// TagName
38+
// returns TagName of the element
3939
String tagNameInp = driver.findElement(By.name("email_input")).getTagName();
4040
assertEquals(tagNameInp,"input");
4141

42-
//GetRect
42+
// GetRect
4343
// Returns height, width, x and y coordinates referenced element
4444
Rectangle res = driver.findElement(By.name("range_input")).getRect();
4545
// Rectangle class provides getX,getY, getWidth, getHeight methods
@@ -51,16 +51,16 @@ public void informationWithElements() {
5151
assertEquals(cssValue, "13.3333px");
5252

5353

54-
//GetText
54+
// GetText
5555
// Retrieves the text of the element
5656
String text = driver.findElement(By.tagName("h1")).getText();
5757
assertEquals(text, "Testing Inputs");
5858

5959

60-
//FetchAttributes
61-
//identify the email text box
60+
// FetchAttributes
61+
// identify the email text box
6262
WebElement emailTxt = driver.findElement(By.name(("email_input")));
63-
//fetch the value property associated with the textbox
63+
// fetch the value property associated with the textbox
6464
String valueInfo = emailTxt.getAttribute("value");
6565
assertEquals(valueInfo,"admin@localhost");
6666

website_and_docs/content/documentation/webdriver/elements/information.en.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ nature and relationship in the tree to return a value.
2727

2828
{{< tabpane langEqualsHeader=true >}}
2929
{{< tab header="Java" text=true >}}
30-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L20-L25" >}}
30+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L20-L24" >}}
3131
{{< /tab >}}
3232
{{< tab header="Python" text=true >}}
3333
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L12-L15" >}}
@@ -62,7 +62,7 @@ Returns a boolean value, **True** if the connected element is
6262

6363
{{< tabpane langEqualsHeader=true >}}
6464
{{< tab header="Java" text=true >}}
65-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L27-L30" >}}
65+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L27-L29" >}}
6666
{{< /tab >}}
6767
{{< tab header="Python" text=true >}}
6868
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L19" >}}
@@ -96,7 +96,7 @@ Returns a boolean value, **True** if referenced element is
9696

9797
{{< tabpane langEqualsHeader=true >}}
9898
{{< tab header="Java" text=true >}}
99-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L32-L35" >}}
99+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L32-L34" >}}
100100
{{< /tab >}}
101101
{{< tab header="Python" text=true >}}
102102
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L23" >}}
@@ -126,7 +126,7 @@ of the referenced Element which has the focus in the current browsing context.
126126

127127
{{< tabpane langEqualsHeader=true >}}
128128
{{< tab header="Java" text=true >}}
129-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L37-L40" >}}
129+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L37-L39" >}}
130130
{{< /tab >}}
131131
{{< tab header="Python" text=true >}}
132132
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L27" >}}
@@ -162,7 +162,7 @@ The fetched data body contain the following details:
162162

163163
{{< tabpane langEqualsHeader=true >}}
164164
{{< tab header="Java" text=true >}}
165-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L42-L46" >}}
165+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L42-L44" >}}
166166
{{< /tab >}}
167167
{{< tab header="Python" text=true >}}
168168
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L31" >}}
@@ -195,7 +195,7 @@ of an element in the current browsing context.
195195

196196
{{< tabpane langEqualsHeader=true >}}
197197
{{< tab header="Java" text=true >}}
198-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L49-L51" >}}
198+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L49-L50" >}}
199199
{{< /tab >}}
200200
{{< tab header="Python" text=true >}}
201201
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L35-L37" >}}
@@ -226,7 +226,7 @@ Retrieves the rendered text of the specified element.
226226

227227
{{< tabpane langEqualsHeader=true >}}
228228
{{< tab header="Java" text=true >}}
229-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L54-L57" >}}
229+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L54-L56" >}}
230230
{{< /tab >}}
231231
{{< tab header="Python" text=true >}}
232232
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L41" >}}
@@ -259,7 +259,7 @@ with the DOM attribute or property of the element.
259259

260260
{{< tabpane langEqualsHeader=true >}}
261261
{{< tab header="Java" text=true >}}
262-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L60-L65" >}}
262+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L60-L64" >}}
263263
{{< /tab >}}
264264
{{< tab header="Python" text=true >}}
265265
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L44-L46" >}}

website_and_docs/content/documentation/webdriver/elements/information.ja.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ nature and relationship in the tree to return a value.
2727

2828
{{< tabpane langEqualsHeader=true >}}
2929
{{< tab header="Java" text=true >}}
30-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L20-L25" >}}
30+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L20-L24" >}}
3131
{{< /tab >}}
3232
{{< tab header="Python" text=true >}}
3333
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L12-L15" >}}
@@ -61,7 +61,7 @@ nature and relationship in the tree to return a value.
6161

6262
{{< tabpane langEqualsHeader=true >}}
6363
{{< tab header="Java" text=true >}}
64-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L27-L30" >}}
64+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L27-L29" >}}
6565
{{< /tab >}}
6666
{{< tab header="Python" text=true >}}
6767
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L19" >}}
@@ -93,7 +93,7 @@ nature and relationship in the tree to return a value.
9393

9494
{{< tabpane langEqualsHeader=true >}}
9595
{{< tab header="Java" text=true >}}
96-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L32-L35" >}}
96+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L32-L34" >}}
9797
{{< /tab >}}
9898
{{< tab header="Python" text=true >}}
9999
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L23" >}}
@@ -123,7 +123,7 @@ val attr = driver.findElement(By.name("checkbox_input")).isSelected()
123123

124124
{{< tabpane langEqualsHeader=true >}}
125125
{{< tab header="Java" text=true >}}
126-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L37-L40" >}}
126+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L37-L39" >}}
127127
{{< /tab >}}
128128
{{< tab header="Python" text=true >}}
129129
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L27" >}}
@@ -159,7 +159,7 @@ val attr = driver.findElement(By.name("email_input")).getTagName()
159159

160160
{{< tabpane langEqualsHeader=true >}}
161161
{{< tab header="Java" text=true >}}
162-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L42-L46" >}}
162+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L42-L44" >}}
163163
{{< /tab >}}
164164
{{< tab header="Python" text=true >}}
165165
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L31" >}}
@@ -191,7 +191,7 @@ println(res.getX())
191191

192192
{{< tabpane langEqualsHeader=true >}}
193193
{{< tab header="Java" text=true >}}
194-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L49-L51" >}}
194+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L49-L50" >}}
195195
{{< /tab >}}
196196
{{< tab header="Python" text=true >}}
197197
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L35-L37" >}}
@@ -220,7 +220,7 @@ val cssValue = driver.findElement(By.id("namedColor")).getCssValue("background-c
220220

221221
{{< tabpane langEqualsHeader=true >}}
222222
{{< tab header="Java" text=true >}}
223-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L54-L57" >}}
223+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L54-L56" >}}
224224
{{< /tab >}}
225225
{{< tab header="Python" text=true >}}
226226
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L41" >}}
@@ -251,7 +251,7 @@ with the DOM attribute or property of the element.
251251

252252
{{< tabpane langEqualsHeader=true >}}
253253
{{< tab header="Java" text=true >}}
254-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L60-L65" >}}
254+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L60-L64" >}}
255255
{{< /tab >}}
256256
{{< tab header="Python" text=true >}}
257257
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L44-L46" >}}

website_and_docs/content/documentation/webdriver/elements/information.pt-br.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ nature and relationship in the tree to return a value.
2828

2929
{{< tabpane langEqualsHeader=true >}}
3030
{{< tab header="Java" text=true >}}
31-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L20-L25" >}}
31+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L20-L24" >}}
3232
{{< /tab >}}
3333
{{< tab header="Python" text=true >}}
3434
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L12-L15" >}}
@@ -62,7 +62,7 @@ Returns a boolean value, **True** if the connected element is
6262

6363
{{< tabpane langEqualsHeader=true >}}
6464
{{< tab header="Java" text=true >}}
65-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L27-L30" >}}
65+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L27-L29" >}}
6666
{{< /tab >}}
6767
{{< tab header="Python" text=true >}}
6868
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L19" >}}
@@ -99,7 +99,7 @@ Retorna um valor booleano, **true** se o elemento referenciado for
9999

100100
{{< tabpane langEqualsHeader=true >}}
101101
{{< tab header="Java" text=true >}}
102-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L32-L35" >}}
102+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L32-L34" >}}
103103
{{< /tab >}}
104104
{{< tab header="Python" text=true >}}
105105
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L23" >}}
@@ -131,7 +131,7 @@ do elemento referenciado que tem o foco no contexto de navegação atual.
131131

132132
{{< tabpane langEqualsHeader=true >}}
133133
{{< tab header="Java" text=true >}}
134-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L37-L40" >}}
134+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L37-L39" >}}
135135
{{< /tab >}}
136136
{{< tab header="Python" text=true >}}
137137
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L27" >}}
@@ -168,7 +168,7 @@ O corpo de dados buscado contém os seguintes detalhes:
168168

169169
{{< tabpane langEqualsHeader=true >}}
170170
{{< tab header="Java" text=true >}}
171-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L42-L46" >}}
171+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L42-L44" >}}
172172
{{< /tab >}}
173173
{{< tab header="Python" text=true >}}
174174
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L31" >}}
@@ -201,7 +201,7 @@ de um elemento no contexto de navegação atual.
201201

202202
{{< tabpane langEqualsHeader=true >}}
203203
{{< tab header="Java" text=true >}}
204-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L49-L51" >}}
204+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L49-L50" >}}
205205
{{< /tab >}}
206206
{{< tab header="Python" text=true >}}
207207
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L35-L37" >}}
@@ -233,7 +233,7 @@ Recupera o texto renderizado do elemento especificado.
233233

234234
{{< tabpane langEqualsHeader=true >}}
235235
{{< tab header="Java" text=true >}}
236-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L54-L57" >}}
236+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L54-L56" >}}
237237
{{< /tab >}}
238238
{{< tab header="Python" text=true >}}
239239
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L41" >}}

website_and_docs/content/documentation/webdriver/elements/information.zh-cn.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ description: >
2121

2222
{{< tabpane langEqualsHeader=true >}}
2323
{{< tab header="Java" text=true >}}
24-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L20-L25" >}}
24+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L20-L24" >}}
2525
{{< /tab >}}
2626
{{< tab header="Python" text=true >}}
2727
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L12-L15" >}}
@@ -53,7 +53,7 @@ val flag = driver.findElement(By.name("email_input")).isDisplayed()
5353

5454
{{< tabpane langEqualsHeader=true >}}
5555
{{< tab header="Java" text=true >}}
56-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L27-L30" >}}
56+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L27-L29" >}}
5757
{{< /tab >}}
5858
{{< tab header="Python" text=true >}}
5959
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L19" >}}
@@ -86,7 +86,7 @@ val attr = driver.findElement(By.name("button_input")).isEnabled()
8686

8787
{{< tabpane langEqualsHeader=true >}}
8888
{{< tab header="Java" text=true >}}
89-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L32-L35" >}}
89+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L32-L34" >}}
9090
{{< /tab >}}
9191
{{< tab header="Python" text=true >}}
9292
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L23" >}}
@@ -117,7 +117,7 @@ val attr = driver.findElement(By.name("checkbox_input")).isSelected()
117117

118118
{{< tabpane langEqualsHeader=true >}}
119119
{{< tab header="Java" text=true >}}
120-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L37-L40" >}}
120+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L37-L39" >}}
121121
{{< /tab >}}
122122
{{< tab header="Python" text=true >}}
123123
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L27" >}}
@@ -155,7 +155,7 @@ val attr = driver.findElement(By.name("email_input")).getTagName()
155155

156156
{{< tabpane langEqualsHeader=true >}}
157157
{{< tab header="Java" text=true >}}
158-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L42-L46" >}}
158+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L42-L44" >}}
159159
{{< /tab >}}
160160
{{< tab header="Python" text=true >}}
161161
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L31" >}}
@@ -189,7 +189,7 @@ println(res.getX())
189189

190190
{{< tabpane langEqualsHeader=true >}}
191191
{{< tab header="Java" text=true >}}
192-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L49-L51" >}}
192+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L49-L50" >}}
193193
{{< /tab >}}
194194
{{< tab header="Python" text=true >}}
195195
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L35-L37" >}}
@@ -221,7 +221,7 @@ val cssValue = driver.findElement(By.id("namedColor")).getCssValue("background-c
221221

222222
{{< tabpane langEqualsHeader=true >}}
223223
{{< tab header="Java" text=true >}}
224-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L54-L57" >}}
224+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L54-L56" >}}
225225
{{< /tab >}}
226226
{{< tab header="Python" text=true >}}
227227
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L41" >}}
@@ -253,7 +253,7 @@ val text = driver.findElement(By.id("justanotherlink")).getText()
253253

254254
{{< tabpane langEqualsHeader=true >}}
255255
{{< tab header="Java" text=true >}}
256-
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L60-L65" >}}
256+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L60-L64" >}}
257257
{{< /tab >}}
258258
{{< tab header="Python" text=true >}}
259259
{{< gh-codeblock path="examples/python/tests/elements/test_information.py#L44-L46" >}}

0 commit comments

Comments
 (0)