@findby的用法
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/a/span")
public WebElementneirong;
@FindBy (xpath = "//*[@id='collapse-40']/div/ul/li/a")
public WebElement facility;
@FindBy(xpath = "/html/body/ul/li/a")
public WebElement addfacility;
@FindBy(name = "brand")
public WebElement brand;
@FindBy(id = "btnSubmit")
public WebElement btnsubmit;
public voidadd_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;这个元素时就出问题了,因为这个元素是需要在网站内跳转菜单后才出来的,这种应该怎么用,谢谢 !
切换TAB的吗? 是selenium么?先说是什么软件呀。上来粘代码,一言不合就粘代码 梦想家 发表于 2016-8-25 10:34
是selenium么?先说是什么软件呀。上来粘代码,一言不合就粘代码
是selenium 2.0 的 selenium交流专用超级 191707998
我在这个论坛找的都是大神
页:
[1]