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. FirebaseでのRobolectricアプリケーションテスト
- 3. ソフトウェア/ Webアプリケーションテストの最良の方法は何ですか?
- 4. GISアプリケーションテストのガイドライン
- 5. Xcode 4:iOSシミュレータでのアプリケーションテスト
- 6. アプリケーションテストVSロジックテスト
- 7. 反応ルータベースのアプリケーションテスト
- 8. 再生アプリケーションテストのWS.URL
- 9. オブジェクトインスタンシエーション - Selenium Webドライバ
- 10. HTA - Htmlアプリケーションテストの自動化
- 11. iPhone:アプリケーションテストとコアの場所
- 12. C#Selenium Implicit Wait
- 13. Selenium Webドライバボタンwith Java
- 14. 3.0.0のSelenium C#コンパイルエラー
- 15. Selenium(C#)のFindObjectBy PageObjectPattern jQuery UI Webサイトの問題
- 16. SeleniumでのWebブラウザの自動クローズ
- 17. CassandraサービスのSelenium Webドライバ
- 18. ターミナルでシミュレータを使用したOCUnitアプリケーションテスト
- 19. Selenium Webdriver Cassing Issue C#
- 20. Selenium LocatorでのSelenium IWebElementの変換方法C#では?
- 21. AppiumとMonkeyTalk間のAndroidアプリケーションテストの比較
- 22. アプリケーションテスト(phantomjs)の自動化とブランチのマージ
- 23. DesiredCapabilitiesのSelenium C#chromedriver
- 24. C#Seleniumの横スクロール
- 25. RadMenu Web要素Selenium Webdriverを展開するJavaScript C#
- 26. Selenium Webdriver C#
- 27. c#geckodriver selenium ff
- 28. Selenium Webdriver C#
- 29. Selenium vs. BeautifulSoup Webスクレイピング
- 30. Selenium WebドライバーとセレンRC