Home | History | Annotate | Download | only in pyautolib

Lines Matching full:windex

945     def __init__(self, ui_test, tab_index=0, windex=0, frame_xpath=''):
955 self.windex = windex
963 windex,
1006 def _GetResultFromJSONRequest(self, cmd_dict, windex=0, timeout=-1):
1020 windex: 0-based window index on which to work. Default: 0 (first window)
1021 Use -ve windex or None if the automation command does not apply
1034 if windex is None: # Do not target any window
1035 windex = -1
1036 result = self._SendJSONRequest(windex, json.dumps(cmd_dict), timeout)
1085 def NavigateToURL(self, url, windex=0, tab_index=None, navigation_count=1):
1094 windex: The index of the browser window to work on. Defaults to the first
1105 tab_index = self.GetActiveTabIndex(windex)
1109 'windex': windex,
1113 self._GetResultFromJSONRequest(cmd_dict, windex=None)
1115 def NavigateToURLAsync(self, url, windex=0, tab_index=None):
1120 self.NavigateToURL(url, windex, tab_index, 0)
1122 def ApplyAccelerator(self, accelerator, windex=0):
1131 windex: The index of the browser window to work on. Defaults to the first
1141 'windex': windex,
1143 self._GetResultFromJSONRequest(cmd_dict, windex=None)
1145 def RunCommand(self, accelerator, windex=0):
1154 windex: The index of the browser window to work on. Defaults to the first
1163 'windex': windex,
1165 self._GetResultFromJSONRequest(cmd_dict, windex=None)
1167 def IsMenuCommandEnabled(self, accelerator, windex=0):
1176 windex: The index of the browser window to work on. Defaults to the first
1185 'windex': windex,
1187 return self._GetResultFromJSONRequest(cmd_dict, windex=None).get('enabled')
1189 def TabGoForward(self, tab_index=0, windex=0):
1198 self.ActivateTab(tab_index, windex)
1199 self.RunCommand(IDC_FORWARD, windex)
1201 def TabGoBack(self, tab_index=0, windex=0):
1210 self.ActivateTab(tab_index, windex)
1211 self.RunCommand(IDC_BACK, windex)
1213 def ReloadTab(self, tab_index=0, windex=0):
1220 windex: The index of the browser window to work on. Defaults to the first
1226 self.ActivateTab(tab_index, windex)
1227 self.RunCommand(IDC_RELOAD, windex)
1229 def CloseTab(self, tab_index=0, windex=0, wait_until_closed=True):
1237 windex: The index of the browser window to work on. Defaults to the first
1247 'windex': windex,
1250 self._GetResultFromJSONRequest(cmd_dict, windex=None)
1252 def WaitForTabToBeRestored(self, tab_index=0, windex=0, timeout=-1):
1257 windex: The index of the browser window to work on. Defaults to the first
1267 'windex': windex,
1269 self._GetResultFromJSONRequest(cmd_dict, windex=None, timeout=timeout)
1271 def ReloadActiveTab(self, windex=0):
1278 windex: The index of the browser window to work on. Defaults to the first
1284 self.ReloadTab(self.GetActiveTabIndex(windex), windex)
1286 def GetActiveTabIndex(self, windex=0):
1293 windex: The index of the browser window to work on. Defaults to the first
1301 'windex': windex,
1304 windex=None).get('tab_index')
1306 def ActivateTab(self, tab_index=0, windex=0):
1315 windex: Integer index of the browser window to use; defaults to the first
1324 'windex': windex,
1326 self.BringBrowserToFront(windex)
1327 self._GetResultFromJSONRequest(cmd_dict, windex=None)
1329 def BringBrowserToFront(self, windex=0):
1333 windex: Integer index of the browser window to use; defaults to the first
1341 'windex': windex,
1343 self._GetResultFromJSONRequest(cmd_dict, windex=None)
1358 return self._GetResultFromJSONRequest(cmd_dict, windex=None)['count']
1373 self._GetResultFromJSONRequest(cmd_dict, windex=None)
1375 def CloseBrowserWindow(self, windex=0):
1379 windex: Index of the browser window to close; defaults to 0.
1386 'windex': windex,
1388 self._GetResultFromJSONRequest(cmd_dict, windex=None)
1390 def AppendTab(self, url, windex=0):
1398 windex: The index of the browser window to work on. Defaults to the first
1412 'windex': windex,
1414 return self._GetResultFromJSONRequest(cmd_dict, windex=None).get('result')
1416 def GetTabCount(self, windex=0):
1420 windex: Integer index of the browser window to use; defaults to the first
1431 'windex': windex,
1433 return self._GetResultFromJSONRequest(cmd_dict, windex=None)['tab_count']
1435 def GetTabInfo(self, tab_index=0, windex=0):
1440 windex: Integer index of the browser window to use; defaults to the first
1455 'windex': windex,
1457 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
1459 def GetActiveTabTitle(self, windex=0):
1466 windex: Integer index of the browser window to use; defaults to the first
1475 return self.GetTabInfo(self.GetActiveTabIndex(windex), windex)['title']
1477 def GetActiveTabURL(self, windex=0):
1484 windex: Integer index of the browser window to use; defaults to the first
1493 return GURL(str(self.GetTabInfo(self.GetActiveTabIndex(windex),
1494 windex)['url']))
1496 def ActionOnSSLBlockingPage(self, tab_index=0, windex=0, proceed=True):
1503 windex: Integer index of the browser window to use; defaults to the first
1513 'windex': windex,
1516 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
1518 def GetBookmarkModel(self, windex=0):
1524 bookmarks_as_json = self._GetBookmarksAsJSON(windex)
1529 def _GetBookmarksAsJSON(self, windex=0):
1533 'windex': windex,
1535 self.WaitForBookmarkModelToLoad(windex)
1537 windex=None)['bookmarks_as_json']
1539 def WaitForBookmarkModelToLoad(self, windex=0):
1543 windex: Integer index of the browser window to use; defaults to the first
1551 'windex': windex,
1553 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
1555 def GetBookmarkBarStatus(self, windex=0):
1559 windex: Integer index of the browser window to use; defaults to the first
1574 'windex': windex,
1576 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
1578 def GetBookmarkBarStatus(self, windex=0):
1582 windex: Integer index of the browser window to use; defaults to the first
1597 'windex': windex,
1599 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
1601 def GetBookmarkBarStatus(self, windex=0):
1605 windex: Integer index of the browser window to use; defaults to the first
1620 'windex': windex,
1622 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
1624 def GetBookmarkBarVisibility(self, windex=0):
1628 windex: Integer index of the browser window to use; defaults to the first
1637 return self.GetBookmarkBarStatus(windex)['visible']
1639 def AddBookmarkGroup(self, parent_id, index, title, windex=0):
1646 windex: Integer index of the browser window to use; defaults to the first
1663 'windex': windex,
1665 self.WaitForBookmarkModelToLoad(windex)
1666 self._GetResultFromJSONRequest(cmd_dict, windex=None)
1668 def AddBookmarkURL(self, parent_id, index, title, url, windex=0):
1676 windex: Integer index of the browser window to use; defaults to the first
1691 'windex': windex,
1693 self.WaitForBookmarkModelToLoad(windex)
1694 self._GetResultFromJSONRequest(cmd_dict, windex=None)
1696 def ReparentBookmark(self, id, new_parent_id, index, windex=0):
1703 windex: Integer index of the browser window to use; defaults to the first
1718 'windex': windex,
1720 self.WaitForBookmarkModelToLoad(windex)
1721 self._GetResultFromJSONRequest(cmd_dict, windex=None)
1723 def SetBookmarkTitle(self, id, title, windex=0):
1729 windex: Integer index of the browser window to use; defaults to the first
1741 'windex': windex,
1743 self.WaitForBookmarkModelToLoad(windex)
1744 self._GetResultFromJSONRequest(cmd_dict, windex=None)
1746 def SetBookmarkURL(self, id, url, windex=0):
1752 windex: Integer index of the browser window to use; defaults to the first
1764 'windex': windex,
1766 self.WaitForBookmarkModelToLoad(windex)
1767 self._GetResultFromJSONRequest(cmd_dict, windex=None)
1769 def RemoveBookmark(self, id, windex=0):
1774 windex: Integer index of the browser window to use; defaults to the first
1785 'windex': windex,
1787 self.WaitForBookmarkModelToLoad(windex)
1788 self._GetResultFromJSONRequest(cmd_dict, windex=None)
1790 def GetDownloadsInfo(self, windex=0):
1800 windex=windex))
1802 def GetOmniboxInfo(self, windex=0):
1819 windex: the index of the browser window to work on.
1827 windex=windex))
1829 def SetOmniboxText(self, text, windex=0):
1834 windex: the index of the browser window to work on.
1844 self._GetResultFromJSONRequest(cmd_dict, windex=windex)
1847 def WaitUntilOmniboxReadyHack(self, windex=0):
1856 windex: the index of the browser to work on.
1860 lambda : self.GetOmniboxInfo(windex).Properties('has_focus'))
1862 def WaitUntilOmniboxQueryDone(self, windex=0):
1869 windex: the index of the browser window to work on.
1873 lambda : not self.GetOmniboxInfo(windex).IsQueryInProgress())
1875 def OmniboxMovePopupSelection(self, count, windex=0):
1881 windex: the index of the browser window to work on.
1888 self._GetResultFromJSONRequest(cmd_dict, windex=windex)
1890 def OmniboxAcceptInput(self, windex=0):
1897 windex: the index of the browser window to work on.
1903 self._GetResultFromJSONRequest(cmd_dict, windex=windex)
1905 def GetCookie(self, url, windex=0):
1910 windex: The index of the browser window to work on. Defaults to the first
1921 'windex': windex,
1923 return self._GetResultFromJSONRequest(cmd_dict, windex=None)['cookies']
1925 def DeleteCookie(self, url, cookie_name, windex=0):
1931 windex: The index of the browser window to work on. Defaults to the first
1943 'windex': windex,
1945 self._GetResultFromJSONRequest(cmd_dict, windex=None)
1947 def SetCookie(self, url, value, windex=0):
1953 windex: The index of the browser window to work on. Defaults to the first
1965 'windex': windex,
1967 self._GetResultFromJSONRequest(cmd_dict, windex=None)
1969 def GetSearchEngineInfo(self, windex=0):
1973 windex: The window index, default is 0.
2002 windex=windex)
2005 cmd_dict, windex=windex)['search_engines']
2007 def AddSearchEngine(self, title, keyword, url, windex=0):
2015 windex: The window index, default is 0.
2019 windex=windex)
2024 self._GetResultFromJSONRequest(cmd_dict, windex=windex)
2027 windex=0):
2035 windex: The window index, default is 0.
2039 windex=windex)
2045 self._GetResultFromJSONRequest(cmd_dict, windex=windex)
2047 def DeleteSearchEngine(self, keyword, windex=0):
2052 windex: The window index, default is 0.
2056 windex=windex)
2059 self._GetResultFromJSONRequest(cmd_dict, windex=windex)
2061 def MakeSearchEngineDefault(self, keyword, windex=0):
2066 windex: The window index, default is 0.
2070 windex=windex)
2073 self._GetResultFromJSONRequest(cmd_dict, windex=windex)
2087 windex=None))
2113 'windex': 0,
2117 self._GetResultFromJSONRequest(cmd_dict, windex=None)
2119 def GetPrefsInfo(self, windex=0):
2127 windex: The window index, default is 0.
2133 'windex': windex,
2136 self._GetResultFromJSONRequest(cmd_dict, windex=None))
2138 def SetPrefs(self, path, value, windex=0):
2159 windex: window index to work on. Defaults to 0 (first window).
2163 'windex': windex,
2167 self._GetResultFromJSONRequest(cmd_dict, windex=None)
2169 def SendWebkitKeyEvent(self, key_type, key_code, tab_index=0, windex=0):
2176 windex: window index to work on. Defaults to 0 (first window).
2187 'windex': windex,
2191 self._GetResultFromJSONRequest(cmd_dict, windex=None)
2193 def SendWebkitCharEvent(self, char, tab_index=0, windex=0):
2199 windex: window index to work on. Defaults to 0 (first window).
2210 'windex': windex,
2214 self._GetResultFromJSONRequest(cmd_dict, windex=None)
2216 def SetDownloadShelfVisible(self, is_visible, windex=0):
2221 windex: The window index, defaults to 0 (the first window).
2229 'windex': windex,
2231 self._GetResultFromJSONRequest(cmd_dict, windex=None)
2233 def IsDownloadShelfVisible(self, windex=0):
2237 windex: The window index, defaults to 0 (the first window).
2247 'windex': windex,
2249 return self._GetResultFromJSONRequest(cmd_dict, windex=None)['is_visible']
2251 def GetDownloadDirectory(self, tab_index=None, windex=0):
2259 windex: The index of the browser window to work on. Defaults to 0.
2268 tab_index = self.GetActiveTabIndex(windex)
2272 'windex': windex,
2275 windex=None)['path']))
2277 def WaitForAllDownloadsToComplete(self, pre_download_ids=[], windex=0,
2291 windex: The window index, defaults to 0 (the first window).
2299 self._GetResultFromJSONRequest(cmd_dict, windex=windex, timeout=timeout)
2347 return self._GetResultFromJSONRequest(cmd_dict, windex=window_index)
2349 def DownloadAndWaitForStart(self, file_url, windex=0):
2360 num_downloads = len(self.GetDownloadsInfo(windex).Downloads())
2364 self.NavigateToURL(file_url, windex) # Trigger download.
2367 lambda: len(self.GetDownloadsInfo(windex).Downloads()) >
2371 self, x=None, y=None, width=None, height=None, windex=0):
2382 windex: window index to work on. Defaults to 0 (first window)
2395 self._GetResultFromJSONRequest(cmd_dict, windex=windex)
2397 def WaitForInfobarCount(self, count, windex=0, tab_index=0):
2404 windex: window index. Defaults to 0 (first window)
2414 if windex >= len(windows): # not enough windows
2416 tabs = windows[windex]['tabs']
2424 self, action, infobar_index, windex=0, tab_index=0):
2436 windex: 0-based window index Defaults to 0 (first window)
2450 self._GetResultFromJSONRequest(cmd_dict, windex=windex)
2539 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
2602 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
2604 def GetNavigationInfo(self, tab_index=0, windex=0):
2636 return self._GetResultFromJSONRequest(cmd_dict, windex=windex)
2638 def GetSecurityState(self, tab_index=0, windex=0):
2656 'windex': windex,
2658 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
2660 def GetHistoryInfo(self, search_text='', windex=0):
2671 windex: index of the browser window, defaults to 0.
2681 self._GetResultFromJSONRequest(cmd_dict, windex=windex))
2684 windex=0, tab_index=0):
2698 windex: Integer index of the browser window to use; defaults to 0
2711 'windex': windex,
2717 return self._GetResultFromJSONRequest(cmd_dict, windex=None)['id']
2719 def GetExtensionsInfo(self, windex=0):
2723 windex: Integer index of the browser window to use; defaults to 0
2764 'windex': windex,
2766 return self._GetResultFromJSONRequest(cmd_dict, windex=None)['extensions']
2768 def UninstallExtensionById(self, id, windex=0):
2773 windex: Integer index of the browser window to use; defaults to 0
2783 'windex': windex,
2785 windex=None)['success']
2787 def SetExtensionStateById(self, id, enable, allow_in_incognito, windex=0):
2794 windex: Integer index of the browser window to use; defaults to 0
2802 'windex': windex,
2804 self._GetResultFromJSONRequest(cmd_dict, windex=None)
2806 def TriggerPageActionById(self, id, tab_index=0, windex=0):
2814 windex: Integer index of the browser window to use; defaults to 0
2820 'windex': windex,
2823 self._GetResultFromJSONRequest(cmd_dict, windex=None)
2825 def TriggerBrowserActionById(self, id, tab_index=0, windex=0):
2831 windex: Integer index of the browser window to use; defaults to 0
2837 'windex': windex,
2840 self._GetResultFromJSONRequest(cmd_dict, windex=None)
2842 def UpdateExtensionsNow(self, windex=0):
2850 windex: Integer index of the browser window to use; defaults to 0
2858 'windex': windex,
2860 self._GetResultFromJSONRequest(cmd_dict, windex=None)
2925 def GetPluginsInfo(self, windex=0):
2935 windex=windex))
2986 self._GetResultFromJSONRequest(cmd_dict, windex=window_index)
2995 def AddSavedPassword(self, password_dict, windex=0):
3010 windex: window index; defaults to 0 (first window).
3029 cmd_dict, windex=windex)['password_added']
3031 def RemoveSavedPassword(self, password_dict, windex=0):
3037 windex: The window index, default is 0 (first window).
3043 self._GetResultFromJSONRequest(cmd_dict, windex=windex)
3059 def SetTheme(self, crx_file_path, windex=0):
3075 return self.InstallExtension(crx_file_path, True, windex)
3166 tab_index=0, windex=0, timeout=-1):
3176 windex: The window index, default is 0.
3199 return self._GetResultFromJSONRequest(cmd_dict, windex=windex,
3202 def OpenFindInPage(self, windex=0):
3206 windex: Index of the window; defaults to 0.
3213 'windex' : windex,
3215 self._GetResultFromJSONRequest(cmd_dict, windex=None)
3217 def IsFindInPageVisible(self, windex=0):
3221 windex: Index of the window; defaults to 0.
3231 'windex' : windex,
3233 return self._GetResultFromJSONRequest(cmd_dict, windex=None)['is_visible']
3268 return self._GetResultFromJSONRequest(cmd_dict, windex=None)['observer_id']
3314 self._GetResultFromJSONRequest(cmd_dict, windex=None)['observer_id'])
3404 return self._GetResultFromJSONRequest(cmd_dict, windex=None,
3422 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
3433 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
3435 def WaitUntilNavigationCompletes(self, tab_index=0, windex=0):
3443 windex: index of the window.
3451 'windex': windex,
3455 def ExecuteJavascript(self, js, tab_index=0, windex=0, frame_xpath=''):
3465 windex: index of the window.
3479 'windex' : windex,
3520 result = self._GetResultFromJSONRequest(cmd_dict, windex=None)['result']
3552 result = self._GetResultFromJSONRequest(cmd_dict, windex=None)['result']
3558 def GetDOMValue(self, expr, tab_index=0, windex=0, frame_xpath=''):
3567 windex: index of the window.
3575 return self.ExecuteJavascript(js, tab_index, windex, frame_xpath)
3577 def CallJavascriptFunc(self, function, args=[], tab_index=0, windex=0):
3590 windex: index of the window.
3598 return self.ExecuteJavascript(js, tab_index, windex)
3600 def HeapProfilerDump(self, process_type, reason, tab_index=0, windex=0):
3620 windex: window index to work on if 'process_type' == 'renderer'.
3637 result = self.ExecuteJavascript(js, tab_index, windex)
3815 def LaunchApp(self, app_id, windex=0):
3823 windex: The index of the browser window to work on. Defaults to 0 (the
3829 self.AppendTab(GURL('chrome://newtab'), windex) # Also activates this tab.
3834 return self._GetResultFromJSONRequest(cmd_dict, windex=windex)
3836 def SetAppLaunchType(self, app_id, launch_type, windex=0):
3846 windex: The index of the browser window to work on. Defaults to 0 (the
3860 return self._GetResultFromJSONRequest(cmd_dict, windex=windex)
3862 def GetV8HeapStats(self, tab_index=0, windex=0):
3880 return self._GetResultFromJSONRequest(cmd_dict, windex=windex)
3882 def GetFPS(self, tab_index=0, windex=0):
3902 return self._GetResultFromJSONRequest(cmd_dict, windex=windex)
3904 def IsFullscreenForBrowser(self, windex=0):
3909 windex=windex).get('result')
3911 def IsFullscreenForTab(self, windex=0):
3915 windex=windex).get('result')
3917 def IsMouseLocked(self, windex=0):
3921 windex=windex).get('result')
3923 def IsMouseLockPermissionRequested(self, windex=0):
3928 windex=windex).get('result')
3930 def IsFullscreenPermissionRequested(self, windex=0):
3935 windex=windex).get('result')
3937 def IsFullscreenBubbleDisplayed(self, windex=0):
3942 windex=windex).get('result')
3944 def IsFullscreenBubbleDisplayingButtons(self, windex=0):
3949 windex=windex).get('result')
3951 def AcceptCurrentFullscreenOrMouseLockRequest(self, windex=0):
3955 windex=windex)
3957 def DenyCurrentFullscreenOrMouseLockRequest(self, windex=0):
3961 windex=windex)
4030 self._GetResultFromJSONRequest(cmd_dict, windex=None)
4055 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
4079 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
4093 self._GetResultFromJSONRequest(cmd_dict, windex=None)
4095 def SubmitForm(self, form_id, tab_index=0, windex=0, frame_xpath=''):
4109 if self.ExecuteJavascript(js, tab_index, windex
4114 tab_index, windex, frame_xpath),
4125 self._GetResultFromJSONRequest(cmd_dict, windex=None)
4150 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
4192 lambda: self._GetResultFromJSONRequest(cmd_dict, windex=None)), \
4210 result = self._GetResultFromJSONRequest(cmd_dict, windex=None)
4225 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
4241 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
4263 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
4277 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
4299 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
4316 lambda: self._GetResultFromJSONRequest(cmd_dict, windex=None)), \
4343 windex=None)
4349 self._GetResultFromJSONRequest(cmd_dict, windex=None)
4374 self._GetResultFromJSONRequest(cmd_dict, windex=None)
4390 self._GetResultFromJSONRequest(cmd_dict, windex=None)
4409 result = self._GetResultFromJSONRequest(cmd_dict, windex=None)
4423 lambda: self._GetResultFromJSONRequest(cmd_dict, windex=None)), \
4461 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
4508 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
4520 result = self._GetResultFromJSONRequest(cmd_dict, windex=None)
4523 def GetTimeInfo(self, windex=0):
4541 return self._GetResultFromJSONRequest(cmd_dict, windex=windex)
4543 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
4563 self._GetResultFromJSONRequest(cmd_dict, windex=None)
4572 self._GetResultFromJSONRequest(cmd_dict, windex=None)
4586 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
4602 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
4618 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
4632 self._GetResultFromJSONRequest(cmd_dict, windex=None)
4634 def WaitForHtermText(self, text, msg=None, tab_index=0, windex=0):
4646 windex: the window index for the hterm tab. Default: 0.
4650 msg=msg, tab_index=tab_index, windex=windex)
4652 def GetHtermRowsText(self, start, end, tab_index=0, windex=0):
4662 windex: the window index for the hterm tab. Default: 0.
4667 tab_index=tab_index, windex=windex)
4669 def SendKeysToHterm(self, text, tab_index=0, windex=0):
4678 windex: the window index for the hterm tab. Default: 0.
4683 tab_index=tab_index, windex=windex)