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

Unable to locate element on Silverlight

5 Answers 85 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 09 Feb 2015, 05:53 PM
Hi There,

I need some help to solve a problem with Test Studio.
My silverlight application have some alert popups. I need to check if the popup is opened or closed to execute or not some steps..

One of the ways that i tried to do this is checking the popup window visibility. So i opened the window, created the element of the window and inserted two steps on the code: Check if the window is visible and check if the window is collapsed. When i run the test, the behavior is corrrect and Test Studio check that the element is visible. But if i close the popup and re-run the test, Test Studio stop finding the element and fails the check. 

I tought the problem is because the popup was closed, the element doesn't exists anymore. So Test Studio can't find the element and returns the error.
So, i tried changing the check to "Exists/Not Exists" check. For my surprise, this isn't working either!! On both cases, the Test Studio says that can't find the element (even if the element exists) and fails my tests.

Am i doing something wrong or my application must be changed?? I'm attaching the log of the execution, including the DOM of the page of both situations.

Can somebody help me??

5 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 11 Feb 2015, 05:40 PM
Hello Daniel,

After looking at the snapshot of the DOM contained in popup_faillog_exists_existsnot.zip I'm surprised anything is working. Test Studio is not designed to work with your method of Silverlight application deployment. Let me explain. Here's an extract from your DOM:

<form id="form1" action="." method="post" style="HEIGHT: 100%" />
    <div class="aspNetHidden">
        <input id="__VIEWSTATE" name="__VIEWSTATE" type="hidden" value="n7fRFkZAIa7LkV+z1g7Ue/SXlQbGCudQGwspzXczaJ0PNcVwOaA4FeLC908KyLU1wYJkXE/xKRZbtOIhtLjH4BiTtSCLiWZYg9/IlIIT0Ik=">
    </div>
    <div class="aspNetHidden">
        <input id="__VIEWSTATEGENERATOR" name="__VIEWSTATEGENERATOR" type="hidden" value="CA0B0334">
    </div>
    <div id="silverlightControlHost">
        <object automationuid="9681ca14-6e5f-4adf-b837-b4f670c30f6e" data="data:application/x-oleobject;base64,QfXq3+HzJEysrJnDBxUISgAJAACcxQAAAkQAAAwAAAB3AGgAaQB0AGUAAAAAAAAAAAAAAAAAAABaAAAAQwBsAGkAZQBuAHQAQgBpAG4ALwBQAHIAaQBNAGEAbgBhAGcAZQByAC4AUwBoAGUAbABsAC4AVQBJAC4AeABhAHAAPwAtADkANwA2ADAAOQAyADMANgA3AAAAPAAAAAAAAAAmAAAAbwBuAFMAaQBsAHYAZQByAGwAaQBnAGgAdABFAHIAcgBvAHIAAAAAAAAAAAAAAAAAAAAAAAAAFgAAAGwAYQBuAGcAPQBwAHQALQBCAFIAAAAAAAAAAAAAAAEAAAABAAAAOgAAAEMAbABpAGUAbgB0AEIAaQBuAC8ATABvAGEAZABlAHIALwBMAG8AYQBkAGUAcgAuAHgAYQBtAGwAAAAAAAAAQAAAAG8AbgBTAG8AdQByAGMAZQBEAG8AdwBuAGwAbwBhAGQAUAByAG8AZwByAGUAcwBzAEMAaABhAG4AZwBlAGQAAAAYAAAANQAuADAALgA2ADEAMQAxADgALgAwAAAACgAAAHQAcgB1AGUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" height="100%" isautomationready="true" type="application/x-silverlight-2" width="100%">
            <a href="http://go.microsoft.com/fwlink/?LinkID=149156&;v=5.0.61118.0" style="text-decoration: none">           
                <img alt="Get Microsoft Silverlight" src="http://go.microsoft.com/fwlink/?LinkId=161376" style="border-style: none" />     
            </a>       
            </object>
        <iframe id="_sl_historyFrame" style="BORDER-LEFT-WIDTH: 0px; HEIGHT: 0px; BORDER-RIGHT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; VISIBILITY: hidden; WIDTH: 0px">
        </iframe>
    </div>
</form>

It looks like you're using an x-oleobject to embed your Silverlight application in the HTML source. Test Studio is not designed to work with this deployment method. It was designed to work with .XAP files in this fashion:

<form id="form1" runat="server" style="height:100%">
    <div id="silverlightControlHost">
        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
          <param name="source" value="ClientBin/SilverlightApplication1.xap"/>
          <param name="onError" value="onSilverlightError" />
          <param name="background" value="white" />
          <param name="minRuntimeVersion" value="4.0.60310.0" />
          <param name="autoUpgrade" value="true" />
          <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.60310.0" style="text-decoration:none">
              <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
          </a>
        </object>
        <iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px">
        </iframe>
    </div>
</form>

Notice the use of a param tag pointing to the .XAP file for deploying the Silverlight application. This is the standard approach that Test Studio was designed to work with. Can you modify your project to work this way? I've attached a rudimentary Visual Studio Silverlight project as a demonstration.

P.S. I also noticed that your  opening <form tag is self closing in addition to a closing </form> tag. This is a slight HTML coding error that should be fixed.

Regards,
Cody
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Daniel
Top achievements
Rank 1
answered on 11 Feb 2015, 07:43 PM
Dear Cody

Thanks for the reply.

I checked the DOM of my application and i found an issue of Test Studio.
If i open the application on IE without using Test Studio's recorder, the object data is correct, as you said previously how it should be.
But when i open the application on on IE using Test Studio's recorder, the object data is changed to the wrong one. I took some prints to show how it is changed.
If you want to check, you can use our website: www.primanager.com. 

Can you look this problem, please? I need to solve this ASAP.

Best Regards

Daniel Flório
0
Cody
Telerik team
answered on 11 Feb 2015, 10:56 PM
Hi Daniel,

Thank you for pointing me to your production website. Using Fiddler I was able to prove that your application actually does use XAP files (see attached screen shot) which is compatible with Test Studio. I apologize the oleobject data was a red herring. I didn't properly recognize it as the method Test Studio uses to inject our testing hooks into the Silverlight application.

Since I can access your production website, can you send me a test that exhibits the problem that I may study? The test is a .tstest file on disk along with the matching .resx file and matching option .cs/.vb file. Or at least give me directions (including logon credentials) I can follow to reproduce the problem? Once I can reproduce the problem on my machine I can investigate it and determine the root cause, and hopefully a solution for you as well.


Regards,
Cody
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Daniel
Top achievements
Rank 1
answered on 12 Feb 2015, 11:41 AM
Hi Cody,

Since i can't give credentials to the website, i contacted the developers and they'll create a mockup to reproduce the core of this problem. When it's done, i'll send to you the mockup with all the test files.

I have one question: how long this problem can be solved? Because i'm doing this on the trial version of the Test Studio and i have only 16 days remaining. That's the time that i have to check if the tool is suitable for our needs and if we'll buy it or not.

Best Regards

Daniel
0
Cody
Telerik team
answered on 13 Feb 2015, 07:28 PM
Hi Daniel,

By "how long this problem can be solved?" are you asking how long it would take us to fix a problem? That is impossible to say at this point. There are too many variables:

1) First I have to confirm it's a bug in Test Studio. I might be able to provide an easy work around or solution.
2) If we confirm it's a bug in Test Studio it then depends on how much code churn it will take. The more code that has to be changed the longer it will take.
3) It depends on how serious the bug is, how many of our customers are likely to also hit the same bug. This affects the priority of working on it.
3) It also depends on the current work load in development. Sometimes they can work on fixing a bug right away, other times it can take 4 weeks before they can work on it.

Lastly, don't worry about your trial running out. We have the ability to extend trials when we can justify the business need.

I look forward to receiving your mock application that reproduces the issues!

Regards,
Cody
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Daniel
Top achievements
Rank 1
Answers by
Cody
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or