Send keys to browser dialog windows in Katalon Studio - katalon-studio

I would like to print pages after each click in Chrome. So script should perform a click and after that send "CTRL+P" to open printing dialog and "ENTER" to save page as PDF file by default.

I got solution on Katalon forum: https://forum.katalon.com/discussion/9776/send-keys-to-browser-dialog-windows
It is based on Java Robot class.
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_CONTROL)
robot.keyPress(KeyEvent.VK_P)
// CTRL+P is now pressed
robot.keyRelease(KeyEvent.VK_P)
robot.keyRelease(KeyEvent.VK_CONTROL)
// CTRL+P is now released

Related

VS Live Share and Live Server

We are using VS Live Share inside Visual Studio Code and the person who joined cannot open a shared HTML file with the Live Server extension. It says: Cannot GET .../index.html. Does Live Server only work with "local files"? There is also no option to open the shared HTML file in the file system and to open it that way. Help would be nice as quick as possible.
1-press the live share extension icon in the sidebar.
2-inside session details hover over shared servers sub-category.
3-an electrical plug with a green plus sign will show, press on it and an input field will pop up.
4-inside the input field write your localhost port like this e.g: localhost:5500 and press enter.
you can find the number of your port from the bottom right of vs code if you have a live server running. it will look like this: Port:5500.
once you do this a notification will automatically show in your partner's vs code to open the shared live server.

Save initiator in Chrome when saving as HAR

I'm trying to include the initiator information shown in chrome network tab in the developer bar when exporting as HAR, but I'm unable to find a way to do so. Is there any addon or work around to be able to save this information in HAR or any other format?
Perhaps there was a limitation with copying the Initiator data when you created the OP. Anyway, it is working fine now, using the latest version of Chrome: Version 67.0.3396.79 (Official Build) (64-bit).
To create the HAR file:
In Chrome press F12 to open DevTools then click on the Network tab.
Verify that the Initiator column is being displayed. Turn it on if necessary.
Verify that the Recording icon in the top left is on (i.e. It displays as a red circle).
Check the Preserve log checkbox.
Navigate to the desired URL.
Right click and select Save as HAR with content from the context menu.
To display the content of the HAR file later:
In Chrome press F12 to open DevTools and click on the Network
tab.
Select the HAR file you created earlier from your file system manager (e.g. Windows Explorer) and drag it to the Network panel. Chrome will prompt you to Drag HAR files here. See the Release notes for Chrome 62 for more details.
The HAR file content, including the Initiator column, will be displayed.

Selecting a file from a windows dialog box in Telerik Web Test

Hi guys,
Is it possible to select a file from a dialog box when we are running a web test in Telerik Test Studio? The scenario of this execution is when we click a field in a web browser, a windows dialog box pops out and we would need to input a path to a local folder and select a file(SelectFile.PNG).
But I'm unable to detect any element from this dialog box presuming this is because the test script is a web test and hence this limitation(do correct me if i'm wrong).
Is there any workaround or suggestion to this limitation?
Many many thanks!
Best Regards,
Pravin
praja#dongenergy.dk
Kind of a late response but if your recording is enabled, it should automatically record the step for a File Upload dialog box (and handle it appropriately when using play back).
Alternatively, you can manually add the "Dialogs->FileUpload" step, and fill in the properties appropriately.

Display Message Box to copy code section from it using Powershell script

I am building install.ps1 script for Nuget pacakge and would like to open popup message at the end with some message , i have already achieved by following.
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[Windows.Forms.MessageBox]::Show("Test message ", "Test", [Windows.Forms.MessageBoxButtons]::OK, [Windows.Forms.MessageBoxIcon]::Information)
It will open popup message as per shown in below fig.
Instead of this i would like put some config code here that user can copy from box as per below fig
Please suggest me if anyone has done similar popup box before!
You won't be able to customize Windows.Forms.MessageBox to add what your looking for. In order to do what your looking for you'll need to create a custom form. An easy way of doing this is to use Primal Forms Community Edition which can be found here. You'll need to register for free to reach the download. There's a paid for version to so don't confuse that with the free CE edition. This tool gives you a Visual Studio like forms editor where you can drag and drop controls to a form and save the Powershell script. You'll need to create an event handler for the copy to text to clipboard button. After you saved the code generated by PrimalForms CE you will need to edit it to add the code for the event handlers. An example of how you can set the clip board with Powershell can be found here.
Users can copy the message box text simply by pressing the Ctrl+C key combination.

WWW::Mechanize::Plugin::Display - Always open a new window

How can I configure WWW::Mechanize::Plugin::Display, so that the plug-in always opens a new window and not only a new tab?
The module uses HTML::Display for opening a browser, which in turn uses the environment variable PERL_HTML_DISPLAY_COMMAND for determining the command for opening a browser. So, if you want to use Firefox, for example, you can set that variable to firefox -browser %s to force opening a new window.
http://search.cpan.org/~corion/HTML-Display-0.39/lib/HTML/Display.pm
EDIT:
Sorry, this doesn't seem to work either. It opens a new empty window for each call to $mech->display, but also one tab for each call in which it then displays the content. Maybe you can find other command line options for Firefox or another browser that allows you to get the wanted behavior.
As an alternative you can configure your browser to always open new windows in new windows instead of new tabs (for Firefox: Preferences -> Tabs -> Open new windows in a new tab instead). If you want to keep that setting for your normal browsing, you can create an own profile for your Mechanize tests and add -P <your-test-profile> to your display command.