ファイルの HTML バージョンを実行すると、低速モードで動作します (高速モードでは失敗します)。
Java の setspeed メソッドを使用してみましたが、うまくいきませんでした (おそらく、後のバージョンで減価償却されたためです)。次に、手動のスレッド ウェイト時間を追加しようとしましたが (失敗するスポットの前に)、それも失敗しています。
とにかく、ここに私のJavaコードがあります:
import com.thoughtworks.selenium.Selenium;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverBackedSelenium;
import org.openqa.selenium.WebElement;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.thoughtworks.selenium.SeleneseTestBase;
public class tradePagesNotLoad extends SeleneseTestBase{
private Selenium selenium;
@Before
public void setUp() throws Exception {
WebDriver driver = new FirefoxDriver();
String baseUrl = "http://www.fsdafdscsa.com/";
selenium = new WebDriverBackedSelenium(driver, baseUrl);
}
@Test
public void testA9() throws Exception {
selenium.open("");
selenium.click("link=Sign In");
selenium.waitForPageToLoad("30000");
selenium.type("id=login_username", "fsadfsa");
selenium.type("id=login_password", "asweqr");
selenium.click("name=login_button");
selenium.waitForPageToLoad("30000");
verifyTrue(selenium.isElementPresent("link=Sign Out"));
selenium.click("link=Trade");
selenium.waitForPageToLoad("30000");
String sellButtonText = selenium.getText("xpath=(//button[@type='button'])[7]");
System.out.println(sellButtonText);
assertNotEquals("Loading...", selenium.getEval("storedVars['sellButtonText']"));
String buyButtonText = selenium.getText("xpath=(//button[@type='button'])[8]");
System.out.println(buyButtonText);
assertNotEquals("Loading...", selenium.getEval("storedVars['buyButtonText']"));
String bidPrice = selenium.getText("id=pretty_bid_price");
System.out.println(bidPrice);
assertNotEquals("Loading...", selenium.getEval("storedVars['bidPrice']"));
String askPrice = selenium.getText("id=pretty_ask_price");
System.out.println(askPrice);
assertNotEquals("Loading...", selenium.getEval("storedVars['askPrice']"));
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}
コードは最初の assertNotEquals で失敗しています。任意の提案をいただければ幸いです。