In my .Net project I am manually building my automation framework using Ranorex library:
* Ranorex dll's in my project references
* Specflow
* Page Object Pattern design
etc
When I have done this previously using Selenium Webdriver I used the PageFactory implementation to simpify my Step Definition code to: class name.element name.selenium action();
(example: _allShared.Ok.Click();)
... as opposed to driver.FindElement(By.XPath(AllShared.Ok)).click();
Is there a feature similar in Ranorex for me to implement this: class name.element name.selenium action();
... as oppsed to Ranorex.Mouse.Click("xpath") everytime.
Here is the sample code using Selenium that I would like to achieve using Ranorex:::
In my page objects class:
Code: Select all
using OpenQA.Selenium.Support.PageObjects;
public class AllShared
{
[FindsBy(How = How.XPath, Using = "//input[@type='ok']")]
public IWebElement Ok;
}
In my Step Definitions class:
Code: Select all
[Given(@"I select ok")]
public void GivenISelectOk()
{
PageFactory.InitElements(driver, _allShared);
_allShared.Ok.Click();
}
