草庐IT

webdriver-w3c-spec

全部标签

python - Selenium webdriver.Firefox() 永远不会返回

~/selenium-test$whichgeckodriver/cygdrive/c/Windows/geckodriver~/selenium-test$geckodriver--version|head-n1geckodriver0.11.1~/selenium-test$python-iPython2.7.12(v2.7.12:d33e0cf91556,Jun272016,15:24:40)[MSCv.150064bit(AMD64)]onwin32Type"help","copyright","credits"or"license"formoreinformation.>>>

python - 如何使用 pythonw 运行 Selenium Webdriver?

我正在尝试通过Windows中的GUI应用程序在Selenium脚本中打开Firefox浏览器。它在使用python.exerunw.py运行时很好,但是当我使用pythonw.exerunw.py运行它时,浏览器无法启动。相反,它抛出这个异常:Traceback(mostrecentcalllast):File"bin\runw.py",line215,inprocess_instanceinstance.setup()File"bin\mixin.py",line181,insetupself.browser=self.get_firefox_browser()File"bin\m

c# - Selenium WebDriver - 找不到 Chrome 二进制文件

我正在尝试使用Chrome运行Selenium测试。我正在使用C#。varoptions=newOpenQA.Selenium.Chrome.ChromeOptions();options.BinaryLocation=@"C:\Users\Vilem\AppData\Local\Google\Chrome\Application\";using(IWebDriverdriver=newOpenQA.Selenium.Chrome.ChromeDriver(options)){...似乎找到了chromedriver.exe,但它可以找到Chrome二进制文件。我在自动搜索失败后显式设

c# - 从 Selenium webdriver 的当前窗口 GUID 获取窗口句柄 (IntPtr)

我正在trycatch整个浏览器屏幕(例如任何工具栏、面板等)的屏幕截图,而不仅仅是整个页面,所以我得到了这段代码:using(FirefoxDriverdriver=newFirefoxDriver()){driver.Navigate().GoToUrl(url);ScreenCapturesc=newScreenCapture();//HowcanIfindnaturalIntPtrhandleofwindowhere,usingGUID-likeidentifierreturningbydriver.currentWindowHandle?Imageimg=sc.Capture

c# - Selenium WebDriver.ChromeDriver Nuget 包已安装,但不适用于 MSTest

我添加了WebDriver.ChromeDrivernuget包到我的解决方案,其中包含ChromeDriver.exe文件,SeleniumWebDriver需要使用Chrome运行自动测试。查看包内容,它只包含以下文件:tools\chromedriver.exe应该要做的是将此文件夹添加到PATH环境变量中,以便可以通过以下代码访问chromedriver.exe(这是在UnitTest项目中使用MSTest):[TestMethod]publicvoidLaunchWebsite_Chrome(){//createChromeDriver-thisshouldworkifchr

c# - Selenium Webdriver 等待元素点击?

我一直在寻找解决方案,但无济于事。我有一个正在单击的按钮,有时需要很长时间才能返回数据,并且驱动程序正在超时并且我猜只是杀死了应用程序。我正在尝试使用WebDriverWait类来完成此操作,但Click()方法在我使用它的方式中不可用。WebDriverWaitwait=newWebDriverWait(browser,newTimeSpan(0,5,0));boolclicked=wait.Until((elem)=>{elem.Click();//Doesn'tWorkreturntrue;});ImplicitlyWait()方法仅用于等待元素加载,但在Click()上超时,因

c# - w3wp.exe 中出现未处理的 win32 异常

我在尝试加载ASP.NETMVC网站时遇到以下异常:Unhandledexceptionat0x07070a91inw3wp.exe:0xC0000005:Accessviolationreadinglocation0x00000000.VisualStudio即时调试器打开,我在调试器中看到的唯一信息是:Callstacklocation:msvbvm60.dll!06c00a91()该网站使用了一些COM对象,在上周之前一切正常。这个问题突然出现。这是来自Windows事件查看器的错误日志:Faultingapplicationname:w3wp.exe,version:7.5.7

c# - 删除 xmlns :i ="http://www.w3.org/2001/XMLSchema-instance" when using DataContractSerializer

如何在使用DataContractSerializer时删除xmlns:i="http://www.w3.org/2001/XMLSchema-instance"。这是我得到的:wolverine@wolverine.comwolverinety1002225wolverine366332214477TY我想得到这样的东西:wolverine@wolverine.comwolverinety1002225wolverine366332214477TY这是我的模型:[DataContract(Namespace="")]publicclassCRMProfileModel{[DataMe

c# - 在 C# 中的 Selenium WebDriver 中使用特定的 Firefox 配置文件

我正在尝试使用我已经为带有selenium2的firefox设置的配置文件,但没有用于C#的文档。我尝试的代码如下:FirefoxProfileManagerprofileManager=newFirefoxProfileManager();FirefoxProfileprofile=profileManager.GetProfile(profileName);driver=newFirefoxDriver(profile);我看到在Java中可比较的代码使用ProfilesIni而不是FirefoxProfileManager,但在C#中不可用。以这种方式设置驱动程序时,使用的sel

c# - Selenium 2.0 WebDriver 和 :hover pseudoclass 的解决方法

是否有人可以提供一个C#示例来说明如何解决涉及css伪类:hover的已知Selenium问题?基本上,我正在为一个网站进行回归测试,开始使用seleniumIDE(并在VisualStudio2008中构建我的其余代码),并且需要将鼠标悬停在一个div上,使其出现,然后单击一个链接里面说的分区。然而,我所有的努力都失败了,似乎很多人都有这个问题,但没有解决方案。提前致谢! 最佳答案 好的!因此,我感谢您的帮助(我实际上已经看到了该线程,但是.hover()类已被弃用,我无法让它工作。但是,我确实找到了一个可靠的解决方法。varph