Ranorex

How can I automate Color Dialogue

 
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexNet
View previous topic :: View next topic  
Author Message
saurabh



Joined: 20 Jul 2007
Posts: 20
Location: India

PostPosted: Fri Jul 20, 2007 2:39 pm    Post subject: How can I automate Color Dialogue
I want to automate Color dialogue but i didn't get any API in Ranorex .NET Library.
Even Ranorex Spy is not identifying the color box in color dialogue there is no control Name or control id for each color box.
Its just giving some common parent so i am unble to select a particular color from there.Apart from this the there is no control name giving by Ranorex spy for button containing by color dialogue.
Please help me out to do that.Its very critical for my client.I am using paid version of ranorex.
Please see this link to take a look kind of color dialogue automation i want

http://web.mit.edu/hg_v1.4/distrib/mercury_1.4/docs/mercury/PortableHT ML/mercury_portable-3-050.html

Here no Control Name show by Ranorexspy for these buttons
1.OK
2.Cancel
3.Add To Custom Color

also for
Basic colors
custom colors

Send me code for the same
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Fri Jul 20, 2007 4:21 pm    Post subject:
The following code sample reads the selected colors (red, green and blue) from the dialog, sets red=64, green=128 and blue=192 and clicks the OK button.

Code: click into code to enlarge
Form form = Application.FindFormTitle("Color");
if (form == null)
    return 1;

Element red     = form.Element.FindChild(Role.Text, "Red:");
Element green   = form.Element.FindChild(Role.Text, "Green:");
Element blue    = form.Element.FindChild(Role.Text, "Blue:");

if( red == null || green == null || blue == null )
{
    Console.WriteLine("ERROR: red, green or blue edit box not found");
    return 1;
}

Console.WriteLine("Color Red={0} Green={1} Blue={2}", red.Value, green.Value, blue.Value);
red.Value   = "64";
green.Value = "128";
blue.Value  = "192";

Element okButton = form.Element.FindChild(Role.PushButton, "OK");
if (okButton != null)
    Mouse.ClickElement(okButton);

return 0;


Gabor
Ranorex Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexNet All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum