How to use create_shepherd_tour method in SeleniumBase

Best Python code snippet using SeleniumBase

shepherd_google_tour.py

Source:shepherd_google_tour.py Github

copy

Full Screen

2class MyTourClass(BaseCase):3 def test_google_tour(self):4 self.open("https://google.com/ncr")5 self.wait_for_element('input[title="Search"]')6 self.create_shepherd_tour(theme="dark")7 self.add_tour_step("Welcome to Google!", title="SeleniumBase Tours")8 self.add_tour_step("Type in your query here.", 'input[title="Search"]')9 self.play_tour()10 self.highlight_type('input[title="Search"]', "Google")11 self.wait_for_element('[role="listbox"]') # Wait for autocomplete12 self.create_shepherd_tour(theme="light")13 self.add_tour_step("Then click to search.", '[value="Google Search"]')14 self.add_tour_step("Or press [ENTER] after entry.", '[title="Search"]')15 self.play_tour()16 self.highlight_type('input[title="Search"]', "GitHub\n")17 self.ad_block()18 self.wait_for_element("#search")19 self.create_shepherd_tour(theme="square-dark")20 self.add_tour_step("3-second autoplay...")21 self.add_tour_step("Here's the next tour:")22 self.play_tour(interval=3) # Tour automatically continues after 3 sec23 self.open("https://www.google.com/maps/@42.3591234,-71.0915634,15z")24 self.wait_for_element("#searchboxinput", timeout=20)25 self.wait_for_element("#minimap", timeout=20)26 self.wait_for_element("#zoom", timeout=20)27 self.create_shepherd_tour(theme="dark")28 self.add_tour_step("Welcome to Google Maps!")29 self.add_tour_step(30 "Type in a location here.", "#searchboxinput", title="Search Box"31 )32 self.add_tour_step(33 "Then click here to show it on the map.",34 "#searchbox-searchbutton",35 alignment="bottom",36 )37 self.add_tour_step(38 "Or click here to get driving directions.",39 'button[aria-label="Directions"]',40 alignment="bottom",41 theme="dark",...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run SeleniumBase automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful