Switch Statement from datapool


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Switch Statement from datapool

  1. #1
    Join Date
    Jul 2006
    Posts
    1

    Switch Statement from datapool

    I am using Rational Funtional Tester to test some menu items. I have a datapool created with the variable PendingActivation created and values of 0 or 1. I log in to the application and if the menu item is present, click on it, if not, go to the next menu item. The if statement works fine, but the switch statement does not. Can anyone help me out..thanks

    IF Statement - working

    if ((dpInt("PendingActivation")) > 0){
    link_pendingActivation().click();
    }
    else {
    link_maintainUsers().click();
    }


    Switch Statement - not working

    switch (MenuTest)
    {
    case 1:
    (dpInt("PendingActivation") > 0); <- Error
    link_pendingActivation().click();
    break;

    case 2:
    (dpInt("MaintainUsers") > 0); <- Error
    link_maintainUsers().click();
    break;

    default:
    link_logOff().click();
    break;
    }

    Errors I am getting I have made note of. The error is Syntax error, insert "AssignmentOperator ArrayInitializer" to complete Expression

  2. #2
    Join Date
    Mar 2004
    Posts
    635
    (dpInt("PendingActivation") > 0);

    Why's it enclosed with extra parenthesis? If that's another IF statement I think its missing a word.

Similar Threads

  1. Faster 'Switch' statement (C#)?
    By me_code2004 in forum .NET
    Replies: 2
    Last Post: 05-10-2006, 07:13 PM
  2. Switch Statement
    By stormswimmer in forum Java
    Replies: 7
    Last Post: 12-27-2005, 09:29 AM
  3. How do you loop a switch statement?
    By 72chevy in forum Java
    Replies: 3
    Last Post: 11-01-2005, 09:48 AM
  4. Use of Select Case or Switch Statement
    By Daryl Shockey in forum Database
    Replies: 2
    Last Post: 05-28-2002, 03:50 PM
  5. switch statement
    By James Lin in forum .NET
    Replies: 9
    Last Post: 08-15-2000, 10:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center