How to use multiple repo itemInfo for the same method?
Posted: Thu Feb 27, 2020 9:10 pm
Dear All!
I have a method, where I specify a repoitemInfo and a string, so when a popup shows up it reads the repoitemInfo if it exists and then it validates its text attribute.
However, I have forms with different control names but with the same textfield, so my repo looks like the following:
repo.popups.message.textFieldInfo
repo.popups.question.textFieldInfo
I would like to validate the string on their text attributes, however I am unsure, which of the popups will show up in a given test case.
What I load into the repoitemInfo is the repo.popups.message or .question. So the main popup window.
Is there a way to use a variable on this repo path, so that it would dynamically switch between the two itemInfos?
This code only checks the textfield on the message popup but if the question popup shows up, it would simply fail.
So, is there a way to use a dynamic parameter for the Validate.AttributeEquals(variable, “Text”, strVal)?
Something like:
repo.popups.variable.textFieldInfo
I tried to get the full path of the popupMsg repoitemInfo, like this: popupMsg.FullName to get this: repo.popups.message, and then add the info part at the end, but it won’t convert string to textinfo, obviously.
Thank you very much for any advice or help!
Best Regards,
Oliver
I have a method, where I specify a repoitemInfo and a string, so when a popup shows up it reads the repoitemInfo if it exists and then it validates its text attribute.
However, I have forms with different control names but with the same textfield, so my repo looks like the following:
repo.popups.message.textFieldInfo
repo.popups.question.textFieldInfo
I would like to validate the string on their text attributes, however I am unsure, which of the popups will show up in a given test case.
What I load into the repoitemInfo is the repo.popups.message or .question. So the main popup window.
Is there a way to use a variable on this repo path, so that it would dynamically switch between the two itemInfos?
Code: Select all
public static void PopupCheck(repoItemInfo popupMsg, string strVal)
{
Validate.AttributeEquals(repo.popups.message.textFieldInfo, “Text”, strVal);
}
So, is there a way to use a dynamic parameter for the Validate.AttributeEquals(variable, “Text”, strVal)?
Something like:
repo.popups.variable.textFieldInfo
I tried to get the full path of the popupMsg repoitemInfo, like this: popupMsg.FullName to get this: repo.popups.message, and then add the info part at the end, but it won’t convert string to textinfo, obviously.
Thank you very much for any advice or help!
Best Regards,
Oliver