How to handle favicon.ico in headless selenium with xvfb -


i have various scenarios of selenium test script running on selenium web driver firefox browser. when running them in headless mode of scenarios running of them not running time of time fails , throw error

onhandlernotfound/favicon.ico 

and

pagenotfound/favicon.ico[onhandlernotfound/favicon.ico] 

the screenshot attached - first , second. give me solution possible

my test case failed , error element not visible may not interacted with

element not visible may not interacted 

you can try favicon internet-path , try download it(externally, not via selenium).

if favicon not accessible -- there no ability download. if accessible -- shown in of browser (in case of enabled images) =)

maybe not best way, work.

as didnt write language, can give code download image c#:

string webpath = ""; /*favicon internet path*/ if (webpath != string.empty) {     try     {         system.net.webrequest request = system.net.webrequest.create(webpath);         system.net.webresponse response = request.getresponse();         system.io.stream responsestream = response.getresponsestream();         bitmap bitmapimg = new bitmap(responsestream);         return bitmapimg;     }     catch (system.net.webexception)     {     } } 

Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -