Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I'm working through the "Selenium Simplified" book just to really gain a solid understanding of Selenium and Java. I know the basics of Java, but this one is frustrating me. I must be missing some important jar file, but I'm not sure what that is. I'm also wondering if this has to do with version issues. The book goes through and guides you through an older version of Selenium as well as using JUnit3. I did try the code in JUnit3 and I'm still getting the warnings for the deprecated class. Here's a snapshot of my code with the libraries being used.Screenshot from Eclipse

share|improve this question
    
Which version of Selenium are you using? –  user246 Jun 28 '11 at 15:08
    
Selenium Version 1.0.10 –  Jason M Jun 28 '11 at 15:40
add comment

2 Answers

SeleneseTestCase is deprecated and shouldn't be used any more, use extends SeleneseTestBase instead.

share|improve this answer
    
if SeleneseTestCase is deprecated,that I can use in this place ?, or which is the version of selenium is used now ? I use selenium with junit4 and jdeveloper –  user4453 Nov 28 '12 at 21:43
    
The old Selenium RC API is deprecated now. You should really be using the WebDriver API have a look at code.google.com/p/selenium/downloads/list –  Ardesco Dec 1 '12 at 13:43
add comment

It is a warning that could be ignored. The code will execute as expected despite the warnings. Just add @SuppressWarnings above the method to remove these warnings so that the code looks tidy.

Pseudocode:

   @SuppressWarnings({ "deprecation", "unused" })
   public class testWeather extends SeleneseTestCase 
   {
     ....
   }
share|improve this answer
    
Aruna's reply is right. The easy way to do is, just to click on the error fix warning, that eclipse is giving you to the left side of the line of code in the eclipse ide, it will give you a suggestion containing the option to add suppress warning,click on it and that will automatically add the suppress annotation u need to give and fix your issue. Hope this helps –  Rakesh Prabhakaran Jun 30 '11 at 5:45
2  
It may stop the warnings from showing up but it doesn't resolve the root cause of the problem which is that you are using deprecatd code and you should stop using it. When Selenium 2 goes final a lot of deprecated methods are being removed (RC3 already removed a lot of deprecated things) so if you are unlucky this will be part of the cull. The sensible thing to do is to stop using SeleneseTestCase. –  Ardesco Jun 30 '11 at 10:24
    
Yes Ardesco a consistent solution for Jason's issue is to avoid the deprecated code, but until he comes across with a fix for that he can use the annotation. –  Rakesh Prabhakaran Jun 30 '11 at 12:06
2  
What do you mean comes across a fix for it? The fix is don't use deprecated code, instead extend the class correctly as explained in my answer and it will all work. –  Ardesco Jul 12 '11 at 8:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.