User Code IF Condition
Posted: Tue Dec 10, 2019 3:06 pm
Hi everyone! May I ask for your help?
Given three text fields in a scrollable list with multiple rows, that are added as repository items: "ID", "METHOD" and "SUB".
I need to click on and select that ID (row), where the METHOD and the SUB equals a value that is provided in JIRA.
ID / METHOD / SUB
123 / N / H
123 / F / S
.
.
.
So, I need to select that row where the ID is '123' and the METHOD is 'F' and SUB is 'S'.
(There can be multiple METHOD and SUB types under a single ID.)
I am unable to provide a snapshot since it is forbidden for me.
I have tried to create a user code, however I am unsure, how to create multiple conditions:
It won't build since the parameters are not bool type.
Could you please help me?
Thank you very much!
Given three text fields in a scrollable list with multiple rows, that are added as repository items: "ID", "METHOD" and "SUB".
I need to click on and select that ID (row), where the METHOD and the SUB equals a value that is provided in JIRA.
ID / METHOD / SUB
123 / N / H
123 / F / S
.
.
.
So, I need to select that row where the ID is '123' and the METHOD is 'F' and SUB is 'S'.
(There can be multiple METHOD and SUB types under a single ID.)
I am unable to provide a snapshot since it is forbidden for me.
I have tried to create a user code, however I am unsure, how to create multiple conditions:
Code: Select all
[UserCodeMethod]
public static void ScrollToElement(RepoItemInfo repoItemToFind, Adapter scrollTab, string screenText)
{
Mouse.MoveTo(scrollTab);
Mouse.Click(scrollTab);
Text foundElement=null;
while (!repoItemToFind.Exists(200, out foundElement) && !screenText.AttributeEqual(100, out foundElement))
{
Mouse.ScrollWheel(-50);
}
// foundElement.EnsureVisible();
foundElement.MoveTo();
foundElement.Click();
}
Could you please help me?
Thank you very much!