unable to take screenshot of mouseover in selenium -


i trying take screenshot of sub menu happens on hovering in selenium using takesscreenshot. not working. screenshot taken sub menu not present in image. have tried using implicit wait after hover, nothing worked. please suggest method capture screenshot of sub menu.

contactus.hoverhm(); screenshot = ((takesscreenshot) pagefactorybase.getsharedwebdriver()).getscreenshotas(outputtype.bytes); scenario.embed(screenshot, "image/png"); 

this did trick me. pretty sure work you.

            _driver = new firefoxdriver();             _driver.navigate().gotourl("http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_event_mouseover_mouseout");             _driver.switchto().frame(_driver.findelement(by.id("iframeresult")));             actions builder = new actions(_driver);             builder.movetoelement(_driver.findelement(by.tagname("p"))).build().perform();             var screenshot = ((itakesscreenshot)_driver).getscreenshot();             var filename = new stringbuilder("d:\\");             filename.append(datetime.now.tostring("hh_mm_ss dd-mm-yyyy" + " "));             filename.append("test");             filename.append(".png");             screenshot.saveasfile(filename.tostring(), system.drawing.imaging.imageformat.png); 

after hovering mouse on text, turns yellow , below screen shot took. screen shot took


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -