2121
2222from SeleniumLibrary .base import ContextAware
2323from SeleniumLibrary .errors import WindowNotFound
24- from SeleniumLibrary .utils import is_string
2524
2625
2726WindowInfo = namedtuple ("WindowInfo" , "handle, id, name, title, url" )
@@ -38,15 +37,15 @@ def __init__(self, ctx):
3837 }
3938
4039 def get_window_handles (self , browser ):
41- if is_string (browser ) and browser == "ALL" :
40+ if isinstance (browser , str ) and browser == "ALL" :
4241 handles = []
4342 current_index = self .drivers .current_index
4443 for index , driver in enumerate (self .drivers , 1 ):
4544 self .drivers .switch (index )
4645 handles .extend (self .driver .window_handles )
4746 self .drivers .switch (current_index )
4847 return handles
49- elif is_string (browser ) and browser == "CURRENT" :
48+ elif isinstance (browser , str ) and browser == "CURRENT" :
5049 return self .driver .window_handles
5150 else :
5251 current_index = self .drivers .current_index
@@ -60,14 +59,14 @@ def get_window_infos(self, browser="CURRENT"):
6059 current_index = self .drivers .current_index
6160 except AttributeError :
6261 current_index = None
63- if is_string (browser ) and browser .upper () == "ALL" :
62+ if isinstance (browser , str ) and browser .upper () == "ALL" :
6463 infos = []
6564 for index , driver in enumerate (self .drivers , 1 ):
6665 self .drivers .switch (index )
6766 infos .extend (self ._get_window_infos ())
6867 self .drivers .switch (current_index )
6968 return infos
70- elif is_string (browser ) and browser .upper () == "CURRENT" :
69+ elif isinstance (browser , str ) and browser .upper () == "CURRENT" :
7170 return self ._get_window_infos ()
7271 else :
7372 self .drivers .switch (browser )
@@ -100,7 +99,7 @@ def select(self, locator, timeout=0):
10099 time .sleep (0.1 )
101100
102101 def _select (self , locator ):
103- if not is_string (locator ):
102+ if not isinstance (locator , str ):
104103 self ._select_by_excludes (locator )
105104 elif locator .upper () == "CURRENT" :
106105 pass
0 commit comments