This is a migrated thread and some comments may be shown as answers.

Unable to click silverlight hyperlinkbutton with windows7

9 Answers 144 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ravi Chandra
Top achievements
Rank 1
Ravi Chandra asked on 20 Jul 2010, 09:30 PM
Hi There, I'm trying to use silverlight hyperlinkbutton class as below for tests.

I see below code working for W2k8 and but not for Win7. Anyone hitting the same issue, some seetings need to be changed for win7?

private SilverlightApp App
{
    get
    {
        return this.Manager.ActiveBrowser.SilverlightApps()[0];
    }
}
private HyperlinkButton Button
{
    get
    {
        return this.UploadApp.FindName<HyperlinkButton>("_Button");
    }
}
public void ClickUpload()
{
    this.Button.User.Click(); //<<==== this doesn;t fire click for button specified. 
}

Thanks,
Saravanan

9 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 22 Jul 2010, 10:00 PM
Hello Ravi Chandra,

I cannot explain why the difference in behavior between Win7 and W2k8. The .Click you are using should be moving the mouse to the control and sending a mouse click event at that point. Is the mouse moving to the control? Is it possible the button is in the wrong spot? Do you get an error message when the .Click is called (such as element not found)? Is it possible the click is happening too quickly such that the button isn't ready for to take a click event?

Kind regards,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ravi Chandra
Top achievements
Rank 1
answered on 22 Jul 2010, 10:06 PM
It doesnt return any error.
And the object isnt null as well.

is there any way we can turn on some logging to understand why its not able to click or what is happening behind the screens (webaii)
0
Cody
Telerik team
answered on 23 Jul 2010, 03:07 AM
Hi Ravi Chandra,

If the framework was unable to perform the click for any reason an exception would have been thrown. Since you aren't getting an exception, the framework believes it did the click successfully. The best thing to do is to watch the mouse cursor while the test is running. Does it move to the correct location at the correct time? You should see the mouse appear to hover over the center of the button when it's performing the click.

You could also try turning on Annotation using code like this:

Manager.Settings.AnnotateExecution = true;

Once enabled you will see additional highlighting and comments appear in the browser window as the test steps are performed.

Best wishes,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ravi Chandra
Top achievements
Rank 1
answered on 23 Jul 2010, 03:10 AM
we call ScrollToVisible before that.

We have seen that the mouse is on the correct control.
Will enable the annotation and let you know.
0
Kiran
Top achievements
Rank 2
answered on 23 Jul 2010, 05:34 AM
Hi,

I assume that the hyperlink click is working manually in windows7.
Try this also. Am not sure if this solves your issue.

1. Try to click the button twice
    

 

Button btnShowPopup = app.Find.ByName<Button>("btnShowPopup");

 

btnShowPopup.User.Click();

btnShowPopup.User.Click();


2. Check whether the silverlight control is activated.If not one extra click will be needed for this
    

 

//To activate the silverlight control

 

app.Desktop.Mouse.Click(

MouseClickType.LeftClick, app.Bounds);

 

0
Carlos Marcão
Top achievements
Rank 2
answered on 12 Aug 2010, 03:48 PM
Hello.

I'm facing the same problem with Windows 2008 Server R2 (similar to Windows 7)but with my previous OS version everything ran ok (Windows 2008 Server).

The problem in my current configuration (Windows 2008 Server R2 + IE8 + VS2008 + Silverlight 3.0 + WebAii 2010.2.713.0) is the same as our collegue. WebAii framework clicks in a wrong place.

I'm using the following code:

Button button = _homePagesTab.Find.ByName<Button>("PropertiesBtn");
button.Highlight();
button.User.Click(MouseClickType.LeftClick);

Instruction button.Highlight(); hilights the correct control but click operation isn't executed over desired button.
I'm attaching a print screen after execute Click method... 
Additional information: I have one IFrame where is running my Silverlight application. The  black line in the top of the image is my main window. The black spot is the place where framework clicked as response to button.USerClick operation. The red square is the reponse to button.Hilight.

I think that is an WebAii framework problem. Let me know if I'm wrong. 

Thanks in advance,

Carlos Marcão
 
0
Konstantin Petkov
Telerik team
answered on 13 Aug 2010, 08:54 AM
Hello Carlos,

Have you tried the previous suggestions in this thread? I wonder if the Desktop.Mouse.Click over the button rectangle clicks correctly.

Also can you please run the latest build of the framework available for download here. Let's make sure that's not a problem we have addressed recently, thank you!

Finally, is that site available publicly or can you share access to it via a private support ticket? I'd like to play with it and see if I can reproduce the problem.

Regards,
Konstantin Petkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Carlos Marcão
Top achievements
Rank 2
answered on 13 Aug 2010, 05:34 PM
Hello. Thank you for your answer.

I tried to create a project to reproduce the situation... As far as I realized my problem is related with Iframes within IFrames. I created a page with an Iframe that opens another  page with other I frame and finally that IFrame opens a page with the Silverlight application.

I got the same behaviour as in my application. Hilight operation recognize the control correctly but the Mouse.Click clicks in other area of my page.

Let me know if this is a known situation and if you have an workaround.
I have a simple project that reproduces the problem. If you need that project let me know.

Waiting for your feedback,

Carlos Marcão
0
Cody
Telerik team
answered on 13 Aug 2010, 07:53 PM
Hello Carlos offerring,

Yes your test project will be very helpful. Thanks for offering it! No there is no known issue with the scenario you describe. You will need to open a new support ticket to be able to attach a file.

Kind regards,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Ravi Chandra
Top achievements
Rank 1
Answers by
Cody
Telerik team
Ravi Chandra
Top achievements
Rank 1
Kiran
Top achievements
Rank 2
Carlos Marcão
Top achievements
Rank 2
Konstantin Petkov
Telerik team
Share this question
or