Skip to content

Fixed Frame Code- Demo -Purpose #2247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/python/tests/interactions/test_frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@

#quit the driver
driver.quit()

#live demo preparation
Original file line number Diff line number Diff line change
Expand Up @@ -147,27 +147,34 @@ driver.findElement(By.tagName("button")).click()
JavaScriptの _window.frames_ を使用して照会できるように、Frameのインデックスを使用することもできます。

{{< tabpane langEqualsHeader=true >}}
{{< tab header="Java" text=true >}}
{{< tab header="Java" text=true >}}
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/FramesTest.java#L62-L63" >}}
{{< /tab >}}
{{< /tab >}}

{{< tab header="Python" text=true >}}
{{< gh-codeblock path="examples/python/tests/interactions/test_frames.py#L45-L46" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
# Switch to the second frame


{{< tab header="Ruby" >}}
# Switch to the second frame
driver.switch_to.frame(1)
{{< /tab >}}
{{< tab header="CSharp" text=true >}}
{{< /tab >}}
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L62-L63" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< tab header="Python" text=true >}}
{{< gh-codeblock path="examples/python/tests/interactions/test_frames.py#L49-L50" >}}
{{< /tab >}}

{{< tab header="JavaScript" >}}
// Switches to the second frame
await driver.switchTo().frame(1);
{{< /tab >}}
{{< tab header="Kotlin" >}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
// Switches to the second frame
driver.switchTo().frame(1)
{{< /tab >}}
{{< /tab >}}
{{< /tabpane >}}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,27 +162,37 @@ Também é possível usar o índice do frame, podendo ser
consultado usando _window.frames_ em JavaScript.

{{< tabpane langEqualsHeader=true >}}
{{< tab header="Java" text=true >}}
{{< tab header="Java" text=true >}}
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/FramesTest.java#L62-L63" >}}
{{< /tab >}}
{{< /tab >}}

{{< tab header="Python" text=true >}}
{{< gh-codeblock path="examples/python/tests/interactions/test_frames.py#L45-L46" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
# Switch to the second frame


{{< tab header="Ruby" >}}
# Switch to the second frame
driver.switch_to.frame(1)
{{< /tab >}}
{{< tab header="CSharp" text=true >}}
{{< /tab >}}
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L62-L63" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< tab header="Python" >}}
# switching to second iframe based on index
iframe = driver.find_elements(By.TAG_NAME,'iframe')[1]

# switch to selected iframe
driver.switch_to.frame(iframe)
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Switches to the second frame
await driver.switchTo().frame(1);
{{< /tab >}}
{{< tab header="Kotlin" >}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
// Switches to the second frame
driver.switchTo().frame(1)
{{< /tab >}}
{{< /tab >}}
{{< /tabpane >}}


Expand All @@ -192,25 +202,27 @@ Para deixar um iframe ou frameset, volte para o conteúdo padrão
como a seguir:

{{< tabpane langEqualsHeader=true >}}
{{< tab header="Java" text=true >}}
{{< tab header="Java" text=true >}}
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/FramesTest.java#L66-L67" >}}
{{< /tab >}}
{{< tab header="Python" text=true >}}
{{< /tab >}}

{{< tab header="Python" text=true >}}
{{< gh-codeblock path="examples/python/tests/interactions/test_frames.py#L49-L50" >}}
{{< /tab >}}
{{< tab header="CSharp" text=true >}}

{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L66-L67" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
# Return to the top level
{{< tab header="Ruby" >}}
# Return to the top level
driver.switch_to.default_content
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Return to the top level
await driver.switchTo().defaultContent();
{{< /tab >}}
{{< tab header="Kotlin" >}}
{{< /tab >}}
{{< tab header="Kotlin" >}}
// Return to the top level
driver.switchTo().defaultContent()
{{< /tab >}}
{{< /tab >}}
{{< /tabpane >}}
Loading