How to capture Window title by using Window info tool in Autoit - autoit

Please tell me that how to capture the window title using “Window Info tool” and how can i use regular expression for window title part of Auto IT script to identify the window at run time.
My code is working Fine for IE but i want it to work for chrome too . is there any way to handle the window at run time using AutoIT

Try this:
$MY_TITLE_REGEX = "(?:Title1|Title2)"
Opt("WinTitleMatchMode", 4)
$handle = WinGetHandle("[REGEXPTITLE:" & $MY_TITLE_REGEX & "]")
This way you are able to use regular expressions for window titles (as defined in $my_regex) in order to get a handle to the desired window.
The AutoIt Window Info Tool can be used as follows to determine the title of a open window:
Open the target window you want to get the title for
Open Autoit Window Info Tool
Drag and drop the finder tool (the title cross hair on the right-hand-side) of the Window Info Tool on the target window
As a result, various information about this window should now be displayed in the tool
You can find the title of the window in the very first line (see below)
Source of original image
Hope this helps!

Related

How can I view the print modal in chrome with Karate UI

I have case where I need to click on a print icon in an application and that pops up a print window in Chrome.
I would like to confirm that his occured.
I have the following code
Scenario:
Given driver 'appURL'
* waitFor('#printIcon')
And click('#printIcon')
Then match text('.action-button') contains 'Save'
However it doesn't take the print page elements and I get a failure.
Is there a way to switch to the print modal?
Thank you,
Yes, the print dialog may be OS specific, which means it is not controllable by the test-automation. Sorry, this is a case where I'd like the community to do the research and figure out what the options are.
Note that you can do some research into Karate Robot if that helps :)

How to open a new browser tab or window and perform operations on that newly opened page using Robot Framework?

I am trying to do a simple Robot-test to demonstrate opening multiple tabs or browser windows with Robot Framework. After getting this simple example to work I could use this code to open multible tabs or windows on longer tests.
The idea is this:
Browser is opened to www.google.com and Text1 is inputted to google search-bar.
Then another tab (or window) is opened to google.com as well on this simple example as second page and Text2 is inputted instead there as text. Opening second instance of google page currently works but problem is that Text2 gets inputted to original page's search bar and not in the newly opened one. Both tab or window would be good options to use later I think but problem now is that inputting is done to original page after that second one is succesfully opened. I think that new window or tab should be selected somehow and not sure if JavaScript is correct way to open that second one as I have done here?
My current robot code:
Library Selenium2Library
*** Test Cases ***
multipletabstest
Open Browser http://www.google.com Chrome
Input Text xpath://input[#name="q"] Text
Comment Open second google-tab
Execute Javascript window.open('https://www.google.com');
Input Text xpath://input[#name="q"] Text2
I think I actually tried calling Open browser yesterday but somehow did not get it to work with that text inputting behaviour as expected. Now that I tested it again (replacing JavaScript line with Open Browser) that worked so thanks! Before logging in here I came with another solution. That code is longer but I think I currenty prefer how this opens new tabs with Chrome (although code for example window.open() refers to windows) to the top of browser. With Firefox this seems to open as new windows. Both are usable for me though as main idea would be to be able to open multiple instances of same page and I think there could be many solutions. This is probably kind of over commented but comments are here just for clarification what this solution does. I found a base for this on SeleniumLibrary documentation page. There was different sites used for each window but I tested this with multiple google pages.
*** Settings ***
Library Selenium2Library
*** Test Cases ***
multipletabstest
Comment Open first google window
Open Browser https://www.google.com Chrome
Input Text xpath://input[#name="q"] Text to first window
Comment Open second window
Execute Javascript window.open('https://www.google.com')
Comment Change to new window
Switch Window locator=NEW
Comment Input text to second window
Input Text xpath://input[#name="q"] Text to second window
Comment Open third window
Execute Javascript window.open('https://www.google.com')
Comment Change to new window
Switch Window locator=NEW
Comment Input text to third window
Input Text xpath://input[#name="q"] Text to third window
It's better to use FOR loop;
*** Variables ***
${url} https://www.google.com
${search} xpath://input[#name="q"]
*** Tasks ***
Multiple windows TEST
${urls_list}= Create List ${url} ${url}
FOR ${url} IN #{urls_list}
Open Browser ${url}
Input Text ${search} Text
END

Keep RStudio focussed on 'Source' and 'Plots' when executing code line-by-line

For a presentation, I want to run through an R script line-by-line (with RStudio). I use the CTRL + ENTER command. Throughout the presentation, I only want to show two panes: the 'Source' pane and the 'Plots' pane.
I can prearrange that view with the 'pane' tab in RStudio's top ribbon and with minimising some of the panes. However, when I run the first line, the 'Console' window pops up again.
How can I suppress this behavior?
My suggestion would not be to minimise the console window, but to make it small enough that it is irrelevant.
A second option would be that you can "pop-out"the source by dragging the tab out of the source window (not sure of shortcut for this). From here you can move around to have the source in the popped out window alongside a plots panel. The source would be on top of the console

Qt: Print entire WebPage with Preview Dialog

So, I'm trying to print a QWebEngineView entirely, but give a Preview Dialog, such as QPrintPreviewDialog would be sufficient.
First try was something along these lines:
self.loader = QWebEngineView()
[...]
dialog = QPrintPreviewDialog()
dialog.paintRequested.connect(self.loader.page().print)
dialog.show()
self.loader is also used as the actual view rendered to screen. In this setup I get one page sent to the preview and that is the current view in the window. But not the entire document, which is what I want.
I can simply call self.loader.page().print(), which works (prints everything) but gives me no preview option.
I then tried to be smart by using
self.loader.page().runJavaScript("window.print();")
But that doesn't appear to trigger any reaction whatsoever.
So, how do I get an entire WebView printed with a preview dialog beforehand?
In this case PyQt5/PySide2 would be preferred, but I can understand a regular Qt Solution just fine too.

Not able to handle iframe and new window activity

I am not able to handle Iframe popups. In my application when i click on some buttons or link then open iframe pop up. activity which i do on that iframe popup is not recorded in selenium IDE.
select window command also not work.
When i click on link then it open in second window with same title. i am not able to handle that new window's activity.
Please provide me solution if any have.
You need to use the command Select Frame and not Select Window.

Resources