Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upIs it possible to use FindBy with data from external resource (JSON, Resources.resx, etc.) #339
Comments
|
Hey, With Atata you can do it this way: // [SomeOtherCommonAttributes...]
public Button<_> MyButton =>
Controls.Resolve<Button<_>>(nameof(MyButton), () => new[] { new FindByIdAttribute(Resources.SomeIdNameFromFileOrResource) }); |
|
There is also an "exotic" way of marking page object properties with attributes depending on the environment, using preprocessor directives. #if ENV1
[FindById("id-for-env-1")]
#elif ENV2
[FindById("id-for-env-2")]
#else
[FindById("id-regular")]
#endif
public Button<_> MyButton { get; private set; }This approach can also be used, but when there is not a lot of such different locator places, as it can become a mess. |
|
Awesome, I'll give this a try! I have another issue that I thought I resolved, but ended up finding another issue along with it. I have a Custom Select that finds the select's preceding sibling (which should be input) and sets the value there rather than the select field.
Current issue is that there are some locations that are similar to the above, but have additional siblings
I did try Error |
|
If you get |
|
I can confirm that the element is visible. In my custom select I added
I notice that when the site is launched via the web driver, that I cannot manually set the input field. I can type, but when I press tab or enter, it just reverts to the original value. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Hello,
I am testing an application where I would ideally like to contain all my Id's, CSS selectors, etc. and then load them into the page objects FindBy. The reason for this being that I run these tests across multiple builds and databases that may have minor discrepancies in say, an Id field, but in the end is the same application.
current example:
desired example:
I may be trying to go about this the wrong way, but is this possible?