File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ from seleniumbase import SB
2+
3+ with SB (uc = True , test = True ) as sb :
4+ url = "https://seleniumbase.io/antibot/login"
5+ sb .activate_cdp_mode (url )
6+ sb .press_keys ("input#username" , "demo_user" )
7+ sb .press_keys ("input#password" , "secret_pass" )
8+ x , y = sb .cdp .get_gui_element_center ("button#myButton" )
9+ sb .uc_gui_click_x_y (x , y )
10+ sb .sleep (1.5 )
11+ x , y = sb .cdp .get_gui_element_center ("a#log-in" )
12+ sb .uc_gui_click_x_y (x , y )
13+ sb .assert_text ("Welcome!" , "h1" )
14+ sb .set_messenger_theme (location = "bottom_center" )
15+ sb .post_message ("SeleniumBase wasn't detected!" )
16+ sb .sleep (1.5 )
Original file line number Diff line number Diff line change 1+ from seleniumbase import SB
2+
3+ with SB (uc = True , test = True , locale_code = "en" ) as sb :
4+ url = "https://gitlab.com/users/sign_in"
5+ sb .activate_cdp_mode (url )
6+ sb .uc_gui_click_captcha ()
7+ sb .assert_text ("Username" , '[for="user_login"]' , timeout = 3 )
8+ sb .assert_element ('label[for="user_login"]' )
9+ sb .highlight ('button:contains("Sign in")' )
10+ sb .highlight ('h1:contains("GitLab.com")' )
11+ sb .post_message ("SeleniumBase wasn't detected" , duration = 4 )
You can’t perform that action at this time.
0 commit comments