TA的每日心情 | 怒 2016-8-31 13:02 |
---|
签到天数: 15 天 连续签到: 1 天 [LV.4]测试营长
|
file:///C:\Users\Hoo\AppData\Roaming\Tencent\Users\907486688\QQ\WinTemp\RichOle\]CEL]WNLXWDS%ZD9DXC08AQ.pngpackage com.goodtest.tinypace.page;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
public class addfacility {
WebDriver driver;
@FindBy(xpath = "//*[@id='menu']/li[3]/a/span")
public WebElement neirong;
@FindBy (xpath = "//*[@id='collapse-40']/div/ul/li[9]/a")
public WebElement facility;
@FindBy(xpath = "/html/body/ul/li[2]/a")
public WebElement addfacility;
@FindBy(name = "brand")
public WebElement brand;
@FindBy(id = "btnSubmit")
public WebElement btnsubmit;
public void add_facility(String Brand) throws InterruptedException {
Thread.sleep(1000);
neirong.click();
facility.click();
addfacility.click();
driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
brand.sendKeys("Brand");
btnsubmit.click();
}
}
在查找addfacility;这个元素时就出问题了,因为这个元素是需要在网站内跳转菜单后才出来的,这种应该怎么用,谢谢 !
|
|