tags: unit test
When I was building a unit test framework, I reported this error after running the code.
// code show as below:
import unittest
from selenium import webdriver
import time
import unittest
from ddt import ddt
class forTest2(unittest.TestCase):
def test1(self):
driver = webdriver.chrome()
driver.get("http://www.baidu.com")
driver.find_element_by_id('kw').send_keys("Virtual Bamboo")
driver.find_element_by_id("su").click()
if __name__ == '__main__':
unittest.main()
After running these codes
After these mistakes, my solution:
1. Check if the code is wrong
driver = webdriver.chrome() chrome() should be Chrome(), you can’t make a mistake here
2. Check if the module reference is wrong
3. In python3script Whether there is chromedriver.exe file in the directory, download it if not, download address
http://chromedriver.storage.googleapis.com/index.html
I used the above three methods to solve it. If there is any omission, please add it.
Cause Analysis: There are two ways to import modules from Python: Import module and from module import * The difference is that all imported things of the former need to be limited by the module name,...
It seems that because of the version issue, the current version of the merge layer can't be used like this. Error: Solution ...
**Cause Analysis: There are two ways to import modules from Python: import module and from module import. The difference is that all imported objects of the former need to be qualified with the module...
New to Python, when you want to learn Reptile Custom Item and references, following the custom Item Crawler used in the file, as follows: Here, tutorial.item.MyItem need to write to the file name of t...
Wrote on BookEntry.py class module, the source code for: Way call is: callable function returns a value of False Find online information that must be written in accordance with the following: Reason i...
Running pipenv gives TypeError: 'module' object is not callable Remember a project using pipenv installation problems encountered in virtual environments The cause of the above error: pipenv version a...
When call other functions or classes in Python: TypeError: 'module' object is not callable,Import and import mechanisms Details of observation import import: it is clear, attention_keras.py attention_...
Multithreading Multithreading Thread creation method Create a way: inherit the Thread class to rewrite the Run () method. Call START to turn on thread Create a threaded mode 2: Implement the runnable ...
1 Introduction H5 now there are many new features, new label, new norms, and is the major browser providers support for them, but also quite a force continuous improvement. As a front-end programmer, ...
Link to the original question: https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1279 Idea: Greedy, you can know that if the width of the top is lower than the bottom, it is impossible to...