Skip to content

Commit 67b8178

Browse files
committed
Update CDP Mode examples
1 parent cf4f2dc commit 67b8178

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

examples/cdp_mode/raw_canvas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def get_canvas_pixel_colors_at_top_left(sb):
2929
url = "https://seleniumbase.io/other/canvas"
3030
sb.activate_cdp_mode(url)
3131
sb.assert_title_contains("Canvas")
32-
sb.cdp.gui_click_with_offset("canvas", 0, 0, center=True)
32+
sb.cdp.click_with_offset("canvas", 0, 0, center=True)
3333
sb.sleep(1)
3434
sb.uc_gui_press_key("ENTER")
3535
sb.sleep(0.5)

examples/cdp_mode/raw_demo_site.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
# Hover & click a dropdown element and assert results
2222
sb.cdp.assert_text("Automation Practice", "h3")
23-
sb.cdp.gui_hover_and_click("#myDropdown", "#dropOption2")
23+
sb.cdp.hover_and_click("#myDropdown", "#dropOption2")
2424
sb.cdp.assert_text("Link Two Selected", "h3")
2525

2626
# Click a button and then verify the expected results

examples/cdp_mode/raw_handle_alerts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
with SB(uc=True, test=True) as sb:
55
url = "https://the-internet.herokuapp.com/javascript_alerts"
66
sb.activate_cdp_mode(url)
7-
sb.cdp.gui_click_element('button[onclick="jsAlert()"]')
7+
sb.click('button[onclick="jsAlert()"]')
88
sb.sleep(1)
99
sb.uc_gui_press_key("\n") # Accept Alert
1010
sb.sleep(1)
11-
sb.cdp.gui_click_element('button[onclick="jsConfirm()"]')
11+
sb.click('button[onclick="jsConfirm()"]')
1212
sb.sleep(1)
1313
sb.uc_gui_press_key("ESC") # Dismiss Alert
1414
sb.sleep(1)
15-
sb.cdp.gui_click_element('button[onclick="jsPrompt()"]')
15+
sb.click('button[onclick="jsPrompt()"]')
1616
sb.sleep(1)
1717
sb.uc_gui_write("Here is my prompt answer\n")
1818
sb.sleep(1)

0 commit comments

Comments
 (0)