Having issues with finding a FF7 form

Ask general questions here.
User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Having issues with finding a FF7 form

Post by Aracknid » Tue Nov 22, 2011 12:10 am

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
sign out in ff.JPG (7.63 KiB) Viewed 820 times
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
spy.JPG (44.86 KiB) Viewed 820 times
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
runtime error.JPG (36.52 KiB) Viewed 820 times
Any thoughts on this?

Thanks,

Aracknid

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

Re: Having issues with finding a FF7 form

Post by Support Team » Wed Nov 23, 2011 1:49 pm

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

User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Having issues with finding a FF7 form

Post by Aracknid » Wed Nov 23, 2011 4:16 pm

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

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

Re: Having issues with finding a FF7 form

Post by Support Team » Wed Nov 23, 2011 4:47 pm

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

User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Having issues with finding a FF7 form

Post by Aracknid » Thu Nov 24, 2011 12:04 am

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

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

Re: Having issues with finding a FF7 form

Post by Support Team » Thu Nov 24, 2011 12:00 pm

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

User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Having issues with finding a FF7 form

Post by Aracknid » Thu Nov 24, 2011 4:32 pm

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
Attachments
ConsoleApplication1.zip
(15.91 KiB) Downloaded 125 times

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

Re: Having issues with finding a FF7 form

Post by Support Team » Fri Nov 25, 2011 10:12 am

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

User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Having issues with finding a FF7 form

Post by Aracknid » Fri Nov 25, 2011 4:00 pm

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.

User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Having issues with finding a FF7 form

Post by Aracknid » Fri Nov 25, 2011 4:13 pm

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

User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Having issues with finding a FF7 form

Post by Aracknid » Fri Nov 25, 2011 8:14 pm

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