简体   繁体   中英

How can i Integrate Selenide with existing selenium webdriver code?

I have already a framework. So by which steps I can add selenide methods and code in selenium webdriver code?

You have to download the selenide.jar and start wrapping your webelement with Selenide elements to get the benefits of Selenide. Thats it, so simple.

But before that you have to consider few things if your going to use Selenide:

  1. Are you managing the driver in your code? If so, you have to think, because Selenide will be creating its driver on request and manage them automatically.
  2. What browser your using? Selenide doesnt support Safari. If your using Safari, then you have to use plain WebDriver for things get done.
  3. Selenide doesn't support Pageobject (it supports more of scripting nature). So in your code base if your using Pageobject then you have to rewrite the code base.

So depending on the way you have the framework, you have to rework accordingly for Selenide to fit in.

Using Selenide is pretty simple. Just put selenide.jar to your project and start writing $(selector).val("abcde") instead of webdriver.findElement(By.xxx()).sendKeys() .

Take a look at this 10-minute video: http://selenide.org/2014/10/01/how-to-start-writing-ui-tests/

About the Ant's concerns described above, they are not actual.

  1. Selenide allows you to manage webdriver by yourself. Look at this: https://github.com/codeborne/selenide/wiki/How-Selenide-creates-WebDriver#how-to-run-selenide-with-another-browser

  2. Selenide does support Safari. Selenide does support any other webdriver. No restrictions.

  3. Selenide supports PageObjects. Moreover, Selenide does using PageObject pattern more convenient and flexibile than the "standard" Selenium approach. Look at this: http://selenide.org/documentation/page-objects.html

Feel free to send more questions!

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