Page 1 of 1

User Code method

Posted: Wed May 06, 2015 12:18 am
by c676228
Hi,

I am trying to create a method with an Adapter passed as a parameter. The Adapter is bound to a repository item.

I use the following method to validate:
public void CheckEmailDuplicateError(Adapter EmailDuplicteError)
{
if(Validate.Exists( EmailDuplicteError.Element, "my test message", true))
{
// do something here.
//The interesting thing is whether the element exists or not, the break point at this if statement is never hit

}
}

What exactly the difference between passing Adapter and RepoItemInfo to the method. They all bound to repository item.

Re: User Code method

Posted: Wed May 06, 2015 3:11 pm
by krstcs
I'm not sure the issue with the break point isn't a bug. I've seen it as well. They have made a lot of changes to the debugger lately so I'm guessing that the issue was introduced in one of those because it just started.

The problem is that break points inside conditional statements are never 'hit'. You can break before the conditional and step into the block, but if you put a break inside the conditional the debugger doesn't see it.


As for passing an adapter, that should work fine, depending on what you are doing with it. The difference is just that they are different object types. You have different sets of abilities with each. An adapter is the mechanic that Ranorex uses to interact with the actual element and has all of the action functions built into it for it's element type (button, text, etc.). A repoiteminfo object just contains information about the repo item, but will allow some actions on the element as well, depending on what you call.

Re: User Code method

Posted: Thu May 07, 2015 4:32 pm
by Support Team
Hi,

I tried to reproduce the issue on my machine with your code, but in my case everything worked as expected.
May I therefore ask you which Ranorex version your are using and which OS version?

Thanks,
Markus

Re: User Code method

Posted: Thu May 07, 2015 6:02 pm
by c676228
Hi Markus,

The Ranorex version is 5.3.2.23378
OS: Windows 8 Enterprise

I am actually having quite a number of issues with this build.

The same user code behaves differently in three different browsers(IE, Firefox, Chrome).
I will request a remote session to demo my issues. It is quite bizarre.

For example: Firefox: for the following code if step1 fails, the cleanup job is catch section is quickly executed.
If step2 fails, it takes about 1.5 to 2 min to execute the cleanup in the catch section.
IE: step2 frequently causes program stalling or not responding, have to quit the program after 5 to 6 min.
Chrome: An issue occurs before this step since it skips filling data to a field which doesn't occur to firefox and IE

try {
Validate.NotExists(emailDuplicateError); // step 1
Validate.NotExists(userIDDuplicateError); //step 2


}
catch {
//do some cleanup
return;
}

Re: User Code method

Posted: Fri May 08, 2015 2:15 pm
by Support Team
Hi,

Okay, in order to schedule a remote session, may I ask you to send an email to [email protected]?
Please add the link to this forum post to the email.

Thanks,
Markus

Re: User Code method

Posted: Fri May 08, 2015 4:44 pm
by c676228
Hi Markus,

I have a specific person from your company to have remote sessions.
I will write an email to him and include this url.

Thanks for your attention.
Betty

Re: User Code method

Posted: Fri May 08, 2015 8:42 pm
by c676228
I change the method call as the following:
try {
Validate.NotExists(emailDuplicateError.AbsolutePath, new Duration(15000)); //step1
Validate.NotExists(userIDDuplicateError.AbsolutePath, new Duration(15000)); //step2

}

Now the 1.5 to 2 min delay to execute the cleanup in the catch section is gone. However, IE still stalls frequently
when this method is called.

Re: User Code method

Posted: Mon May 11, 2015 1:22 pm
by Support Team
Hi Betty,

Please analyze this with my colleague on your machine and please let us know what caused the issue.

Please note that the Validate.NotExists keeps looking for the specific element the whole search timeout long to not exist, until it exists.
When you do not explicitly use a search timeout, the default search timeout will be used.

Regards,
Markus

Re: User Code method

Posted: Tue May 12, 2015 8:08 pm
by c676228
Hi Markus,

I haven't heard anything from your colleague yet. I will definitely do it once I am arranged the session.

Thanks,
Betty