9 Important Tips for Selenium Remote Control (Java client) - Test Tool 9重要なヒントをセレンのリモート制御( Javaクライアント) -テストツール
Selenium Remote Control (RC) is a test tool that allows you to write automated web application UI tests in many programming languages against any HTTP website using any mainstream JavaScript-enabled browser.セレンリモートコントロール( RC )には、テストツールを書くことができるテストの自動化されたウェブアプリケーションのUIの多くのプログラミング言語を使用して任意の主流のウェブサイトに対する任意のHTTPのブラウザでJavaScriptを有効にします。 Selenium RC is a powerful and simple framework for running (scheduled or manually) automated UI centric regression tests for web applications / services.セレンrcは、強力かつシンプルなフレームワークを実行する(スケジュールまたは手動)回帰テストの自動WebアプリケーションのためのUIの中心/サービスです。 Here are few simple tips for Selenium RC java client.ここではいくつかの簡単なヒントをセレンrc Javaクライアントです。 I used JUnit for tests.私のJUnitを使用されるテストを実行します。 You can use NGUnit too. ngunitあまりにも使用することができます。
1. 1 。 To run the Java client you need to only have selenium-java-client-driver.jar (located in selenium-remote-control-1.0-beta-1/selenium-java-client-driver-1.0-beta-1 ) in your classpath. Javaクライアントを実行するにする必要がセレンしかない-ジャワ-クライアント- driver.jar ( selenium-remote-control-1.0-beta-1/selenium-java-client-driver-1.0-beta-1に位置)にしてclasspathのです。
2. 2 。 The automatically generated java file (from Selenium Core) is likely to be defective.自動的に生成するjavaファイル(セレンコア)が予想される不良です。 Ensure at least you have the following import statements:少なくとも確実にインポートするには、以下のステートメント:
import com.thoughtworks.selenium.*; インポートcom.thoughtworks.selenium .* ;
import junit.framework.*; インポートjunit.framework .* ;
import java.util.regex.Pattern; インポートjava.util.regex.pattern ;
3. 3 。 Ensure that the saved file name matches the generated class file name.保存したファイル名を確認して生成されたクラスにマッチするファイル名を入力します。
4. 4 。 Remove the package statement or replace it with your own package statement.削除してパッケージのステートメントまたはステートメントを置き換えることが、独自のパッケージです。 Initially just remove it.最初だけ削除してください。
5. 5 。 Error: java.lang.UnsupportedOperationException: Catch body broken: IOException from cmd=setContext&1=SeleniumSTSanityTest.testSimpleThoughts -> java.net.ConnectException: Connection refusedエラー: java.lang.unsupportedoperationexception :キャッチボディブロークン: ioexceptionよりcmd = setcontext & 1 = seleniumstsanitytest.testsimplethoughts -> j ava.net.connectexception:接続は拒否されました
Have you run the Selenium server?セレンサーバーを実行してもですか?
Run the Selenium server like this:サーバーを実行してこのようセレン:
java -jar selenium-server.jar ジャワ-瓶セレン- server.jar
The selenium server is located in:サーバーが位置し、セレン:
selenium-remote-control-1.0-beta-1/selenium-server-1.0-beta-1
6. 6 。 Error: com.thoughtworks.selenium.SeleniumException: ERROR Server Exception: sessionId should not be null; has this session been started yet?エラー: com.thoughtworks.selenium.seleniumexception :エラーサーバー例外: SessionIDのことはできませんヌル;は、このセッションが開始していないですか?
Ensure that the browser is in the PATH before running the server.確認して、ブラウザがサーバを実行する前に、パスです。 On my linux box I did:私のLinuxのボックスをオン私は:
export PATH=$PATH:/usr/lib/firefox-2.0.0.6/ 輸出パス= $パス: / usr/lib/firefox-2.0.0.6 /
7. 7 。 Error: com.thoughtworks.selenium.SeleniumException: Permission denied to get property Location.hrefエラー: com.thoughtworks.selenium.seleniumexception :アクセスが拒否されましたlocation.hrefプロパティを取得
This happens on Firefox when a previous page wasn’t fully loaded before the next page was invoked (due to timeout or click() was used). Firefoxのときにこの問題が発生し、前のページにはない完全に読み込まれる前に、次のページには、呼び出される(またはクリックしてタイムアウトのために( )が使用される) 。 The solution is to use *chrome instead of *firefox in setup.その解決策はクロムを使用する* * Firefoxのではなく、セットアップを実行します。 I use for firefox:私は、 Firefoxを使用:
setUp(”http://blog.taragana.com/”, “*chrome”); セットアップ( " http://blog.taragana.com/ " 、 " *クロム" ) ;
8. 8 。 Timeout errorタイムアウトエラー
Increase the time in selenium.waitForPageToLoad() to 60000 (1 minute) or more.時間を増加させるselenium.waitforpagetoload ( )を60000 ( 1分) 、または他のです。
9. 9 。 How to run the generated java Test file?ジャワに生成する方法を実行してテストファイルですか?
This is really a JUnit question but in short you can add the following code in the generated file to get it running:これは、実際にはしかし、ショートすることができます。 JUnitの質問に次のコードを追加して、生成されるファイルを得ることを実行して:
public static Test suite() { return new TestSuite( SeleniumSTSanityTest .class); } public static void main(String args[]) { junit.textui.TestRunner.run(suite()); }公共の静的なテストスイート( ) (戻り新しいテストスイート( seleniumstsanitytestです。クラス) ; )公共の静的な無効メイン(文字列args [ ] ) ( junit.textui.testrunner.run (スイート( ) ) ; ) Note: Replace SeleniumSTSanityTest with the name of your Java source file (without the .java extension)注:お客様の名前に置き換えますseleniumstsanitytest Javaのソースファイル( 。ジャワの拡張子)
Filed under提出されて Browserブラウザ , 、 Firefox Firefoxの , 、 Headline Newsニュースの見出し , 、 Internet Explorerインターネットエクスプローラ , 、 Java Software Javaソフトウェア , 、 Javascript JavaScriptの , 、 Programmingプログラミング , 、 Webウェブ , 、 Web 2.0ウェブ2.0 , 、 Web Services Webサービス | |
| |
RSS 2.0 RSS 2.0を | |
Trackbackトラックバック this Article |この記事|
Email this Article電子メールこの記事
You may also like to readを読むようにすることも可能 |




May 23rd, 2008 at 11:28 am 2008年5月23日11:28 AMの私
You have made my life a joy.あなたが私の人生の喜びです。
June 22nd, 2008 at 9:38 pm 2008年6月22日は午後9時38分
it is cool.これはクールです。