Question

I am having old test automation framework developed using Selenium 1.0 and now wants to migrate my code to WebDriver.

Is there any easiest method to do this migration?

I have overridden most of the methods such as type, click, getText, getSelectedLabel, assert etc etc. I see the only method is to re-write all methods again from scratch, I have already started this process but If I continue with the same method It will take many days for me.

Please suggest if anyone has any better approach.

Thanks in advance.

Was it helpful?

Solution

They are completely different technologies. There is no way to migrate them over to selenium 2 per se.

Luckily, the recent Selenium releases have implemented what's called "WebDriver Backed Selenium" so technically if you are using those tests, it's implicitly running them "as" WebDriver tests.

Other than that, no, there is no easy way.

I had the same issue - we are migrating our entire regression suite over to S2 now :)

OTHER TIPS

In the Webdriver documentation, they explain a method to start migrating from Selenium RC to Selenium WebDriver. Basically, is creating the selenium object like this:

WebDriver driver = new FirefoxDriver();
Selenium selenium = new WebDriverBackedSelenium(driver, "http://www.yoursite.com");

the main problem with this migration (instead of changing the whole code) is the wait for page to load. As they say, the command WaitForPageToLoad returns too soon. The getEval is another command that you have to change. I think that the best approach is to make functions with the main commands that differs from Selenium RC to Selenium WebDriver, and, once everything is "working" keep modifying your code until no Selenium RC is present. This is how we did the migration, and we had lots of lines of code.

This is the link, where they explain how to start: http://www.seleniumhq.org/docs/appendix_migrating_from_rc_to_webdriver.jsp#migrating-to-webdriver-reference

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top