admin管理员组文章数量:1402924
I have found the product name ID and checked that it's neither hidden nor missing. However, when I call the function to retrieve the ID, it says the ID cannot be found. Are there any ways to fix this or alternative solutions?
[Test]
public void Themsanphamhople()
{
LoginAdmin("thien", "123456");
// Chuyển đến trang danh sách sản phẩm
driver.Navigate().GoToUrl("http://localhost:8838/Admin/Product/Index");
try
{
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
IWebElement btnThem = wait.Until(drv => drv.FindElement(By.Id("btn-themsanpham")));
btnThem.Click();
IWebElement tenSanPham = driver.FindElement(By.Name("TENSP"));
tenSanPham.SendKeys("Harry porter");
}
catch (WebDriverTimeoutException ex)
{
Assert.Fail($"Lỗi khi chạy test: {ex.Message}");
}
}
The ID is inside a form, and I have already checked that it is neither duplicated nor hidden and I have tried all types of find element methods.
本文标签: selenium webdriverHow to test a form in an ASPNET MVC web applicationStack Overflow
版权声明:本文标题:selenium webdriver - How to test a form in an ASP.NET MVC web application? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744343102a2601599.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论