In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-10-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
1. In the actual testing process, it is often necessary to compare whether the actual results are consistent with the expected results.
two。 If the actual result is inconsistent with the expected result, it is considered as bug.
Selenium is widely used in Bhand S architecture, how to verify the correctness of test results through selenium.
Case study: take Baidu as an example to see how to verify the correctness of the test results. After clicking "hao123" on the home page of Baidu, jump to the "hao123" page to verify: whether to jump to the "hao123" page how to achieve this scenario through selenium? # * # obtain verification information, and after manipulating a page Confirm that you entered the expected result # * from selenium import webdriverfrom time import sleepdriver = webdriver.Firefox () driver.get ("http://www.baidu.com")print("===========The baidu Page=") First_Title = driver.titleprint ("The first page title is:%s"% First_Title) print ("= The hao123 Page=") driver.find_element_by_xpath ("/ a [@ name='tj_trhao123'") ] "). Click () Second_Title = driver.titleprint (" The Second page title is:%s "% Second_Title) Expect_Title =" hao123_ access starts here "if Second_Title = = Expect_Title: print (True) else: print (False) driver.quit () selenium checks the title of the page through driver.title Determine whether the title value of the actual page is the same as the expected value; thus get the test results. If you want to learn selenium systematically, you can do it in such a way.
To promote my blog column, I have selected a topic "learn from Zero Selenium Automated Test Framework". Please add a link description. Let's start with the code and implement the Web automated testing framework step by step.
This project will build an available automated testing framework (based on python+selenium) from scratch.
Premise: you should master the basics of python and selenium. Or you won't understand.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.