def getcoin(self): driver = Browser().open_browser() bs = BasePage(driver) driver.get('http://192.168.1.141:3001/') files = GetFileName().getfilename() w1 = files[0].split('--')[2] #config = configparser.ConfigParser() #dir = os.path.abspath('.').split('case')[0] #config.read(dir + "/config/config.ini", encoding='UTF-8') #config.read("../config/config.ini", encoding='UTF-8') #w1 = config.get("theWallets", "wallet1") #a=GetConf().getwallet(w1) time.sleep(2) driver.find_element_by_name('user').send_keys(w1) ''' 待调试 g=GetConf() w1=g.getconf("theWallets","wallet1") print(w1) bs.find_element('name<=>user').send_keys(w1) ''' ''' creat 100 coin ''' for i in range(1): bs.find_element('classname<=>content-form-signup').click() driver.quit()
def asecretaddrtob_7tri(self, tri): ''' A隐私地址转B 7TRI ''' driver = Login().login() files = GetFileName().getfilename() w2 = files[1].split('--')[2] bs = BasePage(driver) # config = configparser.ConfigParser() # dir = os.path.abspath('.').split('case')[0] # config.read("../config/config.ini", encoding='UTF-8') # w2 = config.get("theWallets", "wallet2") try: driver.find_element_by_xpath( "//*[@id='utxoPrivacyDestAddressId']").send_keys(w2) driver.implicitly_wait(3) driver.find_element_by_id('utxoPrivacyAmountId').send_keys(tri) driver.implicitly_wait(1) driver.find_element_by_id('privacyTransferButtonId').click() driver.implicitly_wait(1) #driver.switch_to_alert().accept() driver.find_element_by_xpath( '//*[@id="refreshCurrentBalanceButton"]').click() time.sleep(10) except Exception as e: print(e) driver.quit()
def asunaddrtob_2tri(self, tri): ''' A明文转B 2TRI ''' driver = Login().login() bs = BasePage(driver) config = configparser.ConfigParser() files = GetFileName().getfilename() v = files[1].split('--')[2] # dir = os.path.abspath('.').split('case')[0] # config.read( "../config/config.ini", encoding='UTF-8') # w2 = config.get("theWallets", "wallet2") try: driver.find_element_by_xpath( "/html/body/div[2]/div[1]/div[4]/div[1]/input").send_keys(v) time.sleep(3) driver.find_element_by_id('utxoNormalAmountId').send_keys(tri) time.sleep(2) driver.find_element_by_id('normalTransferButtonId').click() time.sleep(2) #driver.switch_to_alert().accept() driver.find_element_by_xpath( '//*[@id="refreshCurrentBalanceButton"]').click() time.sleep(10) except Exception as e: print(e) driver.quit()
def asecretamounttob_6tri(self, tri): ''' A隐藏地址隐私金额转B TRI ''' driver = Login().login() bs = BasePage(driver) files = GetFileName().getfilename() w2 = files[1].split('--')[2] # config = configparser.ConfigParser() # dir = os.path.abspath('.').split('case')[0] # config.read( "../config/config.ini", encoding='UTF-8') # w2 = config.get("theWallets", "wallet2") try: driver.find_element_by_xpath( "/html/body/div[2]/div[1]/div[4]/div[1]/input").send_keys(w2) driver.implicitly_wait(1) driver.find_element_by_id('utxoNormalAmountId').send_keys(tri) driver.implicitly_wait(1) bs.find_element('id<=>hidePrivacyAmount').click() driver.implicitly_wait(1) bs.find_element('id<=>hideNormalAmount').click() driver.implicitly_wait(1) driver.find_element_by_id('normalTransferButtonId').click() driver.implicitly_wait(1) #driver.switch_to_alert().accept() driver.find_element_by_xpath( '//*[@id="refreshCurrentBalanceButton"]').click() time.sleep(35) except Exception as e: print(e) driver.quit()
def getsecretcoin(self): driver = Browser().open_browser() bs = BasePage(driver) driver.get('http://192.168.1.141:3001/') files = GetFileName().getfilename() w1 = files[0].split('--')[2] #w1=framework.getconf.GetConf().getwallet('wallet1') time.sleep(2) bs.find_element('name<=>user').send_keys(w1) time.sleep(2) driver.find_element_by_xpath( '/html/body/div/div/form/div[2]/label').click() time.sleep(2) for i in range(1): bs.find_element('classname<=>content-form-signup').click() driver.quit()
def login(self): driver = Browser().open_browser() driver.get('http://192.168.1.141:3000/') config = configparser.ConfigParser() #dir = os.path.abspath('.').split('case')[0] #config.read("../config/config.ini", encoding='UTF-8') #v1 = config.get("file_Address", "address") files = GetFileName().getfilename() v1 = 'E:\\t_login\\' + files[0] wait = WebDriverWait(driver, 10) wait.until( EC.element_to_be_clickable( (By.XPATH, '//*[@id="LoadFromFileId"]'))) driver.find_element_by_xpath('//*[@id="LoadFromFileId"]').send_keys(v1) driver.implicitly_wait(5) return driver