Hi Team,
I want to validate if the textbox value is greater than 1 then only perform some action.
Can you please help how to write the code?
I am trying below which is not working
if((masterWinRepo.DebiteringsManuelScreen.AntalOkEdit.Element.GetAttributeValueText("text"))>=1)
How to get container textvalue
How to get container textvalue
- Attachments
-
- Antal.zip
- (297.15 KiB) Downloaded 16 times
Re: How to get container textvalue
Hi,
What exactly is not working? Could you please post exact error message you are getting or somewhat more detailed description of the problem you are experiencing?
As for the condition you are using now, you can't compare string with number! And I guess this also the source of your issue? You must convert the string to integer if you want to perform such comparison.
This code should do what you want:
Additionally, I would suggest to avoid referencing repo elements directly in code and rather use them as method parameters, like this:
What exactly is not working? Could you please post exact error message you are getting or somewhat more detailed description of the problem you are experiencing?
As for the condition you are using now, you can't compare string with number! And I guess this also the source of your issue? You must convert the string to integer if you want to perform such comparison.
This code should do what you want:
Code: Select all
if(Convert.ToInt32(masterWinRepo.DebiteringsManuelScreen.AntalOkEdit.Element.GetAttributeValueText("text"))>=1)
Code: Select all
public void validateDifferenceInReports(RepoItemInfo repoInfoElement)
{
if(Convert.ToInt32(repoInfoElement.CreateAdapter<Ranorex.Unknown>(false).Element.GetAttributeValueText("text"))>=1)
{
}
}
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: How to get container textvalue
Thanks !! It worked
Convert.ToInt32(repoInfoElement.CreateAdapter<Ranorex.Unknown>(false).Element.GetAttributeValueText("text"))>=1)
Convert.ToInt32(repoInfoElement.CreateAdapter<Ranorex.Unknown>(false).Element.GetAttributeValueText("text"))>=1)