简体   繁体   English

将leanft浏览器转换为Selenium驱动程序

[英]cast leanft browser to selenium driver

Is there a way to cast and convert the browser object that leanft uses to use selenium Iwebdriver object and toggle those leanft specialized identification methods when we need to? 有没有一种方法可以转换和转换leanft用来使用硒Iwebdriver对象的浏览器对象,并在需要时切换这些leanft专门的标识方法?

We have a solution that uses both selenium and leanft. 我们有一个同时使用硒和leanft的解决方案。 The problem is that we have classes that use leanft browser implementation methods and some that use only selenium. 问题是我们有使用leanft浏览器实现方法的类,而有些仅使用硒。 The problem is that not everyone on the project has a leanft license. 问题在于,并非项目中的每个人都拥有leanft许可证。 So they cant run the full automation code. 因此,他们无法运行完整的自动化代码。 But for others that have a license we should be able to use the specialized locator methods. 但是对于其他拥有许可证的人,我们应该可以使用专门的定位器方法。

You can't cast a leanft browser to selenium driver 您无法将leanft浏览器转换为Selenium驱动程序

But you can do the other way around. 但是您可以采取其他方法。

  1. Start the browser with Selenium's webdriver 使用Selenium的Webdriver启动浏览器
  2. Make sure to also add the LeanFT extension to the webdriver. 确保还将LeanFT扩展名添加到webdriver。 (ie for chrome you'd use [ AddExtension ])( https://seleniumhq.github.io/selenium/docs/api/dotnet/html/M_OpenQA_Selenium_Chrome_ChromeOptions_AddExtension.htm ) method (即对于Chrome,您可以使用[ AddExtension ])( https://seleniumhq.github.io/selenium/docs/api/dotnet/html/M_OpenQA_Selenium_Chrome_ChromeOptions_AddExtension.htm
  3. Navigate to a url 导航到网址
  4. Use BrowserFactory.Attach with a correct & unique description of that 使用BrowserFactory.Attach带有正确且唯一的描述

You have several non-technical solutions 您有几种非技术解决方案

  • Convert everything to Selenium (This avoids the licensing fees and may require additional training) 将所有内容转换为硒(这避免了许可费用,并且可能需要其他培训)
  • Convert everything to LeanFT (From your description, the licensing fees are an issue, so this is not a great solution) 将所有内容转换为LeanFT(根据您的描述,许可费用是一个问题,因此,这不是一个很好的解决方案)
  • Segregate work by license (allow some tests to be LeanFT and some to be Selenium. But if you go this route, then you will have limits on who can work on what) 按许可证隔离工作(允许一些测试为LeanFT,一些测试为Selenium。但是,如果您走这条路线,则将限制谁可以从事哪些工作)
  • Provide a shared VM to run automation (It sounds like you have a need only for running the automation and not editing it. This would require some coordination, but could allow you to share your code and limit the extra licenses needed.) 提供一个共享的VM来运行自动化(听起来您只需要运行自动化而不是对其进行编辑。这需要一些协调,但可以允许您共享代码并限制所需的额外许可证。)

Good Luck! 祝好运!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 LeanFT在隐身模式下打开浏览器 - LeanFT Opening Browser in Incognito Mode 在Internet Explorer中一起使用Selenium和LeanFT - Using Selenium and LeanFT together in Internet Explorer Selenium IEDriver / Firefox驱动程序浏览器位置错误 - Selenium IEDriver / Firefox Driver browser location Error 如何使用Selenium Web驱动程序来引用Web浏览器的运行实例? - How to use selenium web driver to refer to the running instance of web browser? 如何使用Selenium Web Driver和C#清除浏览器cookie - How to clear browser cookies using Selenium Web Driver and C# 如何在Selenium Web驱动程序中打开任何其他浏览器之前停止Firefox浏览器的调用跨浏览器测试 - How to stop invoking of Firefox browser before opening any othre browser in selenium web driver cross browser testing 如何从 Chrome 驱动程序中分离 Chrome 浏览器(Selenium Web 驱动程序 C#) - How to Detach Chrome Browser from Chrome Driver (Selenium Web Driver C#) 如何让Selenium仅使用一个驱动程序硒(使用C#和chromedriver)来操作两个浏览器窗口? - How to get Selenium to operate two browser windows using only one driver selenium (using c# and chromedriver)? Selenium C# | 尝试使用 ICapabilities 获取浏览器名称但出现强制转换错误 - Selenium C# | Trying to get browser name using ICapabilities but getting cast error driver.Manage()。Cookies.DeleteAllCookies(); 不适用于Edge Browser Windows 10硒c# - driver.Manage().Cookies.DeleteAllCookies(); not working for Edge Browser Windows 10 selenium c#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM