How to use get_page_title method in SeleniumBase

Best Python code snippet using SeleniumBase

test_homeIndexPage.py

Source:test_homeIndexPage.py Github

copy

Full Screen

...34 35 def test_01_login(self):36 '''登录系统'''37 loginGo(self.dr).click_login()38 self.assertEqual('行业信息概览' ,self.page.get_page_title(),'登录失败')39 @unittest.Myskip40 def test_998_option_link(self):41 '''测试修改密码链接功能'''42 self.page.go_modify_password()43 self.assertEqual('修改密码' ,self.page.get_page_title(),'页面标题不一致')44 45 @unittest.Myskip46 def test_999_option_link(self):47 '''测试退出系统功能'''48 self.page.go_login_out()49 self.assertIn('登录' ,self.page.get_page_title(),'退出系统失败')50 @unittest.Myskip51 def test_02_option_link(self):52 '''测试行业查询链接功能'''53 self.page.go_HYCX()54 self.assertEqual('行业查询' ,self.page.get_page_title(),'页面标题不一致')55 56 @unittest.Myskip57 def test_03_option_link(self):58 '''测试紧急情况保安调动链接功能'''59 self.page.go_JJQKBADD()60 self.dr.waitSleep(2)61 self.assertEqual('紧急情况保安调动' ,self.page.get_page_title(),'页面标题不一致')62 @unittest.Myskip 63 def test_04_option_link(self):64 '''测试警保联动历史记录链接功能'''65 self.page.go_JBLDLSJL()66 self.assertEqual('警保联动历史记录' ,self.page.get_page_title(),'页面标题不一致')67 @unittest.Myskip68 def test_05_option_link(self):69 '''测试保安行业统计链接功能'''70 self.page.go_BAHYTJ()71 self.assertEqual('保安行业统计' ,self.page.get_page_title(),'页面标题不一致')72 @unittest.Myskip73 def test_06_option_link(self):74 '''测试单位新增链接功能'''75 self.page.go_DWXZ()76 self.assertEqual('新增单位备案' ,self.page.get_page_title(),'页面标题不一致')77 @unittest.Myskip78 def test_07_option_link(self):79 '''测试单位修改链接功能'''80 self.page.go_DWXG()81 self.assertEqual('单位备案变更' ,self.page.get_page_title(),'页面标题不一致')82 @unittest.Myskip83 def test_08_option_link(self):84 '''测试单位注销链接功能'''85 self.page.go_DWZX()86 self.assertEqual('单位备案注销' ,self.page.get_page_title(),'页面标题不一致')87 @unittest.Myskip88 def test_09_option_link(self):89 '''测试人员查询链接功能'''90 self.page.go_RYCX()91 self.assertEqual('人员查询' ,self.page.get_page_title(),'页面标题不一致')92 @unittest.Myskip93 def test_10_option_link(self):94 '''测试人员新增链接功能'''95 self.page.go_RYXZ()96 self.assertEqual('人员新增' ,self.page.get_page_title(),'页面标题不一致')97 98 @unittest.Myskip99 def test_11_option_link(self):100 '''测试人员修改链接功能'''101 self.page.go_RYXG()102 self.assertEqual('人员修改' ,self.page.get_page_title(),'页面标题不一致')103 @unittest.Myskip104 def test_12_option_link(self):105 '''测试人员注销链接功能'''106 self.page.go_RYZX()107 self.assertEqual('人员注销' ,self.page.get_page_title(),'页面标题不一致')108 @unittest.Myskip109 def test_13_option_link(self):110 '''测试单位检查链接功能'''111 self.page.go_DWJC()112 self.assertEqual('单位检查' ,self.page.get_page_title(),'页面标题不一致')113 @unittest.Myskip114 def test_14_option_link(self):115 '''测试单位检查统计链接功能'''116 self.page.go_JCTJ()117 self.assertEqual('单位检查统计' ,self.page.get_page_title(),'页面标题不一致')118 @unittest.Myskip119 def test_15_option_link(self):120 '''测试全警情报检索链接功能'''121 self.page.go_QJQBJS()122 self.assertEqual('全警情报检索' ,self.page.get_page_title(),'页面标题不一致')123 @unittest.Myskip124 def test_16_option_link(self):125 '''测试报警查询链接功能'''126 self.page.go_BJCX()127 self.assertEqual('报警查询' ,self.page.get_page_title(),'页面标题不一致')128 @unittest.Myskip129 def test_17_option_link(self):130 '''测试场所视频监控链接功能'''131 self.page.go_CSSPJK()132 self.assertEqual('场所视频监控' ,self.page.get_page_title(),'页面标题不一致')133 @unittest.Myskip134 def test_18_option_link(self):135 '''测试场所视频回放链接功能'''136 self.page.go_CSSPHF()137 self.assertEqual('场所视频回放' ,self.page.get_page_title(),'页面标题不一致')138 @unittest.Myskip139 def test_19_option_link(self):140 '''测试消息发布链接功能'''141 self.page.go_XXFB()142 self.assertEqual('消息发布' ,self.page.get_page_title(),'页面标题不一致')143 @unittest.Myskip144 def test_20_option_link(self):145 '''测试发布历史查询链接功能'''146 self.page.go_FBLSCX()147 self.assertEqual('信息发布历史查询' ,self.page.get_page_title(),'页面标题不一致')148 @unittest.Myskip149 def test_21_option_link(self):150 '''测试机构管理链接功能'''151 self.page.go_JGGL()152 self.assertEqual('机构管理' ,self.page.get_page_title(),'页面标题不一致')153 @unittest.Myskip154 def test_22_option_link(self):155 '''测试用户管理链接功能'''156 self.page.go_YHGL()157 self.assertEqual('用户管理' ,self.page.get_page_title(),'页面标题不一致')158 @unittest.Myskip159 def test_23_option_link(self):160 '''测试用户组管理链接功能'''161 self.page.go_YHZGL()162 self.assertEqual('用户组管理' ,self.page.get_page_title(),'页面标题不一致')163 @unittest.Myskip164 def test_24_option_link(self):165 '''测试用户分组管理链接功能'''166 self.page.go_YHFZGL()167 self.assertEqual('用户分组管理' ,self.page.get_page_title(),'页面标题不一致')168 @unittest.Myskip169 def test_25_option_link(self):170 '''测试打分表设置链接功能'''171 self.page.go_DFBSZ()172 self.assertEqual('打分表管理' ,self.page.get_page_title(),'页面标题不一致')173 @unittest.Myskip174 def test_26_option_link(self):175 '''测试数据字典链接功能'''176 self.page.go_SJZD()177 self.assertEqual('数据字典' ,self.page.get_page_title(),'页面标题不一致')178 @unittest.Myskip179 def test_27_option_link(self):180 '''测试参数设置链接功能'''181 self.page.go_CSSZ()182 self.assertEqual('参数设置' ,self.page.get_page_title(),'页面标题不一致')183 @unittest.Myskip184 def test_28_option_link(self):185 '''测试扩展数据字段链接功能'''186 self.page.go_KZSJZD()187 self.assertEqual('扩展数据字段' ,self.page.get_page_title(),'页面标题不一致')188 @unittest.Myskip189 def test_29_option_link(self):190 '''测试工作日志链接功能'''191 self.page.go_workLog()192 self.assertEqual('工作日志' ,self.page.get_page_title(),'页面标题不一致')193 @unittest.Myskip194 def test_30_option_link(self):195 '''测试操作日志链接功能'''196 self.page.go_operationLog()197 self.assertEqual('操作日志' ,self.page.get_page_title(),'页面标题不一致')198 199 200if __name__ == '__main__':201 unittest.main()202 ...

Full Screen

Full Screen

test_navbar.py

Source:test_navbar.py Github

copy

Full Screen

...22 else:23 navbar.click_work_tab()24 time.sleep(3)25 assert self.get_current_url() == "https://www.rixxo.com/work"26 assert self.get_page_title() == "Our Work | Want To Learn More? 0117 2077504"27 # /clients28 navbar.click_clients_tab()29 time.sleep(3)30 assert self.get_current_url() == "https://www.rixxo.com/clients/"31 assert self.get_page_title() == "Our Clients | Like What You See? What To Join In?"32 # /services33 self.action.move_to_element(navbar.get_services_tab()).pause(8).click().perform()34 time.sleep(3)35 assert self.get_current_url() == "https://www.rixxo.com/services/"36 assert self.get_page_title() == "B2B ECommerce & Marketing Services For Strategic Growth"37 # /blog38 navbar.click_blog_tab()39 time.sleep(3)40 assert self.get_current_url() == "https://www.rixxo.com/blog/"41 assert self.get_page_title() == "Blog | Rixxo | B2B Magento Marketing Specialists"42 # /about43 navbar.click_about_us_tab()44 time.sleep(3)45 assert self.get_current_url() == "https://www.rixxo.com/about/"46 assert self.get_page_title() == "About Rixxo | We Are An Agency Redefining Audience Engagement"47 # contact48 navbar.click_contact_tab()49 time.sleep(3)50 assert self.get_current_url() == "https://www.rixxo.com/contact/"51 assert self.get_page_title() == "Contact Rixxo | An Agency Redefining Audience Engagement"52 # Pages tests53 # Maybe parametrize these tests?54 # create fixture request to switch between desktop, tablet, phone window sizes55 def test_work_tab(self):56 self.driver.get("https://www.rixxo.com")57 navbar = Navbar(self.driver)58 navbar.click_work_tab()59 time.sleep(3)60 assert self.get_current_url() == "https://www.rixxo.com/work"61 assert self.get_page_title() == "Our Work | Want To Learn More? 0117 2077504"62 def test_clients_tab(self):63 self.driver.get("https://www.rixxo.com")64 navbar = Navbar(self.driver)65 navbar.click_clients_tab()66 time.sleep(3)67 assert self.get_current_url() == "https://www.rixxo.com/clients/"68 assert self.get_page_title() == "Our Clients | Like What You See? What To Join In?"69 def test_services_tab(self):70 self.driver.get("https://www.rixxo.com")71 navbar = Navbar(self.driver)72 self.action.move_to_element(navbar.get_services_tab()).pause(6).click().perform()73 time.sleep(3)74 assert self.get_current_url() == "https://www.rixxo.com/services/"75 assert self.get_page_title() == "B2B ECommerce & Marketing Services For Strategic Growth"76 def test_services_tab_hover(self):77 self.driver.get("https://www.rixxo.com")78 navbar = Navbar(self.driver)79 self.action.move_to_element(navbar.get_services_tab()).pause(5).perform()80 navbar.get_services_submenu()81 assert (ec.visibility_of(navbar.get_services_submenu()))82 def test_blog_tab(self):83 self.driver.get("https://www.rixxo.com")84 navbar = Navbar(self.driver)85 navbar.click_blog_tab()86 time.sleep(3)87 assert self.get_current_url() == "https://www.rixxo.com/blog/"88 assert self.get_page_title() == "Blog | Rixxo | B2B Magento Marketing Specialists"89 def test_about_us_tab(self):90 self.driver.get("https://www.rixxo.com")91 navbar = Navbar(self.driver)92 navbar.click_about_us_tab()93 time.sleep(3)94 assert self.get_current_url() == "https://www.rixxo.com/about/"95 assert self.get_page_title() == "About Rixxo | We Are An Agency Redefining Audience Engagement"96 def test_contact_tab(self):97 self.driver.get("https://www.rixxo.com")98 navbar = Navbar(self.driver)99 navbar.click_contact_tab()100 time.sleep(3)101 assert self.get_current_url() == "https://www.rixxo.com/contact/"102 assert self.get_page_title() == "Contact Rixxo | An Agency Redefining Audience Engagement"103 @pytest.fixture(params=["desktop", "tablet", "mobile"])104 def define_window_size(self, request):...

Full Screen

Full Screen

test_HomeBtn.py

Source:test_HomeBtn.py Github

copy

Full Screen

...4class TestHomeBtn(BaseTest):5 def test_service_link(self):6 self.linksButtons = LinksButtons(self.driver)7 self.linksButtons.service_link("services")8 service_title = self.linksButtons.get_page_title(TestData.SERVICE_TITLE)9 assert service_title == self.linksButtons.get_page_title(TestData.SERVICE_TITLE)10 self.linksButtons.home_btn()11 home_title = self.linksButtons.get_page_title(TestData.HOME_PAGE_TITLE)12 assert home_title == TestData.HOME_PAGE_TITLE13 def test_isg_future_of_work(self):14 self.linksButtons = LinksButtons(self.driver)15 self.linksButtons.isg_future_of_work("isg future of work")16 isg_title = self.linksButtons.get_page_title(TestData.FUTURE_OF_WORK_TITLE)17 assert isg_title == self.linksButtons.get_page_title(TestData.FUTURE_OF_WORK_TITLE)18 self.linksButtons.home_btn()19 home_title = self.linksButtons.get_page_title(TestData.HOME_PAGE_TITLE)20 assert home_title == TestData.HOME_PAGE_TITLE21 def test_industries_link(self):22 self.linksButtons = LinksButtons(self.driver)23 self.linksButtons.industries_link("industries")24 industries_title = self.linksButtons.get_page_title(TestData.INDUSTRIES_TITLE)25 assert industries_title == self.linksButtons.get_page_title(TestData.INDUSTRIES_TITLE)26 self.linksButtons.home_btn()27 home_title = self.linksButtons.get_page_title(TestData.HOME_PAGE_TITLE)28 assert home_title == TestData.HOME_PAGE_TITLE29 def test_all_news_link(self):30 self.linksButtons = LinksButtons(self.driver)31 self.linksButtons.all_news("all news")32 all_news_title = self.linksButtons.get_page_title(TestData.ALL_NEWS_TITLE)33 assert all_news_title == self.linksButtons.get_page_title(TestData.ALL_NEWS_TITLE)34 self.linksButtons.home_btn()35 home_title = self.linksButtons.get_page_title(TestData.HOME_PAGE_TITLE)36 assert home_title == TestData.HOME_PAGE_TITLE37 def test_success_stories_link(self):38 self.linksButtons = LinksButtons(self.driver)39 self.linksButtons.success_stories("success stories")40 success_stories_title = self.linksButtons.get_page_title(TestData.SUCCESS_STORIES_TITLE)41 assert success_stories_title == self.linksButtons.get_page_title(TestData.SUCCESS_STORIES_TITLE)42 self.linksButtons.home_btn()43 home_title = self.linksButtons.get_page_title(TestData.HOME_PAGE_TITLE)...

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