I have written an automation framework in VS2017 using Selenium Webdriver in C# and PageObjects. That is working absolutely fine in windows. Same PageObjects code is used in VS2017 for MAC OS and it is not working there giving
OpenQA.Selenium.NoSuchElementException : Couldn't locate an element by these strategies: By.Id: userNameInput;
----> OpenQA.Selenium.WebDriverTimeoutException : Timed out after 1 seconds
I have moved my code from VS2017 For Windows to VS2017 for Mac. That is successfully converted and compiled. There were problems however i have resolved the webdriver related issues and now code is working perfectly to Launch Chrome & Safari. But whenever i try to find elements, the exception occurs. I have implemented Explicitwaits and other parameters but both Safari and Chrome are giving me errors at some stage in finding the elements. I have also tried finding the elements without POM but that doesn't work too.
Considering the following function i have written to Signout user from Dynamics CRM
public void UserSignOut(ref ExtentTest test)
{
WDEx.SwitchWindows(0);
Browser.Driver.SwitchTo().DefaultContent();
UserIcon.Click();
SignOut.Click();
}
where UserIcon is
[FindsBy(How = How.Id, Using = @"navTabButtonChangeProfileImageLink")]
public IWebElement UserIcon { get; set; }
and SignOut is
[FindsBy(How = How.Id, Using = "navTabButtonUserInfoSignOutId")]
private IWebElement SignOut { get; set; }
It should work exactly the way as it is working on Windows Chromedriver with VS2017. If anybody could provide a solution then that could be very time saving for me. Thankful in Advance. Cheers!