IWebDriver opens two new windows instead of one in c# - webdriver

When I click on a link in an application manually it only opens one new window but with IWebDriver it opens two new windows.
IWebElemnet element = WebDriverActions.Driver.FindElement(By.Id(controlId));
element.Click();

Related

Can't create new project in QT Design Studio because of the extra large size of "Create New Project" dialogue Box. And also can not resize it

I want to create a new project in the QT design studio. But whenever I click on the "create new project" button it opens an extra-large "New Project" titled dialogue box. Because of this, I can't reach the "Create" button, nor can I resize it.
How can I resize the window or reach the "create" button otherwise?
You could try using some Win key combinations to rearrange your window.
Windows Support

JXBrowser - Any way to right click + inspect or dev tools?

I am asking because if you are coding and testing against JX generated browser, and say you want to inspect elements to add to the code, or inspect a button to see a link, you shouldn't have to open up another browser, follow the same clicks to do that.
Is there a way to enable a full browser window? Including all functionalities of a normal browser? Address field and so on??
Browser browser = jx.browser;
BrowserView browserView = new BrowserView(browser);
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.add(browserView, BorderLayout.CENTER);
frame.setSize(1024, 768);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
browser.loadUrl("http://www.google.com");
If you would like to inspect HTML elements on the loaded web page anytime, then I recommend that you run your application with the --remote-debugging-port Chromium switcher every time. You can read more about this switcher at https://jxbrowser.support.teamdev.com/support/solutions/articles/9000013082-remote-debugging-port
JxBrowser doesn't provide "full" browser window with tabs, address bar, etc. JxBrowser is just a component/library, not an entire desktop application. Using this library you can build your entire desktop application with tabs, address bar, etc.

javafx: How to get back to original application window without closing the new window?

Apologies for asking such a simple question but english is not my first language, so I cannot find the right word to describe my problem and cannot google up the the right question.
I have a javafx application and there is a button whereby if the user clicks it, it generates a new window (like a display box just to display more info to a user). The problem is when the new window is displayed and I click anywhere of the Javafx application, I cannot get back to it. I have to close the new window first in order to interact with the original javafx application.
How can I have the ability to open the new window on a button click, while retaining the ability to interact the original javafx application without having to close the new window ?
Button moreInfo = new Button("More Info");
moreInfo.setOnAction(e -> {
MoreInfoDisplayBox.display();
});
public class MoreInfoDisplayBox {
public static void display(){
Stage window = new Stage();
window.initModality(Modality.APPLICATION_MODAL);
window.setTitle("More Info");
window.setMinWidth(400);
window.setMinHeight(400);
window.show();
}
}
The behavior you describe is caused by calling
window.initModality(Modality.APPLICATION_MODAL);
(See docs.)
Instead, just use the default, which you can do explicitly with
window.initModality(Modality.NONE);
or of course just omit that line entirely.

Is it possible to use context menu with QSystemTrayIcon under Windows Mobile/CE?

I created tray icon with context menu and attached its activated signal to slot in my dialog:
trayIconMenu = new QMenu(this);
trayIconMenu->addAction(showAction);
trayIconMenu->addAction(quitAction);
trayIcon = new QSystemTrayIcon(this);
trayIcon->setContextMenu(trayIconMenu);
trayIcon->setIcon(QIcon(":/images/gear.png"));
trayIcon->show();
trayIcon->showMessage(tr("SSTRNL-B"),tr("Message from tray icon!"));
QObject::connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(trayactivated(QSystemTrayIcon::ActivationReason)));
My slot is called when I click on tray icon. So everything is going right except I can not see context menu attached to QSystemTrayIcon.
In desktop systems we can use right-click on tray icon to see its context menu. But what am I supposed to do in Windows mobile/CE to see context menu?
Check whether QSystemTrayIcon::ActivationReason==QSystemTrayIcon::Context in your SLOT. May be as you are using mobile App, click pattern for contextmenu might be different from General OS.
Ok if it is QSystemTrayIcon::Trigger, call trayIcon->contextMenu()->popup(QPoint&) in your SLOT, where QPoint is location of trayIcon.That would do.

Launching new form by a button click in qt gui application?

I am trying upon some simple applications. I would like to know how to launch a new form by clicking a button from main window. Please explain this to me with a simple example.
QT already comes with a simple example on how to create and show different types of windows and dialogs. Take a look here: Window Flags Example
Also if you already have a main widow in your application, you can take a look how it's shown (main function in your main.cpp) for your project and use the same technique:
MainWindowTest *testWindow = new MainWindowTest();
testWindow->show();
If you need to show a modal dialog, use your dialog's exec() method:
Dialog *dialog = new Dialog();
dialog->exec();
hope this helps, regards

Resources