locked
Using Bounding rectangle that could not run in other machine UI 2012. RRS feed

  • Question

  • Please help

    I have some control (item toolbar or list menu) can't be clicked sucessfully so I try to add bounding rectangle.  It playbacks good only in machine that I develop it.   I tried to run in other machine...it does not run as I expected. (of course because it has diff coordinate).

    UICoreManagerWWindow.SetFocus();

    Mouse.Click(new Point(uIItemToolBar.BoundingRectangle.X + 100, uIItemToolBar.BoundingRectangle.Y+20));

    Please suggest me what I need to do to make this item toolbar or list menu open and I can use this code to run in any machine?

    Many thanks.

    Any

    Friday, October 4, 2013 2:03 PM

Answers

  • Hi Any,

    Thanks for your response.

    As my previous reply, if you add the DrawHighlight() for this control, could you get a blue rectangle around it?

    Mouse.Click (new Point (uIItemToolBar.BoundingRectangle.X + 100, uIItemToolBar.BoundingRectangle.Y+20));

    The #100 and 20 should be the coordinate based on action, if you don’t use them, does your test run well? Could you record a new test in this specific machine, generate it to code, and then compare it with the previous test code. 

    I didn't get any error.  It just clicked wrong position in other machine so my app didn't launch. 

    Just to make this issue clearly, do you mean that you just start an app/process with the Mouse.click or you have started the App UI, but it couldn’t click a control in this app UI? If it click on other place/control in your app UI, do you mean that your test still works well without error? Please check your Test Explorer window of your VS IDE? Maybe you could share us a screen shot about the result you got in your side.

    Best Regards,

    Update:

    If you just get this issue when you start/Launch the app, maybe you could use the Process.Start() or ApplicationUnderTest.Launch() method.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, October 10, 2013 5:43 AM

All replies

  • Hi Any,

    Could you share us the detailed error message in your side?

    Do you get the message like “it couldn’t find the control with the search properties”? If you add the DrawHighlight() for this control, could you get a blue rectangle around it? I doubt that the point of this control has changed automatically when you run the same app UI in other machines, so when you run it with the previous control location point, it would be failed. I’m afraid that you would change it to a more appropriate point manually.

    Best Regards,


    Jack Zhai[MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, October 7, 2013 9:18 AM
  • hi Jack

    Thank you very much for your replying.

    I didn't get any error.  It just clicked wrong position in other machine so my app didn't launch.  My question is: do you have other way to solve this issue so I can develop and can run in multiple machines? Many thanks

    Any

    Wednesday, October 9, 2013 2:26 PM
  • Hi Any,

    Thanks for your response.

    As my previous reply, if you add the DrawHighlight() for this control, could you get a blue rectangle around it?

    Mouse.Click (new Point (uIItemToolBar.BoundingRectangle.X + 100, uIItemToolBar.BoundingRectangle.Y+20));

    The #100 and 20 should be the coordinate based on action, if you don’t use them, does your test run well? Could you record a new test in this specific machine, generate it to code, and then compare it with the previous test code. 

    I didn't get any error.  It just clicked wrong position in other machine so my app didn't launch. 

    Just to make this issue clearly, do you mean that you just start an app/process with the Mouse.click or you have started the App UI, but it couldn’t click a control in this app UI? If it click on other place/control in your app UI, do you mean that your test still works well without error? Please check your Test Explorer window of your VS IDE? Maybe you could share us a screen shot about the result you got in your side.

    Best Regards,

    Update:

    If you just get this issue when you start/Launch the app, maybe you could use the Process.Start() or ApplicationUnderTest.Launch() method.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, October 10, 2013 5:43 AM
  • Hi Any,

    You can use the peice of code by which it would not be dependent on the machine.

    HtmlButton B1=new HtmlButton(1);

    B1.SearchProperties.Add(2,3);

    Mouse.click(B1);

    1--> Parent of that button, you can provide either through UIMap or similarly you can look for BrowserWindow object.

    2,3 --> It is params array so you can add as many number of name value pairs i.e propertyname,propertyvalue.

    In 1 if you are using UIMap then its Ok but if you want to use Browser Window then use it like this

    BrowserWindow Bw=new BrowserWindow(PropertyName,PropertyValue)

    and provide this Bw object to the Button.

    This is known as "Descriptive Programming".


    Frestest

    Thursday, October 10, 2013 7:52 AM