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

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

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -