Page 1 of 1

Having issues with finding a FF7 form

Posted: Tue Nov 22, 2011 12:10 am
by Aracknid
Hi,

I've just installed Ranorex 3.1.2 (upgraded from 3.1.0) and I also just upgraded FF from 3.x to 7.0.1. Obviously there are changes in FF from 3.x to 7, and the first one I've run into is causing me problems.

Instead of seeing a familiar "message box", I'm getting the entire FF window to dim to gray and a message box that looks as this:
sign out in ff.JPG
The Ranorex Spy tool cannot identify the items using Tracking button or instant tracking. But if I go into the spy tool and dig down the main FireFox Form, I can see it (note that it does not appear in the FF DOM object).
spy.JPG
In my code, I'm trying to find this item. My goal is to try to see the text, determine if it's what I want, and handle the message.

The code is basically as follows (note that I copied the Xpath right from the Spy tool and in this example I xxx'd out the name):
Dim msgbox as Ranorex.Form = Nothing
Dim sPathToForm as string = "form[@title~'^xxxxxxx']/container[@accessiblerole='PropertyPage']/container[1]/container/form"
If Not Ranorex.Host.Local.TryFindSingle(sPathToForm, 3000, msgbox) then
    'deal with it
else
    ' deal with it
end if
When I run the program and it gets to the TryFindSingle, I get this popup in VisualStudio 2010:
runtime error.JPG
Any thoughts on this?

Thanks,

Aracknid

Re: Having issues with finding a FF7 form

Posted: Wed Nov 23, 2011 1:49 pm
by Support Team
Hi,

Did you get this error every time or only in special cases?
Did you get this error only in Visual Studio or even in Ranorex Studio?
We use a similar code in our web test sample and we never had such an issue.

Regards,
Peter
Ranorex team

Re: Having issues with finding a FF7 form

Posted: Wed Nov 23, 2011 4:16 pm
by Aracknid
Did you get this error every time or only in special cases?
I get this issue everyt ime, but since I only just upgraded and started hitting it, it has only happened a few times before I gave up and posted this.
Did you get this error only in Visual Studio or even in Ranorex Studio?
That is a visual studio error. I don't use the studio.

Aracknid

Re: Having issues with finding a FF7 form

Posted: Wed Nov 23, 2011 4:47 pm
by Support Team
Aracknid wrote:That is a visual studio error. I don't use the studio.
With the code you posted above, am not able to reproduce the issue.
Please could you try to create a new solution with the lines of code you posted before and nothing else. Is this working on your side? Did you change some other settings in VS2010?
Which framework is used for your solution?

Regards,
Peter
Ranorex Team

Re: Having issues with finding a FF7 form

Posted: Thu Nov 24, 2011 12:04 am
by Aracknid
Here is the exact code I used for this new project. Also, the target framework is ".NET Framework 4". It gave me the error as shown in my previous post. I changed the target to .NET Framework 3.5 and it worked.
Imports Ranorex
Imports Ranorex.Core

Module Module1

    <STAThread()>
    Sub Main()

        Dim msgboxwin As Ranorex.Form = Nothing

        Try

            If Not Ranorex.Host.Local.TryFindSingle("/form[@title~'^MyAppName]/container[@accessiblerole='PropertyPage']/container[1]/container/form", 5000, msgboxwin) Then
                Debug.Print("COULDN'T FIND THE FORM")
            End If
            Debug.Print("SUCCESS")

        Catch ex As Exception
            Debug.Print("FAILURE:" & ex.Message)

        End Try

    End Sub

End Module
Can you get the issue with .NET 4 on your end?

Aracknid

Re: Having issues with finding a FF7 form

Posted: Thu Nov 24, 2011 12:00 pm
by Support Team
Hi,
Can you get the issue with .NET 4 on your end?
No, in our case it works with the .Net 4.
Do you have used any additional settings in VS or do you have installed the SP1 for Visual Studio 2010?
Can you send us your solution, maybe be can reproduce it with the solution?

Regards,
Markus
Ranorex Support Team

Re: Having issues with finding a FF7 form

Posted: Thu Nov 24, 2011 4:32 pm
by Aracknid
My version of VS2010 is 10.0.40219.1 SP1Rel
My Version of .NET Framework is 4.0.30319 SP1Rel

I've obviously changed some settings in Visual Studio from what ever the defaults were, but couldn't tell you which ones...

I've attached my solution.

Aracknid

Re: Having issues with finding a FF7 form

Posted: Fri Nov 25, 2011 10:12 am
by Support Team
We now tried to reproduce that problem with exactly this environment (VS 2010 SP1, .NET 4.0 SP1) and other environments (VS 2010 RTM, Vista, ...) with the project you posted, but could not reproduce that exception.
Actually, we have no idea where this error should come from. Your environment is one of our standard testing environments and the code you execute is basic Ranorex functionality - so there should be a very little chance for bugs there :?

Can you reproduce that problem on other machines, too?
Do you have Ranorex installed using the self-extracting zip file (e.g. "Ranorex-3.1.2.exe")?

Regards,
Alex
Ranorex Team

Re: Having issues with finding a FF7 form

Posted: Fri Nov 25, 2011 4:00 pm
by Aracknid
Here is more system info, in case it matters:

- I'm on XP SP3 (isn't that sad :( )
- I'm using FF 7.0.1 (this is the latest version I believe)
- My machine is a VMWare virtual machine
- I have no access to the internet from this machine, as I'm in a test environment

This is currently the only environment I can work in. If I make another, it will be identical since all my machines are VMs and based off the same base template machine.

I installed 3.1.2 from the exe.

I wonder if maybe there isn't some sort of hot fix or patch I don't have (since I'm have no internet access) that maybe fixes something to do with VS or .NET. I will check.

Aracknid.

Re: Having issues with finding a FF7 form

Posted: Fri Nov 25, 2011 4:13 pm
by Aracknid
I should also probably double check to make sure, when you run my program you have to have one of those dialogs on the screen already, and you have to change the title string to look for it. The error only happens when it finds the item. IF there is no item, then it will work properly and 'fail' the conditional check.

Aracknid

Re: Having issues with finding a FF7 form

Posted: Fri Nov 25, 2011 8:14 pm
by Aracknid
Good news. I got it working. I was able to get Internet access for this computer in order to do a Windows Update. I had well over 120 items to update, many of which were .NET 4 related. After about 3 hours, it finished everything. I now need no more updates for this system.

I tried my code and it now works. Unfortunately I cannot tell you which specific update (or combination of updates) fixed the problem.

I will now make it a habit to do updates on these test machines every once in a while to ensure these issues are elimiated (and that new ones can replace them :D )

Aracknid