selenium - Adding ChromeOptions for Selnium Webdriver C# -
from understand, default action of when webdriver finds element scroll such element far top of page possible. issue because website i'm working on has header every time try click on button, instead click on header. thus, want change scroll setting element @ bottom of page.
from reading this able find wanted set, however, i'm unable set desiredcapabilites or chromeoptions when initialise chromedriver. provide code/steps please?
you can use this
var chromeoptions = new chromeoptions(); chromeoptions.adduserprofilepreference("intl.accept_languages", "en"); chromeoptions.adduserprofilepreference("disable-popup-blocking", "true"); var driver = new chromedriver(chromeoptions);
edit-2 if option want set doesn't work try using actions
var elem = driver.findelements(by.id("your element")); actions action = new actions(driver); action.movetoelement(elem).click(elem).perform();//move list element needs hovered
edit-3
if above doesn't work next option use javascript
var elem = driver.findelements(by.id("your element")); ijavascriptexecutor js = (ijavascriptexecutor)driver; var success = js.executescript("arguments[0].click(); return true", elem);
Comments
Post a Comment