Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1import io 

2from PIL import Image 

3from . import Base 

4 

5 

6class Dummy(Base): 

7 def boot_driver(self): 

8 class dummydriver: 

9 name = "dummy" 

10 desired_capabilities = {} 

11 current_url = "http://example.com" 

12 page_source = "source string" 

13 title = "title string" 

14 window_handles = [] 

15 session_id = "dummy" 

16 current_window_handle = None 

17 capabilities = None 

18 log_types = [] 

19 w3c = False 

20 

21 def __init__(self, dummyparam=None): 

22 """ 

23 initialize dummy driver with dummy parameters 

24 """ 

25 super().__init__() 

26 

27 def find_element(self, k, v): 

28 return None 

29 

30 def find_elements(self, k, v): 

31 return [] 

32 

33 def get_cookies(self): 

34 return {} 

35 

36 def get_window_size(self): 

37 return 0, 0 

38 

39 def get_window_position(self): 

40 return 0, 0 

41 

42 def close(self): 

43 pass 

44 

45 def quit(self): 

46 pass 

47 

48 def get_screenshot_as_png(self): 

49 buf = io.BytesIO() 

50 Image.new('1', (1, 1)).save(buf, format='png') 

51 return buf.getvalue() 

52 

53 def get(self, v): 

54 self.current_url = v 

55 return v 

56 

57 return dummydriver()