google chrome - Stop browser load from selenium webdriver -


my selenium webdriver goes page , waits page finish loading. if 30 seconds pass times-out , script fails.

is there anyway have webdriver stop page loading after 30 seconds(like pressing 'x' on browser)? prevent driver timing out.

i'm using chromedriver.

this way came across issue. using way until chrome supports pageload.

i installed extension in chrome called stop load , set 5 secs stop load.

then initiated driver default setting -

desiredcapabilities capabilities = desiredcapabilities.chrome(); capabilities.setcapability("chrome.switches", arrays.aslist("--user-data-dir="+system.getproperty("user.home")+"\\appdata\\local\\google\\chrome\\user data")); system.setproperty("webdriver.chrome.driver", "c:\\program files (x86)\\google\\chrome\\application\\chromedriver.exe"); driver = new chromedriver(capabilities);  

if page in chrome not load in 5 secs, extension take care of killing in 5 seconds.

in way works implicitwait if set proper stop load time in extension


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -