User Code method

Ask general questions here.
c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

User Code method

Post by c676228 » Wed May 06, 2015 12:18 am

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.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: User Code method

Post by krstcs » Wed May 06, 2015 3:11 pm

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.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: User Code method

Post by Support Team » Thu May 07, 2015 4:32 pm

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
.
Image

c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Re: User Code method

Post by c676228 » Thu May 07, 2015 6:02 pm

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;
}

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: User Code method

Post by Support Team » Fri May 08, 2015 2:15 pm

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
.
Image

c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Re: User Code method

Post by c676228 » Fri May 08, 2015 4:44 pm

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

c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Re: User Code method

Post by c676228 » Fri May 08, 2015 8:42 pm

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.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: User Code method

Post by Support Team » Mon May 11, 2015 1:22 pm

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
.
Image

c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Re: User Code method

Post by c676228 » Tue May 12, 2015 8:08 pm

Hi Markus,

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

Thanks,
Betty