Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Commit

Permalink
fix: multi bank account selection
Browse files Browse the repository at this point in the history
  • Loading branch information
bipin0x01 committed Jun 17, 2022
1 parent 2302ef6 commit d3dde8a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions utils/func.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ def apply_ipo(kitta,crn,txn_pin):
bank_dropdown = Select(web_driver.driver.find_element(By.XPATH,"//*[@name='selectBank']"))
bank_list = bank_dropdown.options
# check if there are multiple bank accounts
if len(bank_list) > 1:
if len(bank_list) > 2:
# print empty line
print('\n')
termcolor.cprint("Multiple bank accounts detected. Please select a bank account to continue...",'red')
# list bank accounts
banks = []
Expand All @@ -107,9 +109,8 @@ def apply_ipo(kitta,crn,txn_pin):
termcolor.cprint(tabulate(banks, headers=col_names, tablefmt="grid"),'red')
selected_bank = int(input("Select the respective option to continue:"))
# Select the bank choosen by the User
bank_dropdown.select_by_index(selected_bank+1)
select = bank_dropdown.select_by_index(selected_bank+1).text
print(select)

web_driver.driver.find_element(By.XPATH,"//*[@id='selectBank']/option[" + str(selected_bank+1) + "]").click()
else:
# If only one bank account is linked, choose the first one
web_driver.driver.find_element(By.XPATH,"//*[@id='selectBank']/option[2]").click()
Expand Down

0 comments on commit d3dde8a

Please sign in to comment.