java - Selenium TakesScreenshot capturing "Please wait..." Message -
i'm using code below capture screenshot of every page of website. works pages load 1 2 second/s late, , photobombed spinning gif circle "please wait..." message.
file scrfile = ((takesscreenshot)driver).getscreenshotas(outputtype.file); fileutils.copyfile(scrfile, new file("c:\\tmp\\screenshot.png")); using firebug, looks may culprit:
<div class="blockui blockmsg blockpage" style="z-index: 1011; position: fixed; padding: 15px; margin: 0px; width: 20%; top: 40%; left: 40%; text-align: center; color: rgb(255, 255, 255); border: medium none; background-color: rgb(0, 0, 0); cursor: wait; opacity: 0;"> <img src="/images/front/loading.gif"/> <br/> <strong>please wait...</strong> </div>` my question is: how time screenshot avoid this? thread.sleep(2000) works, i'd rather stay away that. i've checked presence of elements on page, , there, message gets in way.
appreciate advice. thanks.
**edited add code (from firebug) got cut-off.
did try waiting until 'please wait...' element invisible?
wait.until(expectedconditions.invisibilityofelementlocated(by.xpath("//strong[text()='please wait...']"));
Comments
Post a Comment