![]() You 'call' class instance: from zelenium import BE elem = BE ( "by", "selector" ) web_element = elem () # Here you calls class instance and it will return # WebElement for you. Well, BasePage also has a metaclass that will go all over page classįields and if field is tuple with two strings - it would replace it withīaseElement itself has magic _call_ method, which executes when If we execute it after opening something in browser - it will find CSS_SELECTOR, "" ) def main (): login_page = LoginPage () print ( login_page. Let's imagine that we have already setup webdriver for Config,Īnd starting to create new page: from import By from zelenium import BasePage class LoginPage ( BasePage ): title = ( By. Some predefined methods, which are useful in testing.No need to pass webdriver instance - it would be passed from.get_instance () config2 = _Config () assert not ( config1 is config2 ) # No assertion BasePage and BaseElement But if you need it, you could use private class: from zelenium import Config from import _Config config1 = Config. Chrome ()īecause Config is singleton - you could not use it with two different To setup configuration for zelenium you could just use Config: from selenium import webdriver from zelenium import Config config = Config. It also should be useful for Appium testing.Suffix and formatting mechanisms for BaseElements.Zelenium offers several features that could be combined with classical GITHUB BASEELEMENTS INSTALLNew Selenium framework for Python with base pages and elements Installation pip install zelenium ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |