11from selenium .webdriver import ActionChains
22from selenium .webdriver .support import expected_conditions as EC
3- from selenium .webdriver .support .ui import WebDriverWait
43from selenium .webdriver .common .by import By
5- from selenium .common .exceptions import ElementClickInterceptedException
4+ from selenium .common .exceptions import (
5+ ElementClickInterceptedException ,
6+ TimeoutException ,
7+ )
68import time
79from runestone .unittest_base import module_fixture_maker , RunestoneTestCase
810
@@ -21,7 +23,7 @@ def test_hello(self):
2123 self .driver .get (self .host + "/index.html" )
2224 try :
2325 self .wait .until (EC .presence_of_element_located ((By .ID , "test1" )))
24- except :
26+ except TimeoutException :
2527 text = self .driver .page_source
2628 print (text [:300 ])
2729 t1 = self .driver .find_element_by_id ("test1" )
@@ -47,7 +49,7 @@ def test_hidden(self):
4749 self .driver .get (self .host + "/index.html" )
4850 try :
4951 self .wait .until (EC .presence_of_element_located ((By .ID , "testprefixcode" )))
50- except :
52+ except TimeoutException :
5153 text = self .driver .page_source
5254 print (text [:300 ])
5355 t1 = self .driver .find_element_by_id ("testprefixcode" )
@@ -143,7 +145,7 @@ def test_livecode_datafile(self):
143145 print ("Ouput so far:" , output .text )
144146 try :
145147 self .assertLess (count , 20 )
146- except :
148+ except Exception :
147149 print ("WARNING - No response from JOBE server" )
148150
149151 def test_activity_count (self ):
0 commit comments