Skip to content

Commit e8d4cd5

Browse files
harsha509diemol
authored andcommitted
Updating ruby sample code for browser manipulation (#367)
Signed-off-by: Sri Harsha <sri_harsha509@hotmail.com>
1 parent aee4bac commit e8d4cd5

6 files changed

+78
-12
lines changed

docs_source_files/content/webdriver/browser_manipulation.en.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,14 @@ driver.SwitchTo().Frame(iframe);
567567
driver.FindElement(By.TagName("button")).Click();
568568
{{< / code-panel >}}
569569
{{< code-panel language="ruby" >}}
570-
# We don't have a Ruby code sample yet - Help us out and raise a PR
570+
# Store iframe web element
571+
iframe = driver.find_element(:css,'#modal > iframe')
572+
573+
# Switch to the frame
574+
driver.switch_to.frame iframe
575+
576+
# Now, Click on the button
577+
driver.find_element(:tag_name,'button').click
571578
{{< / code-panel >}}
572579
{{< code-panel language="javascript" >}}
573580
// Store the web element
@@ -611,7 +618,11 @@ driver.SwitchTo().Frame("myframe");
611618
driver.FindElement(By.TagName("button")).Click();
612619
{{< / code-panel >}}
613620
{{< code-panel language="ruby" >}}
614-
# We don't have a Ruby code sample yet - Help us out and raise a PR
621+
# Switch by ID
622+
driver.switch_to.frame 'buttonframe'
623+
624+
# Now, Click on the button
625+
driver.find_element(:tag_name,'button').click
615626
{{< / code-panel >}}
616627
{{< code-panel language="javascript" >}}
617628
// Using the ID

docs_source_files/content/webdriver/browser_manipulation.es.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,14 @@ driver.SwitchTo().Frame(iframe);
573573
driver.FindElement(By.TagName("button")).Click();
574574
{{< / code-panel >}}
575575
{{< code-panel language="ruby" >}}
576-
# We don't have a Ruby code sample yet - Help us out and raise a PR
576+
# Store iframe web element
577+
iframe = driver.find_element(:css,'#modal > iframe')
578+
579+
# Switch to the frame
580+
driver.switch_to.frame iframe
581+
582+
# Now, Click on the button
583+
driver.find_element(:tag_name,'button').click
577584
{{< / code-panel >}}
578585
{{< code-panel language="javascript" >}}
579586
// Store the web element
@@ -617,7 +624,11 @@ driver.SwitchTo().Frame("myframe");
617624
driver.FindElement(By.TagName("button")).Click();
618625
{{< / code-panel >}}
619626
{{< code-panel language="ruby" >}}
620-
# We don't have a Ruby code sample yet - Help us out and raise a PR
627+
# Switch by ID
628+
driver.switch_to.frame 'buttonframe'
629+
630+
# Now, Click on the button
631+
driver.find_element(:tag_name,'button').click
621632
{{< / code-panel >}}
622633
{{< code-panel language="javascript" >}}
623634
// Using the ID

docs_source_files/content/webdriver/browser_manipulation.fr.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,14 @@ driver.SwitchTo().Frame(iframe);
573573
driver.FindElement(By.TagName("button")).Click();
574574
{{< / code-panel >}}
575575
{{< code-panel language="ruby" >}}
576-
# We don't have a Ruby code sample yet - Help us out and raise a PR
576+
# Store iframe web element
577+
iframe = driver.find_element(:css,'#modal > iframe')
578+
579+
# Switch to the frame
580+
driver.switch_to.frame iframe
581+
582+
# Now, Click on the button
583+
driver.find_element(:tag_name,'button').click
577584
{{< / code-panel >}}
578585
{{< code-panel language="javascript" >}}
579586
// Store the web element
@@ -617,7 +624,11 @@ driver.SwitchTo().Frame("myframe");
617624
driver.FindElement(By.TagName("button")).Click();
618625
{{< / code-panel >}}
619626
{{< code-panel language="ruby" >}}
620-
# We don't have a Ruby code sample yet - Help us out and raise a PR
627+
# Switch by ID
628+
driver.switch_to.frame 'buttonframe'
629+
630+
# Now, Click on the button
631+
driver.find_element(:tag_name,'button').click
621632
{{< / code-panel >}}
622633
{{< code-panel language="javascript" >}}
623634
// Using the ID

docs_source_files/content/webdriver/browser_manipulation.ja.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,14 @@ driver.SwitchTo().Frame(iframe);
571571
driver.FindElement(By.TagName("button")).Click();
572572
{{< / code-panel >}}
573573
{{< code-panel language="ruby" >}}
574-
# We don't have a Ruby code sample yet - Help us out and raise a PR
574+
# Store iframe web element
575+
iframe = driver.find_element(:css,'#modal > iframe')
576+
577+
# Switch to the frame
578+
driver.switch_to.frame iframe
579+
580+
# Now, Click on the button
581+
driver.find_element(:tag_name,'button').click
575582
{{< / code-panel >}}
576583
{{< code-panel language="javascript" >}}
577584
// Store the web element
@@ -615,7 +622,11 @@ driver.SwitchTo().Frame("myframe");
615622
driver.FindElement(By.TagName("button")).Click();
616623
{{< / code-panel >}}
617624
{{< code-panel language="ruby" >}}
618-
# We don't have a Ruby code sample yet - Help us out and raise a PR
625+
# Switch by ID
626+
driver.switch_to.frame 'buttonframe'
627+
628+
# Now, Click on the button
629+
driver.find_element(:tag_name,'button').click
619630
{{< / code-panel >}}
620631
{{< code-panel language="javascript" >}}
621632
// Using the ID

docs_source_files/content/webdriver/browser_manipulation.nl.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,14 @@ driver.SwitchTo().Frame(iframe);
573573
driver.FindElement(By.TagName("button")).Click();
574574
{{< / code-panel >}}
575575
{{< code-panel language="ruby" >}}
576-
# We don't have a Ruby code sample yet - Help us out and raise a PR
576+
# Store iframe web element
577+
iframe = driver.find_element(:css,'#modal > iframe')
578+
579+
# Switch to the frame
580+
driver.switch_to.frame iframe
581+
582+
# Now, Click on the button
583+
driver.find_element(:tag_name,'button').click
577584
{{< / code-panel >}}
578585
{{< code-panel language="javascript" >}}
579586
// Store the web element
@@ -617,7 +624,11 @@ driver.SwitchTo().Frame("myframe");
617624
driver.FindElement(By.TagName("button")).Click();
618625
{{< / code-panel >}}
619626
{{< code-panel language="ruby" >}}
620-
# We don't have a Ruby code sample yet - Help us out and raise a PR
627+
# Switch by ID
628+
driver.switch_to.frame 'buttonframe'
629+
630+
# Now, Click on the button
631+
driver.find_element(:tag_name,'button').click
621632
{{< / code-panel >}}
622633
{{< code-panel language="javascript" >}}
623634
// Using the ID

docs_source_files/content/webdriver/browser_manipulation.zh-cn.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,14 @@ driver.SwitchTo().Frame(iframe);
572572
driver.FindElement(By.TagName("button")).Click();
573573
{{< / code-panel >}}
574574
{{< code-panel language="ruby" >}}
575-
# We don't have a Ruby code sample yet - Help us out and raise a PR
575+
# Store iframe web element
576+
iframe = driver.find_element(:css,'#modal > iframe')
577+
578+
# Switch to the frame
579+
driver.switch_to.frame iframe
580+
581+
# Now, Click on the button
582+
driver.find_element(:tag_name,'button').click
576583
{{< / code-panel >}}
577584
{{< code-panel language="javascript" >}}
578585
// Store the web element
@@ -616,7 +623,11 @@ driver.SwitchTo().Frame("myframe");
616623
driver.FindElement(By.TagName("button")).Click();
617624
{{< / code-panel >}}
618625
{{< code-panel language="ruby" >}}
619-
# We don't have a Ruby code sample yet - Help us out and raise a PR
626+
# Switch by ID
627+
driver.switch_to.frame 'buttonframe'
628+
629+
# Now, Click on the button
630+
driver.find_element(:tag_name,'button').click
620631
{{< / code-panel >}}
621632
{{< code-panel language="javascript" >}}
622633
// Using the ID

0 commit comments

Comments
 (0)