こんにちは、これは以下のコードです: 私がやりたいのは、XPath の値を渡すだけの関数を作成することです。そのため、何度も何driver.findElement(By.xpath(""))
度も記述する必要はありません。
driver.findElement(By.xpath("//*[@id='lead_source']")).sendKeys("Existing Customer");
driver.findElement(By.xpath("//*[@id='date_closed']")).sendKeys("08/07/2013");
driver.findElement(By.xpath("//*[@id='sales_stage']")).sendKeys("Opportuntiy Qualification");
driver.findElement(By.xpath("//*[@id='opportunity_monthly_volume']")).sendKeys("10895");
driver.findElement(By.xpath("//*[@id='probability']")).sendKeys("90");
driver.findElement(By.xpath("//*[@id='opportunity_sales_rep']")).sendKeys("Sales Rep");
driver.findElement(By.xpath("//*[@id='opportunity_sales_regions']")).sendKeys("Northeast");
driver.findElement(By.xpath("//*[@id='opportunity_current_lab']")).sendKeys("Current lab");
driver.findElement(By.cssSelector(Payermixcss +"opportunity_medicare")).sendKeys("5");