Webアプリケーションでテキストフィールドが空であるかどうかを確認しようとしていますが、どのように処理するのか分かりません。ここの小さな助けが助けになるかもしれません。事前に感謝してC#でのSelenium Webアプリケーションテスト
1
A
答えて
0
テキストフィールドの属性値を取得: -
String expectedvalue="your expected value";
WebElement element=driver.findElement(By.xapth("path of your element")).sendkey("Actual value");
String attributevalue=element.getAttribute("Value");
System.out.println(attributevalue);
if(attributevalue.equals(expectedvalue)){
//Text box is not empty
}
else{
//textbox is empty
}
注:テキストフィールドを表す要素を取得する必要があり-codeが
0
まずC#でJavaの変更で書かれています。 これをIWebElement変数に格納することができます。 ので:
IWebElement element = driver.FindElement(By.xpath("//div[@textField='text']")).Text;
今、あなたは文字列にあなたのIWebElementを変換した後、あなたの期待値(すなわち空)で、この値を比較することができます。
IList<string> comparison = new List<string>();
foreach(var element in driver.FindElements(By.xpath("yourXpath"));
{
comparison.Add(element.Text);
}
Assert.AreEqual(comparison, "")
関連する問題
- 1. C#でのSelenium Webドライバのメッセージ検証
- 2. Webテーブル処理Selenium Webdriver c#
- 3. FirebaseでのRobolectricアプリケーションテスト
- 4. ソフトウェア/ Webアプリケーションテストの最良の方法は何ですか?
- 5. GISアプリケーションテストのガイドライン
- 6. iamデバイスでのXamarin.formsアプリケーションテスト
- 7. Xcode 4:iOSシミュレータでのアプリケーションテスト
- 8. アプリケーションテストVSロジックテスト
- 9. 再生アプリケーションテストのWS.URL
- 10. 反応ルータベースのアプリケーションテスト
- 11. C#selenium web driverどのようにwhileループwhile要素で
- 12. スレッディングでSelenium Web Driverの問題が発生しました。 C#
- 13. HTA - Htmlアプリケーションテストの自動化
- 14. iPhone:アプリケーションテストとコアの場所
- 15. Selenium Web Driver
- 16. オブジェクトインスタンシエーション - Selenium Webドライバ
- 17. Selenium Webドライバー:NoSuchElementError
- 18. Selenium Web Driver
- 19. C#Selenium Implicit Wait
- 20. 3.0.0のSelenium C#コンパイルエラー
- 21. Selenium(C#)のFindObjectBy PageObjectPattern jQuery UI Webサイトの問題
- 22. Selenium Webドライバボタンwith Java
- 23. Selenium Robot Framework Web Locator
- 24. Selenium C#
- 25. SeleniumでのWebブラウザの自動クローズ
- 26. ターミナルでシミュレータを使用したOCUnitアプリケーションテスト
- 27. CassandraサービスのSelenium Webドライバ
- 28. WebアプリケーションのPython Selenium click()メソッド
- 29. C#ミュートオーディオSelenium Chrome Browser
- 30. Selenium Webdriver Cassing Issue C#