Парни,
Новичок здесь, поэтому, пожалуйста, будьте нежны!
У меня есть класс, в котором я впервые пытаюсь определить, «если» текст «Фиктивная Тестовая компания» существует в любом месте на странице, тоЯ хочу щелкнуть и удалить эту компанию «Остальное». Я хочу добавить новую тестовую компанию.
У меня проблема с следующей строкой:
if(verifyTrue(selenium.isTextPresent("Fictitious Test Company"))){;
Компилятор продолжает жаловаться, что 'Метод verifyTrue (логический) не определен для типа Delete_old_Or_Add_New_Company '* /
Не могли бы вы сообщить, где я ошибаюсь?Пожалуйста, укажите, что мне нужно сделать, чтобы исправить проблему.
Вот весь код из моего класса: - Я использую xml для запуска своего testsuite в 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);
}