I have created an automation to open an email via searching email address. But somehow I am unable to click on the search box. I tried using various XPath as well as using Action both failed. Can anyone help me?
I am using Chrome Browser for this.
Using Action
Actions ob = new Actions(Driver);
ob.MoveToElement(Driver.FindElement(By.XPath("//*[contains(@aria-label,'Activate Search Textbox')]")));
ob.Click(Driver.FindElement(By.XPath("//*[contains(@aria-label,'Activate Search Textbox')]")));
Actions action = new Actions(Driver);
action.Perform();
Using Element Click
private static string SearchIcon = "//*[contains(@aria-label,'Activate Search Textbox')]";
ElementClick(Driver.FindElement(By.XPath(SearchIcon)));
Relevant HTML:
<button autoid="_n_4" type="button" class="_n_j ms-bgc-tl-h _n_k ms-bgc-tlr o365button ms-border-color-themeLighter" aria-label="Activate Search Textbox" style="">
<span class="_n_m owaimg ms-Icon--search ms-icon-font-size-20 ms-fcl-ts-b"> </span>
<span class="_n_l ms-fwt-sl ms-fcl-ns ms-fcl-np">Search Mail and People</span>
</button>
Error:
The HTTP request to the remote WebDriver server for URL http://localhost:.../session/c9ac8d163f26dd172417d63f33a65373/element timed out after 60 seconds.