What is the difference between Selenium 1.x and selenium 2.x and webdriver.....

960 views
Skip to first unread message

gourav nahata

unread,
Nov 19, 2011, 6:55:49 AM11/19/11
to Selenium Users
I need your help for how to setup a new version of Selenium- RC. I
tried to download it but I couldn't find out.
I have some silllyyyyyyy doubts please can some one clear me and
help.....

1. What we call it as selenium 1 or selenium 2. is it the
##selenium -standaloneserver..jar file##
or is it the ## java-client -api.jar. ##
2. Also what are the things that i need to include to shift from
selenium 1 to selenium 2 .
3. It would be great help if someone can give me the link from where
I can download the Selenium 2.0 which needs to be installed for
testing iPhone web application


Can you please tell. I will always be thanksful to u.

Thanks Gourav

Mark Collin

unread,
Nov 20, 2011, 4:32:42 AM11/20/11
to seleniu...@googlegroups.com
Selenium RC is what the Selenium 1 API is commonly referred to. In Selenium
2 we now have the WebDriver API to play with which is what you should be
using moving forward. The old Selenium 1 API is still available but it is
no longer being added to.

Thanks Gourav

--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to
selenium-user...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/selenium-users?hl=en.


--
This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

If you have received this email in error please notify postm...@ardescosolutions.com

Gourav Nahata

unread,
Nov 20, 2011, 7:04:13 AM11/20/11
to seleniu...@googlegroups.com
But Mark ,

My previous frameworf is based on selenium RC 1.0.3   If I remove that api and add the new java api will it work with previous script


Thanks
Gourav Nahata
HCL Great Britain Ltd.
Hemel Hempstead,
UK

Mark Collin

unread,
Nov 20, 2011, 9:12:35 AM11/20/11
to seleniu...@googlegroups.com

Gourav Nahata

unread,
Nov 20, 2011, 10:25:05 AM11/20/11
to seleniu...@googlegroups.com
hi Mark..Thx for the link.

Also I have to deliver some thing urgent to client for testing iPHone application and I dont have any idea about webdriver.

So can i use selenium 2.0 for time being and not the   Webdriver for this project.

Will only selenium 2.0 serve my purpose.

import org.openqa.selenium.WebDriverBackedSelenium

Class TestDriver extends SeleneseTestcase
{
setup()
{
selenium = new Defaultselenium(........);
selenium.start(addrequestheader=true);
selenium.addCustomRequestHeader("x-Nokia-Msisdn", "525554003650");
selenium.addCustomRequestHeader("User-Agent","Mozilla/5.0 (iPhone;");
seleniu.open();

}

}


will it open the new website with iPhone user agent

Mark Collin

unread,
Nov 21, 2011, 1:38:03 AM11/21/11
to seleniu...@googlegroups.com

I suggest learning WebDriver.  There was no iPhone support in the old Selenium 1 codebase so I have no idea how well the old selenium commands will translate across to the iPhone driver (I suspect you will have problems if you try to use them).

 

The code you have below will not work, you have not instantiated a driver object and just adding the word iPhone to your request header is not going to do anything useful.  Read the link I gave you again and carefully this time.

 

Remember Selenium  2 is not Selenium RC.  If you ask for help on Selenium RC everybody will assume you are talking about Selenium 1.

gourav nahata

unread,
Nov 21, 2011, 11:47:46 AM11/21/11
to Selenium Users
Hi Mark ,

I tried to move my existing framework on selenium 2.13.0. I have
still not used the webdriver object.

I will use it whenever necessary. I have done following changes:-

==> Imported
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriverBackedSelenium;

===> WebDriver driver = new FirefoxDriver();

driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
Selenium selenium = new
WebDriverBackedSelenium(driver,testURL);


I am expecting my old framework to run as it is because I have used
only selenium object in my framework . But selenium opens the baseurl
only but for all the objects it says classnot found for the Object.

I am using xpath method to find the objects.

Can you suggest where I am wrong now.

Thanks

> On Sun, Nov 20, 2011 at 2:12 PM, Mark Collin <m...@ardescosolutions.com>


> wrote:
>
> Yes as long as you use web driver backed selenium:
>

> http://seleniumhq.org/docs/appendix_migrating_from_rc_to_webdriver.ht...


> ating-to-webdriver-reference
>
> From: seleniu...@googlegroups.com
> [mailto:seleniu...@googlegroups.com] On Behalf Of Gourav Nahata
> Sent: 20 November 2011 12:04
> To: seleniu...@googlegroups.com
> Subject: Re: [selenium-users] What is the difference between Selenium 1.x
> and selenium 2.x and webdriver.....
>
> But Mark ,
>
> My previous frameworf is based on selenium RC 1.0.3   If I remove that api
> and add the new java api will it work with previous script
>
> Thanks
>

> On Sun, Nov 20, 2011 at 9:32 AM, Mark Collin <m...@ardescosolutions.com>

> <mailto:selenium-users%2Bunsu...@googlegroups.com> .
> For more options, visit this group athttp://groups.google.com/group/selenium-users?hl=en.


>
> --
> This message contains confidential information and is intended only for the
> individual named. If you are not the named addressee you should not
> disseminate, distribute or copy this e-mail. Please notify the sender
> immediately by e-mail if you have received this e-mail by mistake and delete
> this e-mail from your system. If you are not the intended recipient you are
> notified that disclosing, copying, distributing or taking any action in
> reliance on the contents of this information is strictly prohibited.
>
> If you have received this email in error please notify

> postmas...@ardescosolutions.com


>
> --
> You received this message because you are subscribed to the Google Groups
> "Selenium Users" group.
> To post to this group, send email to seleniu...@googlegroups.com.
> To unsubscribe from this group, send email to
> selenium-user...@googlegroups.com

> <mailto:selenium-users%2Bunsu...@googlegroups.com> .
> For more options, visit this group athttp://groups.google.com/group/selenium-users?hl=en.


>
> --
> Gourav Nahata
> HCL Great Britain Ltd.
> Hemel Hempstead,
> UK
>
> --
> You received this message because you are subscribed to the Google Groups
> "Selenium Users" group.
> To post to this group, send email to seleniu...@googlegroups.com.
> To unsubscribe from this group, send email to
> selenium-user...@googlegroups.com.

> For more options, visit this group athttp://groups.google.com/group/selenium-users?hl=en.


>
> -- This message contains confidential information and is intended only for
> the individual named. If you are not the named addressee you should not
> disseminate, distribute or copy this e-mail. Please notify the sender
> immediately by e-mail if you have received this e-mail by mistake and delete
> this e-mail from your system. If you are not the intended recipient you are
> notified that disclosing, copying, distributing or taking any action in
> reliance on the contents of this information is strictly prohibited. If you
> have received this email in error please notify

> postmas...@ardescosolutions.com


>
> --
> You received this message because you are subscribed to the Google Groups
> "Selenium Users" group.
> To post to this group, send email to seleniu...@googlegroups.com.
> To unsubscribe from this group, send email to
> selenium-user...@googlegroups.com

> <mailto:selenium-users%2Bunsu...@googlegroups.com> .
> For more options, visit this group athttp://groups.google.com/group/selenium-users?hl=en.


>
> --
> Gourav Nahata
> HCL Great Britain Ltd.
> Hemel Hempstead,
> UK
>
> --
> You received this message because you are subscribed to the Google Groups
> "Selenium Users" group.
> To post to this group, send email to seleniu...@googlegroups.com.
> To unsubscribe from this group, send email to
> selenium-user...@googlegroups.com.

> For more options, visit this group athttp://groups.google.com/group/selenium-users?hl=en.


>
> --
> This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.
>

> If you have received this email in error please notify postmas...@ardescosolutions.com- Hide quoted text -
>
> - Show quoted text -

Mark Collin

unread,
Nov 21, 2011, 12:01:15 PM11/21/11
to seleniu...@googlegroups.com
Nope because you have not supplied enough test code to see what you are
doing and there is no stack trace to try and work out what went wrong.

Hi Mark ,

Thanks

If you have received this email in error please notify postm...@ardescosolutions.com

Gourav Nahata

unread,
Nov 21, 2011, 12:51:44 PM11/21/11
to seleniu...@googlegroups.com
Hi Mark ,
 
I got the issue....actually I made the selenium object as private for TestDriver class .
 
Earlier when selenium was not recognizing objects I was writing like:-

Selenium selenium = new WebDriverBackedSelenium(driver,testURL);

 

Now I tried with :-

selenium = new WebDriverBackedSelenium(driver,testURL);

and it is finding the Object.  I am sending you my testdriver.java .

Question:-  In the attached screenshot selenesetestcase abstract class is showing in the cut state(Please see screenshot).   What does it mean??

Question:- I have just made the webdrivers object as you suggested and will try to use it.

But how to instantiate the iPhonedriver's object

 

Actually My one of the task to move my script from RC 1 to selenium 2 is done with your help. Now I want to launch mozillafirefox in  iPhoneDriverMode any suggestion.


Thanks & Regards
Gourav Nahata
Testdriver.java
typeselenesetestcaseisdepriciated.jpg

Krishnan Mahadevan

unread,
Nov 21, 2011, 10:27:07 PM11/21/11
to seleniu...@googlegroups.com
Please see answers "in-line"

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"


On Mon, Nov 21, 2011 at 11:21 PM, Gourav Nahata <gourav....@gmail.com> wrote:
Hi Mark ,
 
I got the issue....actually I made the selenium object as private for TestDriver class .
 
Earlier when selenium was not recognizing objects I was writing like:-

Selenium selenium = new WebDriverBackedSelenium(driver,testURL);

 

Now I tried with :-

selenium = new WebDriverBackedSelenium(driver,testURL);

and it is finding the Object.  I am sending you my testdriver.java .

Question:-  In the attached screenshot selenesetestcase abstract class is showing in the cut state(Please see screenshot).   What does it mean??

Its eclipse's way of warning that the "striked out" class in question is deprecated (meaning marked for deletion) In probably a couple of releases, that class would be deleted and as such you SHOULDNOT use it, but use something else. I think in this case it is SeleneseTestBase (I might be wrong too on the exact name of the class)

Question:- I have just made the webdrivers object as you suggested and will try to use it.

But how to instantiate the iPhonedriver's object

WebDriver baseDriver = new IPhoneDriver();
Selenium selenium = new WebDriverBackedSelenium(baseDriver, "URL");

PS : Compilation error FREE only. Not sure about RUNTIME errors, since I havent yet tried this. 

Mark Collin

unread,
Nov 22, 2011, 1:37:16 AM11/22/11
to seleniu...@googlegroups.com

Don’t need me to answer any more and yes it is SeleneseTestBase that should be used (The IDE exporter is still setting it to SeleneseTestCase which it should not do).

Reply all
Reply to author
Forward
0 new messages