简体   繁体   中英

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?

We have a solution that uses both selenium and leanft. The problem is that we have classes that use leanft browser implementation methods and some that use only selenium. The problem is that not everyone on the project has a leanft license. 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

But you can do the other way around.

  1. Start the browser with Selenium's webdriver
  2. Make sure to also add the LeanFT extension to the 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
  3. Navigate to a url
  4. Use BrowserFactory.Attach with a correct & unique description of that

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)
  • 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)
  • 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.)

Good Luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM