@@ -162,27 +162,37 @@ Também é possível usar o índice do frame, podendo ser
162
162
consultado usando _ window.frames_ em JavaScript.
163
163
164
164
{{< tabpane langEqualsHeader=true >}}
165
- {{< tab header="Java" text=true >}}
165
+ {{< tab header="Java" text=true >}}
166
166
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/FramesTest.java#L62-L63" >}}
167
- {{< /tab >}}
167
+ {{< /tab >}}
168
+
168
169
{{< tab header="Python" text=true >}}
169
170
{{< gh-codeblock path="examples/python/tests/interactions/test_frames.py#L45-L46" >}}
170
171
{{< /tab >}}
171
- {{< tab header="Ruby" >}}
172
- # Switch to the second frame
172
+
173
+
174
+ {{< tab header="Ruby" >}}
175
+ # Switch to the second frame
173
176
driver.switch_to.frame(1)
174
- {{< /tab >}}
175
- {{< tab header="CSharp" text=true >}}
177
+ {{< /tab >}}
178
+ {{< tab header="CSharp" text=true >}}
176
179
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L62-L63" >}}
177
180
{{< /tab >}}
178
- {{< tab header="JavaScript" >}}
181
+ {{< tab header="Python" >}}
182
+ # switching to second iframe based on index
183
+ iframe = driver.find_elements(By.TAG_NAME,'iframe')[ 1]
184
+
185
+ # switch to selected iframe
186
+ driver.switch_to.frame(iframe)
187
+ {{< /tab >}}
188
+ {{< tab header="JavaScript" >}}
179
189
// Switches to the second frame
180
190
await driver.switchTo().frame(1);
181
- {{< /tab >}}
182
- {{< tab header="Kotlin" >}}
191
+ {{< /tab >}}
192
+ {{< tab header="Kotlin" >}}
183
193
// Switches to the second frame
184
194
driver.switchTo().frame(1)
185
- {{< /tab >}}
195
+ {{< /tab >}}
186
196
{{< /tabpane >}}
187
197
188
198
@@ -192,25 +202,27 @@ Para deixar um iframe ou frameset, volte para o conteúdo padrão
192
202
como a seguir:
193
203
194
204
{{< tabpane langEqualsHeader=true >}}
195
- {{< tab header="Java" text=true >}}
205
+ {{< tab header="Java" text=true >}}
196
206
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/FramesTest.java#L66-L67" >}}
197
- {{< /tab >}}
198
- {{< tab header="Python" text=true >}}
207
+ {{< /tab >}}
208
+
209
+ {{< tab header="Python" text=true >}}
199
210
{{< gh-codeblock path="examples/python/tests/interactions/test_frames.py#L49-L50" >}}
200
211
{{< /tab >}}
201
- {{< tab header="CSharp" text=true >}}
212
+
213
+ {{< tab header="CSharp" text=true >}}
202
214
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L66-L67" >}}
203
215
{{< /tab >}}
204
- {{< tab header="Ruby" >}}
205
- # Return to the top level
216
+ {{< tab header="Ruby" >}}
217
+ # Return to the top level
206
218
driver.switch_to.default_content
207
- {{< /tab >}}
208
- {{< tab header="JavaScript" >}}
219
+ {{< /tab >}}
220
+ {{< tab header="JavaScript" >}}
209
221
// Return to the top level
210
222
await driver.switchTo().defaultContent();
211
- {{< /tab >}}
212
- {{< tab header="Kotlin" >}}
223
+ {{< /tab >}}
224
+ {{< tab header="Kotlin" >}}
213
225
// Return to the top level
214
226
driver.switchTo().defaultContent()
215
- {{< /tab >}}
227
+ {{< /tab >}}
216
228
{{< /tabpane >}}
0 commit comments