File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -202,19 +202,16 @@ public void ShouldBeAbleToUploadTheSameFileTwice()
202202 inputFileWriter . WriteLine ( "Hello world" ) ;
203203 inputFileWriter . Close ( ) ;
204204
205- driver . Url = formsPage ;
206- IWebElement uploadElement = driver . FindElement ( By . Id ( "upload" ) ) ;
207- Assert . IsTrue ( string . IsNullOrEmpty ( uploadElement . GetAttribute ( "value" ) ) ) ;
208-
209- uploadElement . SendKeys ( inputFile . FullName ) ;
210- uploadElement . Submit ( ) ;
205+ for ( int i = 0 ; i < 2 ; ++ i )
206+ {
207+ driver . Url = formsPage ;
208+ IWebElement uploadElement = driver . FindElement ( By . Id ( "upload" ) ) ;
209+ Assert . IsTrue ( string . IsNullOrEmpty ( uploadElement . GetAttribute ( "value" ) ) ) ;
211210
212- driver . Url = formsPage ;
213- uploadElement = driver . FindElement ( By . Id ( "upload" ) ) ;
214- Assert . IsTrue ( string . IsNullOrEmpty ( uploadElement . GetAttribute ( "value" ) ) ) ;
211+ uploadElement . SendKeys ( inputFile . FullName ) ;
212+ uploadElement . Submit ( ) ;
213+ }
215214
216- uploadElement . SendKeys ( inputFile . FullName ) ;
217- uploadElement . Submit ( ) ;
218215 // If we get this far, then we're all good.
219216 }
220217
You can’t perform that action at this time.
0 commit comments