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
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
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.
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.
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.
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