Browse to a different website inside the tour. #2344
Replies: 3 comments 1 reply
-
Each tour is only for a single site, but you can chain multiple tours together to cover multiple sites, such as in the example here: SeleniumBase/examples/tour_examples/google_tour.py
Here's the updated code from your example for two different tours chained together: from seleniumbase import BaseCase
BaseCase.main(__name__, __file__, "--disable-csp")
class MyTourClass(BaseCase):
def test_google_tour(self):
self.open("https://google.com/ncr")
self.wait_for_element('[title="Search"]')
self.hide_elements("iframe")
self.create_tour(theme="dark")
self.add_tour_step("Welcome to Google!", title="SeleniumBase Tours")
self.add_tour_step("Type in your query here.", '[title="Search"]')
self.play_tour()
self.open("https://translate.google.com/")
self.create_tour(theme="light")
self.add_tour_step("This is Google Translate")
self.play_tour() Note that the second website has a Content Security Policy that disables JavaScript from running, so you need to add pytest --disable-csp |
Beta Was this translation helpful? Give feedback.
-
Thank you so much. That's exactly what I thought. But I still hoped that it was possible. Thank you for the enormous work and contribution you make. |
Beta Was this translation helpful? Give feedback.
-
@mdmintz self.create_tour()
self.type("#address_firstname", "TestName")
self.type("#address_lastname", "LastName")
self.type("#address_for_attention_of", "FAO Test")
self.type("#address_phone", "+1 111 1111111")
self.type("#address_contact_email", "[email protected]")
self.type("#address_company", "Test Company")
self.type("#address_address1", "Test street 123")
self.add_tour_step("The Shipping Address name can be added here", "#address_address_name")
self.add_tour_step(
"If checked, the shipping address will be saved as the default address for checkout.",
"#address_default_shipping_address"
)
self.add_tour_step('The new shipping address will be saved in profile', "input[value='Save']")
self.play_tour() |
Beta Was this translation helpful? Give feedback.
-
Can I go to another site during the tour? Or do I need to finish the first tour open another site and start the second tour? Here is the example what I try to achieve
Beta Was this translation helpful? Give feedback.
All reactions