MudassarRasool / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

Icarus or Echo does not click button on Win7 #877

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Write a test which click button on app
2. Run this test in Icarus or Echo

What is the expected output? What do you see instead?
Button shall be clicked but it is not - instead it is only signed as currently 
active button. When I rerun the same test using Gallio TestDriven.Net Runner 
the button is clicked.

What version of the product are you using? On what operating system?
I tried this with version 3.3.458 and 3.3.422 on x64 win 7. On win xp it works 
fine. Framework in MbUnit.

Please provide any additional information below.
I tried both installers x64 and x86 - is it known issue or I'm missing anything 
in config what causes TD.Net plugin works fine?

Original issue reported on code.google.com by marcin.h...@gmail.com on 31 Jan 2012 at 12:33

GoogleCodeExporter commented 8 years ago
Additional info:
I tried this on another win7 x64 workstation and result is the same. Button or 
menu item is not clicked. Below you can find simple test on notepad:

using System;
using System.Diagnostics;
using White.Core;
using White.Core.UIItems.WindowItems;
using White.Core.UIItems.WindowStripControls;
using White.Core.UIItems.MenuItems;
using White.Core.UIItems.Finders;
using MbUnit.Framework;

namespace NotepadTest
{
    [TestFixture]
    class test
    {
        [Test]
        public void myTest()
        {
            Process process = new Process();
            process.StartInfo.FileName = "notepad.exe";
            process.Start();

            Application app = Application.Attach(process);
            Window window = app.GetWindow("Untitled - Notepad");
            window.Get<MenuBar>(SearchCriteria.ByText("Application")).MenuItemBy(SearchCriteria.ByText("File")).Click();
        }
    }
}

Original comment by marcin.h...@gmail.com on 8 Feb 2012 at 10:47

GoogleCodeExporter commented 8 years ago
Are you elevated (admin) when using Icarus/Echo? What about VS?

Original comment by grahamr...@gmail.com on 8 Feb 2012 at 11:03

GoogleCodeExporter commented 8 years ago
Yes, on each workstation I have admin privileges. 
On first laptop I have VS 2010 Ultimate, on second one I've installed Gallio 
only and imported dll.

BR

Original comment by marcin.h...@gmail.com on 8 Feb 2012 at 11:07

GoogleCodeExporter commented 8 years ago
Sorry, you're running as admin all the time? Or you run VS as admin?

Original comment by grahamr...@gmail.com on 8 Feb 2012 at 12:00

GoogleCodeExporter commented 8 years ago
Yes I'm running as admin all the time.

Original comment by marcin.h...@gmail.com on 8 Feb 2012 at 1:12

GoogleCodeExporter commented 8 years ago
Could you try Echo with the command line option "/r:IsolatedAppDomain", please?

Original comment by grahamr...@gmail.com on 8 Feb 2012 at 1:20

GoogleCodeExporter commented 8 years ago
It didn't help - still button is only marked as active, but not clicked.

Original comment by marcin.h...@gmail.com on 8 Feb 2012 at 1:31

GoogleCodeExporter commented 8 years ago
There goes that theory then :(

Original comment by grahamr...@gmail.com on 8 Feb 2012 at 1:57

GoogleCodeExporter commented 8 years ago
Any idea why TD.Net plugin works fine?

Original comment by marcin.h...@gmail.com on 9 Feb 2012 at 9:48

GoogleCodeExporter commented 8 years ago
No, in a word.

It sounds like something is interfering with White (which makes sense with 
Icarus, but less so for Echo). I'm going to try & reproduce it when I have some 
time. But I'm afraid I haven't got any helpful suggestions for now.

Original comment by grahamr...@gmail.com on 9 Feb 2012 at 10:24

GoogleCodeExporter commented 8 years ago
Hmm, I found this:

http://stackoverflow.com/questions/5631461/white-uiautomation-click-stops-workin
g-on-different-platform

I think you need to run White in an x86 process. Unfortunately, that's harder 
than it should be currently 
(http://groups.google.com/group/gallio-user/browse_thread/thread/27a369f632aade3
d).

Original comment by grahamr...@gmail.com on 9 Feb 2012 at 10:30

GoogleCodeExporter commented 8 years ago
This is brilliant!!
The solution is to set platform target to x86 (in project properties) when you 
build your .dll file with tests.

Thank you very much for this link!

BR

Original comment by marcin.h...@gmail.com on 9 Feb 2012 at 11:27

GoogleCodeExporter commented 8 years ago
Here to help :)

Original comment by grahamr...@gmail.com on 9 Feb 2012 at 12:37