- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我最近开始使用 Coypu 通过 Web 浏览器自动执行一些任务。它非常有用,尤其是在填写表格和导航链接时。
现在,我正在尝试处理表格数据。我实际上想获取表数据并最终将其转储到管道分隔的文本文件中。
但是,我在 Coypu 和浏览表格行和列方面已经达到了我的局限性。但是,有几个示例说明如何将表读入数据集合。
一旦我达到某个点,我想获取 Coypu 对象并将它们变形为 Selenium 对象,以便我可以进行表格工作,但我似乎无法从 Coypu 中获取它。
测试代码如下: Console.WriteLine("TestMethod1()");
IWebDriver webDriver = null;
var sessionConfiguration = new SessionConfiguration()
{
Browser = Coypu.Drivers.Browser.Firefox,
AppHost = "http://blabla.com"
};
var browser = new BrowserSession(sessionConfiguration);
browser.Visit("/searches/index");
// Set the start date
browser.FillIn("sdate").With("01/01/2018");
// Set the end date
browser.FillIn("edate").With("12/30/2018");
// Set the city
browser.FindId("city").SelectOption("Chicago");
// Click on submit
browser.ClickButton("Submit");
// Get the table with data
var innerHTML = browser.FindCss("table#dataTable").InnerHTML;
Coypu.Drivers.Selenium.SeleniumWebDriver
//webDriver = (OpenQA.Selenium.IWebDriver)browser.Driver;
//IWebElement curTable = (IWebElement)browser.FindCss("table#dataTable").OuterHTML;
//TablePage page = new TablePage(webDriver);
//Utilities.ReadTable(page.Table);
Console.WriteLine( Utilities.ReadCell("Marker", 1) );
我的问题如下:
最佳答案
How do I extract the Selenium IWebDriver from Coypu BrowserSession?
给定一个 IBrowserSession browserSession
:
var nativeDriver = (OpenQA.Selenium.IWebDriver) browserSession.Driver.Native;
How do I extract out the table I want from Coypu and make it a Selenium IWebElement?
// Select your table via Coypu
var table = browser.FindCss ("table#dataTable");
// Cast ElementScope.Native to IWebElement
var nativeElement = (OpenQA.Selenium.IWebElement) table.Native;
关于c# - 如何从 Coypu 获取 Selenium IWebDriver 和 IWebElement?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53992094/
我之前已经让它工作过,所以我知道它是可能的,但在新机器上尝试一下。 我有 OS X 10.8.2、Xcode 4.6、iPad 6.1,并尝试执行此操作: Iphonedriver selenium
谁能解释一下这个“魔法”? public interface IWebDriver : ISearchContext, IDisposable { string CurrentWindowHa
我有以下代码,它完全符合我的要求: private IWebDriver driver; var options = new InternetExplorerOptions(); options.In
foreach (IWebElement element in driver.FindElementsByCssSelector("tbody.items tr")) { grid[2,i].
我们有一套使用 Specflow 和 Selenium WebDriver 运行的 UI 测试。一夜之间,这些突然停止工作,现在在每个场景上抛出以下错误: BoDi.ObjectContainerEx
同时使用 c# 编写代码以使用 appium 自动化 native android 应用程序。我需要滚动到 ListView 的末尾,但是当使用触摸操作时,我面临问题“IWebDriver 对象必须实
我正在使用 Selenium 的 IWebDriver 在 C# 中编写单元测试。 这是一个例子: IWebDriver defaultDriver = new InternetExplorerDri
我最近开始使用 Coypu 通过 Web 浏览器自动执行一些任务。它非常有用,尤其是在填写表格和导航链接时。 现在,我正在尝试处理表格数据。我实际上想获取表数据并最终将其转储到管道分隔的文本文件中。
我目前正在通过使用 Selenium IDE 导出记录的浏览器交互来学习 Java 和 C# 中的 Selenium。我注意到在 Java 代码中我们使用 WebDriver 驱动程序;,在 C# 代
我正在创建一个新的测试项目,想不出任何其他方法来尝试解决我的问题。我有另一个按预期工作的 Selenium 项目,并比较了两者以找出差异。但首先,我遇到的主要问题。在设置中,我调用 Driver.Na
我正在创建一个新框架,因为 PageFactory 已被弃用。我收到错误 BoDi.ObjectContainerException : Interface cannot be resolved: O
我正在创建一个新框架,因为 PageFactory 已被弃用。我收到错误 Error CS7036 There is no argument given that corresponds to the
This答案给出了如何在 Java selenium webdriver 中等待的示例,但是从哪里获取这些类和包,例如 IWait , IWebDriver ,和OpenQA.Selenium.Sup
我正在创建一个新框架,因为 PageFactory 已被弃用。我收到错误 Error CS7036 There is no argument given that corresponds to the
我是一名优秀的程序员,十分优秀!