Selenium Grid how to get file from it with Java? -


i have selenium grid on remote machine ip. 1 of test cases has download file , in assertion want compare name of downloaded file, in test case have import file application windows. how in java? selenium grid on windows server 2008.

as far i'm aware that's not possible selenium alone. might able browser logs, enable file access shared server , check file downloaded there. first set chrome's download directory:

desiredcapabilities capabilities = desiredcapabilities.chrome(); chromeoptions options = new chromeoptions(); map<string, object> prefs = new hashmap<string, object>(); prefs.put("download.default_directory", "\\remote-ip\path\to\download\directory"); options.setexperimentaloption("prefs", prefs); capabilities.setcapability(chromeoptions.capability, options); webdriver driver = new remotewebdriver(new url("http://gridhubhost:4444/wd/hub"), capabilities); 

then after test makes browser download file check filesystem on remote server:

file downloadedfile = new file("\\remote-ip\path\to\download\directory\file"); assertequals(downloadedfile.getname(), "expected-name"); 

Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -