Visual Studio性能编码UI

编程入门 行业动态 更新时间:2024-10-05 23:31:31
Visual Studio性能编码UI - 弹出窗口损坏,因为Web测试记录器导致它在完整窗口中打开(Visual Studio Performance Coded UI - Popup Window broken, Because Web Test Recorder is causing it to open in a full window)

我有ASP.net webform打开一个弹出窗口。 example window.open(""); 当在内部单击超链接时,POPUP窗口自行关闭。 [就像按姓名搜索人一样,选择人并将该人传回父表。]然后从javascript发回。 当它是一个完整的窗口[不是弹出窗口]时,它不会回发或关闭窗口。 当没有录制测试时,它会打开模态弹出窗口并关闭\ post返回正常。

真正的问题是,如果无法关闭弹出窗口并将所选值传回父窗体,则无法完成测试。

如何停止测试记录器全屏打开窗口。 或者如何在窗口化时使弹出窗口正常执行[关闭和回发数据]。

这是一个小信息。 在弹出窗口中,我在关闭窗口后强制回发。

function CancelPopupWindow() { self.close(); //Here to force a post back on the parent. This is used to automatically save the data window.opener.__doPostBack('', ''); }

其他人都在讨厌这个问题。 请投票选择用户语音修复。 https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/16390135-make-web-performance-popup-javascript-dialogs-open

I have ASP.net webform that opens a popup window. example window.open(""); The POPUP window closes itself when a hyperlink is clicked inside. [Like search for person by name, select person and pass the person back to the parent form.] Then posts back from the javascript. When it is a full window[not a popup], It does not postback or close the window. When not recording for a test, it opens the modal popup and closes\posts back fine.

The real problem is you cannot finish a test if you cannot close the popup and transfer the selected values back to the parent form.

How do I stop the test recorder from opening the window in full screen. Or how can I make the popup perform normally[close and postback the data] when windowed.

Here is a little info. In the popup I force a postback after closing the window here.

function CancelPopupWindow() { self.close(); //Here to force a post back on the parent. This is used to automatically save the data window.opener.__doPostBack('', ''); }

Anyone else hating this problem. Please vote for a fix at User Voice. https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/16390135-make-web-performance-popup-javascript-dialogs-open

最满意答案

有一个解决方法。 程序Fiddler可用于记录整个测试,然后使用Fiddler的菜单=> File => Export sessions => All sessions => Visual Studio web test ,然后按照其余提示进行操作。 这将产生一个.webtest文件。 与任何其他.webtest文件一样,它可能需要解决动态数据等问题。

变体是使用Visual Studio尽可能多地记录。 从测试开始直到问题发生。 如果可能,您还可以记录测试的完成情况。 所以只省略了问题。 您还可以使用Fiddler记录问题部分并保存。 现在您有两个或三个.webtest文件,涵盖整个测试。 现在只需合并它们。 使用Visual Studio Web测试编辑器,您可以复制请求并将其粘贴到其他测试中。 (或者在同一测试中的位置。您也可以在.webtest拖动请求以重新排序它们。

记录使用JavaScript的步骤的目的是充分了解他们所做的工作,以便为Web测试复制足够的操作。 因此,混合来自不同录音的乐曲是有效的。

.webtest文件包含XML,因此可以使用文本编辑器进行编辑。 我经常以这种方式进行更改,例如用context参数替换多次出现的相同字符串。 在合并多个文件中的片段时,在此文本级别进行编辑会有所帮助。 小心做备份。 Visual Studio只是拒绝加载.webtest格式错误的XML的.webtest文件。

There is a workaround. The program Fiddler can be used to record the entire test then use Fiddler's menu => File => Export sessions => All sessions => Visual Studio web test and then follow the remaining prompts. That will produce a .webtest file. Like any other .webtest file it will probably need work to resolve dynamic data etc.

A variations is to record as much as you can with Visual Studio. From the start of the test up until the problem occurs. If possible you could also record the completion of the test. So just the piece with the problem is omitted. You can also record the problem part with Fiddler and save that. Now you have two or possible three .webtest files that cover the whole test. Now just merge them. With the Visual Studio web test editor you can copy requests and paste them into other tests. (Or else where in the same test. You can also drag requests in a .webtest to reorder them.

The purpose of recording the steps that use JavaScript is to learn enough of what they do so as to replicate enough of their action for the web test. So mixing pieces from different recordings is valid.

The .webtest file contains XML and so can be edited with a text editor. I often make changes in this way, for example to replace many occurrences of the same string with a context parameter. Editing at this text level can help when merging pieces from multiple files. Just be careful to make backups. Visual Studio just gives refuses to load .webtest files with mal-formed XML.

更多推荐

本文发布于:2023-08-07 16:19:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465228.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:性能   Visual   Studio   UI

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!