c# - Selenium Web Driver Click -
i having issues these last lines working. last search button part breaks. says"unknown error:cannot focus element".the last lines clicking search button.
here html code im getting from. search button code.
<img class="banner-search-type-search-imagestyle" src="images/bannerimages/go-img.png" id="btnsearch">
here code.
var mfgpartnumber = "crcw12061r00fkea"; iwebdriver driver=new chromedriver(@"c:\users\josimpso\appdata\roaming"); driver.navigate().gotourl("https://app.siliconexpert.com/cmomfx/customerlogin.html"); //set username iwebelement setusername = driver.findelement(by.classname("logininput")); setusername.sendkeys("username"); //set password iwebelement setpassword = driver.findelement(by.name("password")); setpassword.sendkeys("password"); // click login button iwebelement loginbutton = driver.findelement(by.id("loginsubmit")); loginbutton.sendkeys(openqa.selenium.keys.enter); // search based on mfgpartnumber iwebelement searchbox = driver.findelement(by.id("txtsearch")); searchbox.sendkeys(mfgpartnumber); // press enter on search iwebelement searchbutton = driver.findelement(by.id("btnsearch")); searchbutton.sendkeys(openqa.selenium.keys.enter);
unfortunately i'm unable test right now, image should inside <a>
tag. perform click in <a>
tag, not in image
Comments
Post a Comment