|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenQA.Selenium;
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Support.UI;
namespace FrameStudy
{
class Program
{
private const string IE_PATH = @"F:\Selenium\IEDriverServerx64";
static void Main(string[] args)
{
IWebDriver driver = new InternetExplorerDriver(IE_PATH);
INavigation navigation = driver.Navigate();
string url = @"F:\Selenium\5、iframe的处理\main.html";
navigation.GoToUrl(url);
//在Default content定位id="id1"的div
driver.FindElement(By.Id("id1"));
driver.Quit();
}
}
}
main.html
---------------------------------------------------
<html>
<head>
<title>this is frame!</title>
</head>
<body>
<div id="div1">this is a div, too!</div>
<label>input:</label>
<input id="input1"></input>
</body>
</html>
----------------------请教Selenium C#开发中为什么会报错?
提示找不到id1 |
|