I have a couple things. On a mobile app I am trying to do a couple things here: There are two fields: Create password & Confirm password. they both need to be a minimum of 6 chars, and both need to match. I need to automation it so here is what I did
1. For the minimum 6 chars portion I tried this
if create_Password.SelectionLength < '6'
{
min_6_chars.Checked = "False";
}
else
{
min_6_chars.Checked = "True"
}
2. For the matching I tried this
if create_Password.TextValue.Equals confirm_Password.TextValue
{
passwords_must_match.Checked = "True";
}
else
{
passwords_must_match.Checked = "True";
}
Can anyoen tell me where I am wrong...or what I need to do instead. Would really appreciate it!
code for create/confirm password issue
Re: code for create/confirm password issue
Please provide more information:
What version of Ranorex are you using?
What mobile system (Android/iOS) is the app being tested on, and what version?
Please post a Ranorex Snapshot of the app in question, if possible, so we can see the structure and possibly help. You can find information on creating a Ranorex Snapshot here.
If you can't post it on the forums, you can also send the snapshot directly to the Ranorex Support Team at [email protected].
In addition, could you explain what you are attempting to accomplish and provide the Ranorex test code? Again, if you can't post it here, you can send it to support at the above email address.
What version of Ranorex are you using?
What mobile system (Android/iOS) is the app being tested on, and what version?
Please post a Ranorex Snapshot of the app in question, if possible, so we can see the structure and possibly help. You can find information on creating a Ranorex Snapshot here.
If you can't post it on the forums, you can also send the snapshot directly to the Ranorex Support Team at [email protected].
In addition, could you explain what you are attempting to accomplish and provide the Ranorex test code? Again, if you can't post it here, you can send it to support at the above email address.
Shortcuts usually aren't...
Re: code for create/confirm password issue
Ranorex version: 5.2.2.21596 (Trail version)
Android version: 4.4.4
Plz find attached the ranorex snapshot
Android version: 4.4.4
Plz find attached the ranorex snapshot
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: code for create/confirm password issue
Hi Styris,
As krstcs already asked, could you please also explain what you are attempting to accomplish, please describe the use case?
This will help us helping you
.
It would also help us if you could add the RxPaths of the used elements to this thread, this helps us to understand which elements you use in your code.
Thanks,
Markus
As krstcs already asked, could you please also explain what you are attempting to accomplish, please describe the use case?
This will help us helping you

It would also help us if you could add the RxPaths of the used elements to this thread, this helps us to understand which elements you use in your code.
Thanks,
Markus
Re: code for create/confirm password issue
Hi Markus,
I thought my initial post was pretty detailed in what I was trying to accomplish. However I can mention it again. I am trying to accomplish a couple things on the Create Password page
1. The create_Password should be at least 6 characters, and in that case the min_6_chars checkbox will automatically be checked.
2. The text value that the User enters in confirm_Password field should match the create_Password, and in that case the passwords_must_match checkbox will get checked.
I thought my initial post was pretty detailed in what I was trying to accomplish. However I can mention it again. I am trying to accomplish a couple things on the Create Password page
1. The create_Password should be at least 6 characters, and in that case the min_6_chars checkbox will automatically be checked.
2. The text value that the User enters in confirm_Password field should match the create_Password, and in that case the passwords_must_match checkbox will get checked.
Re: code for create/confirm password issue
From what I am reading, you are detailing the requirements and the actions of the SUT, not what you, specifically, are trying to accomplish with your test case.
For example, are you wanting to validate that a value is set correctly, or that a checkbox is checked/unchecked, etc.?
For example, are you wanting to validate that a value is set correctly, or that a checkbox is checked/unchecked, etc.?
Shortcuts usually aren't...
Re: code for create/confirm password issue
Yes. I want to be able to automate (with code I guess) of what I detailed out. If the User enters a password that is < 6 in length then the first checkbox will not be checked - it will only be checked if password is at least 6 chars in length.
Also then I want to test that if the create and confirm passwords field that the user enters are the same..then the second checkbox gets checked; if those two fields do not have the exact same textvalues in it..then that checkbox won't be checked.
Also then I want to test that if the create and confirm passwords field that the user enters are the same..then the second checkbox gets checked; if those two fields do not have the exact same textvalues in it..then that checkbox won't be checked.
Re: code for create/confirm password issue
I think I got this for the most part
if (create_Password.SelectionLength.Equals(6))
{
min_6_chars.Checked.Equals("True");
}
else
{
min_6_chars.Checked.Equals("False");
}
if (create_Password.TextValue.Equals(confirm_Password.TextValue))
{
passwords_must_match.Checked.Equals("True");
}
else
{
passwords_must_match.Checked.Equals("False");
}
This should take care of most of it. My only problem now is that I only accoutn for =6. Really, I want to be able to say that if it is => 6...then True, else "False"
if (create_Password.SelectionLength.Equals(6))
{
min_6_chars.Checked.Equals("True");
}
else
{
min_6_chars.Checked.Equals("False");
}
if (create_Password.TextValue.Equals(confirm_Password.TextValue))
{
passwords_must_match.Checked.Equals("True");
}
else
{
passwords_must_match.Checked.Equals("False");
}
This should take care of most of it. My only problem now is that I only accoutn for =6. Really, I want to be able to say that if it is => 6...then True, else "False"
Re: code for create/confirm password issue
create_Password.SelectionLength should return an int.
You should be able to change it to this:
You should be able to change it to this:
Code: Select all
if (create_Password.SelectionLength >= 6)
Shortcuts usually aren't...