The verifyTrue (boolean) method is undefined for the type

advertisements

Chaps,

Newbie here so please be gentle!

I have a class where I am first trying to determine 'If' text 'Fictitious Test company' exsists anywehre on the page then I want to click and delete that company 'Else' I want to add a new test company..

problem I have is with follwing line:

            if(verifyTrue(selenium.isTextPresent("Fictitious Test Company"))){;

Compiler keeps complains that the 'The method verifyTrue(boolean) is undefined for the type Delete_old_Or_Add_New_Company' */

Can you please advise where am I going wrong? Please specific as to what i need to do to correct the problem.

Here is the whole code from my class: - I am using xml to run my testsuite in Eclipse

package Realtime;
import com.thoughtworks.selenium.*;
import org.testng.annotations.*;
import static org.testng.Assert.*;

public class Delete_old_Or_Add_New_Company {

        private Selenium selenium;
        public static SeleneseTestBase SV = new
                        SeleneseTestBase();

        @BeforeClass

        @Parameters ({"url","browser","speed"})
        public void startSelenium(String Site_URL, String Browser, String
Speed) {
        selenium = new DefaultSelenium("localhost", 4444, Browser, Site_URL);
        selenium.start();
        selenium.setSpeed(Speed);
        }
        @AfterClass(alwaysRun=true)
                public void stopSelenium() {
                this.selenium.stop();
                }

        @Test
        public void DeletOldOrAddNewCompany() throws Exception {
                Login_Logout NewObject=new Login_Logout();

selenium.getEval("selenium.browserbot.setShouldHighlightElement(true)");

                NewObject.Login(selenium);
                selenium.waitForPageToLoad("5000");

                selenium.click("//table[@id='maincontent']/tbody/tr/td[3]/table[2]/
 tbody/tr[3]/td[5]/strong");
                selenium.waitForPageToLoad("5000");
                selenium.click("link=Companies");
                selenium.waitForPageToLoad("5000");
                selenium.click("//input[@value='Search for Companies']");
                selenium.waitForPageToLoad("5000");
                selenium.type("//input[@name=\"companyname\"]", "Fictitious Test
Company");
                selenium.click("//input[@name=\"submitbutton\"]");

                if(verifyTrue(selenium.isTextPresent("Fictitious Test Company"))){; /
* It is at this line the compiler complains that the  'The method
verifyTrue(boolean) is undefined for the type
Delete_old_Or_Add_New_Company' */
                selenium.waitForPageToLoad("5000");
                selenium.click("css=td.tablelastrownew");
                selenium.waitForPageToLoad("5000");
                selenium.click("//input[@value='Delete Company']");
                assertTrue(selenium.getConfirmation().matches("^Note: This action
will delete all the companies accounts, branches, users and their
accounts\n\nAre you sure you wish to delete this company[\\s\\S]$"));

                }

                else {

                        selenium.click("//input[@value='Companies Admin Home']");
                        selenium.waitForPageToLoad("5000");
                        selenium.click("//input[@value='New Company']");
                        selenium.waitForPageToLoad("5000");
                        selenium.type("name=companyname", "Fictitious Test Company");
                        selenium.type("name=postcode", "SW17 8DY");
                        selenium.type("name=expirepasswordsindays", "1000");
                        selenium.click("css=input[name=\"submitbutton\"]");
                        selenium.waitForPageToLoad("5000");
                        SV.verifyTrue(selenium.isTextPresent("Fictitious Test Company"));

                }

                NewObject.Logout(selenium);

        }


You already created SeleneseTestBase instance "SV".

You should call "SV.verifyTrue". or, extend SeleneseTestBase.

*You already used this way.(else statements last line.)

SV.verifyTrue(selenium.isTextPresent("Fictitious Test Company"));

*at Selenium 2.0, SeleneseTestCase is deprecated class. http://selenium.googlecode.com/svn/trunk/docs/api/java/com/thoughtworks/selenium/package-summary.html