Is it possible to embed a Java app that has Selenium code lines into a web browser? Is this supported or not?
I have a Java application that uses Selenium API. I tried to use the init() method to embed the GUI window into a browser so that the application could be launched from a website, however it did not work. Is it supposed to be this way?
Technically you can because the selenium java client is just an java app that interacts with selenium grid in JsonWire protocol.
Take a look at this question Run selenium webdrivers from applet in HTML
No it does not. You cannot launch such an app from a web browser
Related
I am writing a java application which has one use: to fill out and submit a form on a webpage (without showing GUI of a browser). I have chosen Selenium for this.
However, how do I "pack" or "ship" Seleniums required browsers with my application? I.e. Selenium requires a browser executable to run the webdriver. I do not know which browser my target audience is using. How do I ship my application to run on any windows clients computer, without requiring them to manually install the browser?
Or am I on the wrong trail and there is a better option than selenium to fulfill my needs?
I have created a Swing application in Netbeans that is basically a chat system (between multiple clients and server using socket programming).
Now I wanted to run this application on a webpage. Is this possible without changing any code?
Now I wanted to run this application on a webpage. Is this possible without changing any code?
No. It would have to be a JApplet to be embedded in a web page, and applets have been effectively killed off. See Java Plugin support deprecated and Moving to a Plugin-Free Web.
On the other hand, a desktop application (based on a JFrame) can be launched from a link on a web page using Java Web Start.
Edit
Scrap that advice regarding JWS, apparently it too is being deprecated as of Java 9.
I have to automate a JWS application (with *.jnlp extension) . We cannot automate the same using selenium as it is an windows type application. I also tried with AutoIt but it is not able to capture element properties using the same.
Could anyone please help how can I automate this application .I am trying to automate JWS application for the first time.
QTP and TestComplete are very good to automate Java desktop applications. I am using QTP currently to automate Calypso (a java application) and it works perfectly. I've used TestComplete previously to automate similar Java desktop application. They both are paid software, but well worth it if you want to automate complex applications.
Swing applications can be automated using [SWTBot][1]. Its an open source alternative to automate swing applications. This requires understanding of Swing framework and controls.
[1]: http://www.eclipse.org/swtbot/
EDIT: Maybe any of this can help for testing swing applications: Automated tests for Java Swing GUIs
I had created a java application for selenium webdriver.
FirefoxDriver driverff= new FirefoxDriver();
used to create a new Firefox instance.
This is working fine.
I want to create a java web application to do the same.
I have embeded the same code in the servlet class in the doget() method and it throws
java.lang.NoClassDefFoundError: org/openqa/selenium/firefox/FirefoxDriver
Can someone tell me how i can fix this?
From an end to end perspective, what oi want to achieve is that a web page (done using servlets) has some buttons which when clicked need to open a selenium web driver and run the selenium scripts. I am assuming the java application for web-driver can be called using servlet.
If there is some other alternative to achieve this, please do suggest.
The error message means that Java can't find the class in question. Make sure it's on the classpath of your web app.
That said, you may run into problems later: Linux web servers often don't have an attached display so no X server is running. That will make it hard to start a browser :-) If that's the case for you, look up Google for "selenium xvnc" or "selenium headless"
I'm stuck with this issue.
What I want is to Iframe a webpage using iframe tag and url in java application with netbeans.
so it's kind of like a browser but without and toolbar.
please help with simple code.
You can use the DJ project's JWebBrowser, which embeds the native browser in your java app. If you want a pure java solution check out the Lobo Browser. AFAIK The rendering of Lobo is not perfect(Still doesnt support CSS2 completely). As for sample code you can get full functional demos in both projects.