I am trying to click on a search button that is hidden. I tried few methods but it didn't work:
<form id="form1" name="viewClient" method="post" action="ClientMgmtServlet" abframeid="iframe.0.10752026348407184" abineguid="027BBB6AD3324EFDA3FED3803F068951">
<input type="hidden" value="U7dPiPXFQhCDtDaTHAVH" name="preventionflag"/>
<input id="searchClientBtn" type="hidden" value="Search" name="searchClientBtn"/>
I used this method:
//Enter client ID
String userid = prop.getProperty(CLIENTID);
driver.findElement(By.id("clientId")).sendKeys(userid);
//Enter client name
String clientName = prop.getProperty(CLIENTNAME);
driver.findElement(By.id("clientName")).sendKeys(clientName);
//enter Mobile No
String mobile_no = prop.getProperty(MOBILE_NO);
driver.findElement(By.id("mobileNo")).sendKeys(mobile_no);
WebElement elem = driver.findElement(By.xpath(".//*[@id='searchClientBtn']"));
String js = "arguments[0].style.height='auto'; arguments[0].style.visibility='visible';";
((JavascriptExecutor) driver).executeScript(js, elem);
It was clicking on the search button but the data I have entered in the fields were not accepting. It worked like I haven't input the data only. That showed me all the users in the search.
Can someone help me with this problem?