Skip to content

Commit

Permalink
Make click element in the page center
Browse files Browse the repository at this point in the history
  • Loading branch information
qiagu committed Feb 24, 2021
1 parent 3446e4d commit f68076c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion cycif_db/galaxy_download/_list_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,18 @@ def get_history_names_and_ids(self):
"""
rval = []
for tds in self.history_rows:
self.driver.execute_script("arguments[0].scrollIntoView()", tds[0])
tds[0].click()
log.info("Click history row %s" % tds[0].text)
popmenu = WebDriverWait(self.driver, self.wait_time).until(
EC.presence_of_element_located((By.CLASS_NAME, 'popmenu-wrapper')))
view_e = popmenu.find_element(By.LINK_TEXT, 'View')
link = view_e.get_attribute('href')
his_id = link.split('id=')[1]
his_name = tds[0].text
rval.append((his_name, his_id))
self.driver.find_element(By.ID, 'grid-table-body').click()
# remove the popmenu
tds[2].click()

return rval

Expand Down
2 changes: 1 addition & 1 deletion scripts/download_shared_histories.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
if args.debug:
logging.basicConfig(level=logging.DEBUG)

shared = SharedGalaxy(headless=False)
shared = SharedGalaxy(browser='Chrome', headless=True, cutoff_time='2021-01-13')
shared.download(args.destination, server=args.server, api_key=args.api_key)

0 comments on commit f68076c

Please sign in to comment.