Java 主函数不执行我的第二个函数

Java 主函数不执行我的第二个函数,java,eclipse,function,selenium,automation,Java,Eclipse,Function,Selenium,Automation,我做了两个函数,主要调用了它们。当我执行程序时,它只在程序停止后运行main中的第一个函数。如果我将main中的第二个函数粘贴到第一个函数的上方,它只运行第一个定义的函数,而不运行第二个函数 封装测试; 导入org.openqa.selenium.Alert; 导入org.openqa.selenium.By; 导入org.openqa.selenium.WebDriver; 导入org.openqa.selenium.WebElement; 导入org.openqa.selenium.chro

我做了两个函数,主要调用了它们。当我执行程序时,它只在程序停止后运行main中的第一个函数。如果我将main中的第二个函数粘贴到第一个函数的上方,它只运行第一个定义的函数,而不运行第二个函数

封装测试;
导入org.openqa.selenium.Alert;
导入org.openqa.selenium.By;
导入org.openqa.selenium.WebDriver;
导入org.openqa.selenium.WebElement;
导入org.openqa.selenium.chrome.ChromeDriver;
导入java.util.concurrent.TimeUnit;
公共类测试{
public static void login_和_widthdrawl()抛出InterruptedException{
System.setProperty(“webdriver.chrome.driver”,“/home/ctp-016/Downloads/chromedriver”);
WebDriver驱动程序=新的ChromeDriver();
驱动程序。获取(“http://staging.cintech.com/login");
driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
WebElement email=driver.findElement(By.id(“email”);
email.sendKeys(“zahid12@mailinator.com");
WebElement password=driver.findElement(By.id(“密码”);
密码。sendKeys(“zahid12@”);
WebElement textbox=driver.findElement(By.id(“login”);
textbox.click();
//从这里检查widthdrawl功能
睡眠(4000);
driver.findElement(By.id(“navbarDropdown”))。单击();
司机
.findElement(By.xpath(“/html/body/app root/div/app header guest/section[1]/nav/div/div/ul/li[3]/div/a[2]”)
。单击();
//从这里选择BTC加密和中心值
//WebDriverWait wait=新的WebDriverWait(驱动程序,10);
//WebElement ele=wait.until(ExpectedConditions.elementtobelickable(By.xpath(“/html/body/app root/div/app declusion/section/div[1]/div/div/div[1]/div/div[1]/span”);
//ele.click();
《睡眠》(2000年);
WebElement submit1=driver.findElement(By.xpath(“/*[@id=\“select2\”]);
submit1.click();
driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
《睡眠》(2000年);
WebElement submit12=driver.findElement(By.xpath(“/html/body/span/span/span[2]/ul/li[2]”);
submit12.单击();
driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
《睡眠》(2000年);
WebElement卷=
findElement(By.xpath(“//*[@id=\“wrapper\”]/div[1]/div/div/div[1]/div/div[3]/form/div[1]/input”);
卷。发送键(“0.001”);
WebElement wallet=driver.findElement(By.xpath(
“/html/body/app root/div/app drawing/section/div[1]/div/div/div[1]/div/div[3]/form/div[2]/div/input”);
钱包。发送钥匙(“1asas”);
WebElement click=driver.findElement(
By.xpath(“/html/body/app root/div/app-drawing/section/div[1]/div/div/div[1]/div/div[3]/form/button”);
点击。点击();
//WebElement secret2=driver.findElement(By.xpath(“/*[@id=\'VerifyTwoFA\'”]/div/div/div/app verify twofactor/div/div/form/div[1]/input”);
//秘密2.发送密钥(“0”);
WebElement submit2=driver.findElement(By.id(“loginButton”);
submit2.click();
《睡眠》(2000年);
Alert Alert=驱动程序.switchTo().Alert();
alert.accept();
//driver.quit();
//清理田地
WebElement volumeclear=
findElement(By.xpath(“//*[@id=\“wrapper\”]/div[1]/div/div/div[1]/div/div[3]/form/div[1]/input”);
volumeclear.clear();
WebElement walletclear=
findElement(By.xpath(“//*[@id=\”wrapper\”]/div[1]/div/div/div[1]/div/div[3]/form/div[2]/input”);
walletclear.clear();
}
public static void ether()引发InterruptedException{
System.setProperty(“webdriver.chrome.driver”,“/home/ctp-016/Downloads/chromedriver”);
WebDriver驱动程序=新的ChromeDriver();
//驱动程序=null;
驱动程序。获取(“http://staging.cintech.com/login");
//driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
//《睡眠》(2000年);
//WebElement从\u combo=driver.findElement(By.xpath(“/*[@id=\”select2-mySelect2-result-2d1f-3\“])中选择了\u value\u;
//从“值”组合中选择“值”。单击();
//driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
《睡眠》(2000年);
网站元素eth_卷=
findElement(By.xpath(“//*[@id=\“wrapper\”]/div[1]/div/div/div[1]/div/div[3]/form/div[1]/input”);
eth_卷发送键(“1”);
电子钱包=
findElement(By.xpath(“//*[@id=\”wrapper\”]/div[1]/div/div/div[1]/div/div[3]/form/div[2]/input”);
eth_钱包。发送密钥(“1asas”);
WebElement单击\u widthdrawl=driver.findElement(
By.xpath(“/html/body/app root/div/app-drawing/section/div[1]/div/div/div[1]/div/div[3]/form/button”);
单击宽度绘图。单击();
//WebElement secret\u eth=driver.findElement(By.xpath(“//*[@id=\'VerifyTwoFA\”]/div/div/app verify twofactor/div/div/form/div[1]/input”);
//秘密发送密钥(“0”);
WebElement submit_eth=driver.findElement(
By.xpath(“//*[@id=\”VerifyTwoFA\”]/div/div/div/app verify twofactor/div/div/form/div[2]/button”);
提交。单击();
《睡眠》(2000年);
Alert Alert_eth=驱动程序。切换到()。警报();
警报接受();
//清理田地
WebElement ethvolumeclear=
findElement(By.xpath(“//*[@id=\“wrapper\”]/div[1]/div/div/div[1]/div/div[3]/form/div[1]/input”);
ethvolumeclear.clear();
WebElement ethwalletclear=
findElement(By.xpath(“//*[@id=\”wrapper\”]/div[1]/div/div/div[1]/div/div[3]/form/div[2]/input”);
ethwalletclear.clear();
}
公共静态void main(字符串[]args)抛出Int
public static void main(String[] args) throws InterruptedException {
        try{
             ether();
        login_and_widthdrawl();
        }catch(Exception e){
            e.printStackTrace();
        }
    }