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

Button Click is clicking in the Corner

8 Answers 91 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Garrett
Top achievements
Rank 1
Garrett asked on 19 Aug 2016, 05:01 PM

Hi all,

I have been dealing with this problem for a while now and im not sure why my program is functioning this way. Whenever I try to click a button on a "pop-up", the automation will click the upper left of the screen, even though the button is near the center of the screen. The "pop-up" is not a new window btw, it is just something that is on the screen. Me and my coworkers are able to automate the other "pop-ups" we use just fine. For some reason though, this one is behaving differently.

Heres the HTMLbutton that im trying to target:

1.<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
2.   <div class="ui-dialog-buttonset">
3.      <button type="button" id="OK" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button">
4.        <span class="ui-button-text">OK
5.</span>
6.</button>
7.</div>
8.</div>

 

So I was wondering, is there like a premade function for clicking coordinates on the window?  or would there be a different way i could approach this?

8 Answers, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 23 Aug 2016, 01:21 PM
Hi Garret,

Please let me know first of all if this button is part of a frame? Here is further details how frames are supported in Telerik Testing Framework

If this element appears additionally you might need to refresh the DOM tree. This could be done in a coded step with the following line of code: 
Manager.ActiveBrowser.RefreshDomTree();

If this still does not fix your script, please let me know if you could provide me access to your application along with the script to test it on my side. Second best option would be to capture a Fiddler trace against the faulty page. We have about a 75% success rate using a Fiddler trace to simulate your web server and reproduce problems. To capture the traffic please follow these steps:

1 Start Fiddler - note no browser should be open
2 Click Clear Cache
3 If your site uses HTTPS click Decrypt HTTPS traffic
4 Start Capture
5 Launch a browser
6 Navigate to the problem page and pop up.
7 Stop Capture
8 Save Capture
9 Put the .SAZ file into a .zip file and attach that to this support ticket

In case this is not applicable as well please share the parent elements within which the button is located so I could try to reproduce it on my side. 

Thanks in advance! 

Regards,
Elena Tsvetkova
Telerik by Progress
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Garrett
Top achievements
Rank 1
answered on 24 Aug 2016, 02:59 PM
Thanks for the reply. I have to ask my boss first if doing any of the following is ok before i just start posting stuff. However, after looking at the code some more i think there may be something in the foreground that is covering up the whole page. Ill look into that some more in the meantime
0
Garrett
Top achievements
Rank 1
answered on 24 Aug 2016, 08:27 PM

Here is the parent element for the button

 

<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable ui-resizable" tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-walkthroughinstructions" style="display: block; z-index: 1004; outline: 0px; position: absolute; height: auto; width: 550px; top: 269px; left: 240px;"><div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"><a id="walkthroughinstructionsclosebutton" href="javascript:CloseInstructions('walkthroughinstructions')" class="dialogclosebutton"><img src="/content/images/esign/x.png"></a><span class="ui-dialog-title" id="ui-dialog-title-walkthroughinstructions">Instructions</span><a href="#" class="ui-dialog-titlebar-close ui-corner-all" role="button"><span class="ui-icon ui-icon-closethick">close</span></a></div><div id="walkthroughinstructions" class="ui-dialog-content ui-widget-content" style="width: auto; min-height: 0px; height: auto;"><div style="font-size:18px;">Document Signing Instructions</div>
 
<p>
Review all pages of the document and sign by clicking on the<img src="/content/images/esign/clicksign.png" height="30" style="padding:5px 0;margin:0 6px -10px 8px;">buttons and choosing<img src="/content/images/esign/clickcheck.png" height="26" style="padding:5px 0; margin:0 0 -14px 8px;">options where indicated.
</p>
<p>
Documents labeled <img src="/content/images/esign/mustprint.png" style="vertical-align:text-bottom;"> must be printed, physically signed and delivered to your loan officer (<i>not applicable on all packages</i>).
</p>
<p>
Some documents may not require a signature and will be marked signed after scrolling to the <u>very bottom</u> of the document and clicking the <b>"Acknowledge current document"</b> button.
</p>
<p>
Documents requiring signatures will be marked signed when the last available "Click to Sign" button has been selected for that document.
</p>
 
</div><div class="ui-resizable-handle ui-resizable-n" style="display: block;"></div><div class="ui-resizable-handle ui-resizable-e" style="display: block;"></div><div class="ui-resizable-handle ui-resizable-s"></div><div class="ui-resizable-handle ui-resizable-w"></div><div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se ui-icon-grip-diagonal-se" style="z-index: 1001;"></div><div class="ui-resizable-handle ui-resizable-sw" style="z-index: 1002;"></div><div class="ui-resizable-handle ui-resizable-ne" style="z-index: 1003; display: block;"></div><div class="ui-resizable-handle ui-resizable-nw" style="z-index: 1004;"></div><div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"><div class="ui-dialog-buttonset"><button type="button" id="OK" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button"><span class="ui-button-text">OK</span></button></div></div></div>

 

This just encompasses the instructions "pop-up". Thanks for the help!

0
Ivaylo
Telerik team
answered on 29 Aug 2016, 08:23 AM
Hello Garrett,

Please note that clicking on the upper left corner of the page is usually a sign that the element is present in the DOM, but is not displayed on the page. If there is something on the foreground that is covering the entire page that will make sense, however without access to the tested application we cannot determine this. You can also try downloading the Test Studio trial and try recording against the button in question, what is the result? Are you able to record against the button? Are you able to highlight? This will show clearly whether there is something covering the entire page.
Another way to proceed will be to provide access or fiddler trace so we can investigate. Please note that if you are going to provide sensitive information you should do this in a ticket, where all the information remains private, not in this thread in the public forum. 

Regards,
Ivaylo
Telerik by Progress
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Garrett
Top achievements
Rank 1
answered on 30 Aug 2016, 03:03 PM

So I download the Test Studio to see if that helps. The test studio was able to excute it just fine but in doing that, it messed something up with my telerik frame work and now I cant run any tests from visual studio. i tried redownloading and reinstalling but nothing changes. i get the error message:

An exception of type 'System.TypeInitializationException' occurred in ArtOfTest.WebAii.dll but was not handled in user code
 
Additional information: The type initializer for 'ArtOfTest.Common.TraceInfo' threw an exception.
 
System.io.filenotfoundException : Cloud not load file or assembly

In the past when i got this error it usually just meant i need to update my framework.

0
Garrett
Top achievements
Rank 1
answered on 31 Aug 2016, 03:23 PM

Im receiving a more detail error now:

{"Could not load file or assembly 'Telerik.TestingFramework.Interop, Version=2015.3.1314.0, Culture=neutral, PublicKeyToken=8ca00d3e0ebd4b8b' or one of its dependencies. The system cannot find the file specified.":"Telerik.TestingFramework.Interop, Version=2015.3.1314.0, Culture=neutral, PublicKeyToken=8ca00d3e0ebd4b8b"}

0
Elena
Telerik team
answered on 02 Sep 2016, 07:59 AM
Hello Garrett,

As of the error message you share I assume your framework version is an older version and installing the latest full Test Studio suite messed up the assemblies. Additionally it is recommended to always upgrade the testing framework itself to the latest version. What you could do now is to remove the Test Studio installation first, then upgrade the testing framework. At this stage I would recommend you try to click on the button again using the previously created code since occasionally if it is a bug it could be fixed. If the behavior is still the same install the trial version of Test Studio again and check what is the find expression used for that element.

Please share your observations once you gather any. Thanks for the cooperation! 

Regards,
Elena Tsvetkova
Telerik by Progress
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Garrett
Top achievements
Rank 1
answered on 02 Sep 2016, 03:12 PM

So it was an updating issue, but i had to do a little more than that. The way my project is set up, I need to build three seperate solutions so it took me a while to pinpoint the problems i was having. I ended up deleting the Telerik.TestingFramework.Interop because it wasnt getting uninstalled with the framework. After reinstalling and rebuilding my projects did it start working.

 

Also my button is now being click on the website! the main difference i can see was that i was trying to use innertext and the test studio used TextContent instead. im not sure what the difference is but its all good now.

Tags
General Discussions
Asked by
Garrett
Top achievements
Rank 1
Answers by
Elena
Telerik team
Garrett
Top achievements
Rank 1
Ivaylo
Telerik team
Share this question
or