liguofeng29’s blog

個人勉強用ブログだっす。

2017-03-01から1日間の記事一覧

groovy,geb(selenium),spockによる自動化テスト その6

gebでjavascriptを利用する javascript変数を取得 メソッド呼び出し js追加 script6.html <html> <title>for javascript</title> <script type="text/javascript"> var var1 = 100; function add(a, b) { return a + b; } </script> <body> </body> </html> script6_js.groovy /** * Geb for javascript * * http://www.gebish.org/manual/ * * …

groovy,geb(selenium),spockによる自動化テスト その5

gebでframeを操作する方法 直接操作する Page Objectを利用する script5.html <html> <body> <iframe name="header" src="script5_header_frame.html"></iframe> <iframe id="content" src="script5_content_frame.html"></iframe> <iframe id="footer" src="script5_footer_frame.html"></iframe> </body> </html> script5_header_frame.html …

groovy,geb(selenium),spockによる自動化テスト その4

Geb API form, input, checkbox, radioなどのHTMLElementの操作する script4.html <form id="form1"> <div class="input1"> <input name="username1" type="text" placeholder="input your name"> <input name="password1" type="text" placeholder="input your password"> </div> <div class="input2"> </div></form>

groovy,geb(selenium),spockによる自動化テスト その3

Geb Navigator API gebを使えば、jqueryのselectorに似ている書き方で要素page要素を取得することができる。 script3.html <div>div1 text</div> <div>div2 text</div> <div class="search1"> <form onsubmit="return bridge();"> <input type="text" placeholder="input keyword" class="input" id="keyword" name="keyword"> <br> </form></div>