Detect Edge browser using java - java

I want to detect Edge browser(windows 10) using UserAgentFamily enum class(package net.sf.uadetector). There is no option related to Edge broswer.
Such as UserAgentFamily.IE and UserAgentFamily. SAFARI for detecting IE and safari browser. How will I detect edge broswer using UserFamily.

Use another library that has the features you want. For example, user-agent-utils.
If you really want to use the library you are using now, you can try to build a newer version, but it seems it has some bugs relating Edge

Related

Edge chromium headless mode using java and selenium 3

I am unable to launch the Edge Chromium in headless mode using the Java and Selenium 3 (3.141.59). I am aware that selenium 3 does not possess much capabilities with current stable version but we don't want to invest in Alpha version of Selenium.
Selenium 4 is not backward compatible, moving to Selenium 4 means making a lot of changes and removing lot of legacy code.
With that said, my question is, is there any solution to handle this problem ?
I found that you can launch the Edge Chromium browser in headless mode with Selenium 3 but you need to add a reference to the Selenium Tools for Microsoft Edge package
I found examples to reference the Selenium Tools for Microsoft Edge package in .Net, Python, and JS.
Use Selenium 3
Unfortunately, I did not get any way to add a reference to the Selenium Tools for Microsoft Edge package in JAVA.
So for the JAVA project, you still need to use Selenium 4 Alpha version.

Not able launch multiple edge browser/instance in Selenium? Selenium allows only single instance for edge?

Not able to launch multiple edge browser in selenium. I want to open second instance once I have done actions required in first application and cross check the same in another application without closing the first instance.
This is a known limitation of the driver for EdgeHTML-based versions of Microsoft Edge. It is not a problem with Selenium per se, but one with the driver, which is created an maintained by Microsoft. Criticism, complaints, and bug reports should be directed there. Having said that, note that the driver for Chromium-based Edge, now in beta, do not have this limitation.
This is a known issue, at the moment you can only run 1 instance of Microsoft Edge. That is a limitation of MicrosoftWebDriver. You could feedback this issue at the bottom of this site and create a pull request on github about this issue.

Finding Elements in a Redrawn DOM

We have a website which has a wijmo grid in it. I am attempting to test this website. In IE the grid is drawn, yet when I go into the "Developer Tools", the grid is not actually there. This makes running Selenium tests very difficult as Selenium cannot find it either.
Has anyone run into this before? If so, how do I successfully run my tests?
The grid will be part of the DOM and you should be able to select it successfully with the correct path using Selenium.
I believe it is the tools that are misleading and are simply not updating when the DOM changes.
I would try checking another browser, for example Google Chrome (F12 in Windows). In my experience the IE Developer Tools are not as powerful or feature rich as the Chrome tools. The Chrome tools do update the DOM when elements are manipulated.
It looks like it is working now. The Developer had a pre-loader which was causing the problem. Once that was disabled it is now able to find the elements.

How can I detect if java is installed or not and knowing its version, without using java applet to check and without using javascript?

Is that possible?
before entering a site, it should check whether java is installed and it has to be of a specific version before redirecting to the designated page.
javascript cannot be used because it can be turned off by the user.
java applet cannot be used to check as it can disabled by the user
thank you.
I think it is naive to assume that someone would have JS disabled but Java installed & enabled.
JS comes with the browser, but Java does not.
JS is enabled by default, and has to be explicitly disabled.
Many sites today either rely on JS, or give a much slicker user experience when JS is enabled.
The deployJava.js
is the latest strategy offered by Sun/Oracle for checking that a browser has a
specified minimum version of Java before running an applet or including a launch link for JWS
applications. If 90% of deployers of applets in the last 2-3 years use the script, what do you think the
chances are of seeing Java installed and enabled in those browsers where JS is disabled?
Sun's former way of ensuring an applet had a necessary version of the plug-in was using
HTMLConverter, which produced the nested OBJECT/EMBED element so hated by validation services
(and any self respecting web developer). This invalid HTML used no JS or Java to do what it did,
it all relied on HTML & the browser/user's ability and willingness to act on the said elements.
However I do not recommend using that approach, I think deployJava.js is a better way to achieve it.
If you are truly insistent on making every attempt to determine the user's Java, and do not mind
'breaking the back button', there are other techniques that can be used. E.G. have a series of pages.
The first page has a meta-refresh redirect to nojs.html set at NN seconds and uses JS to redirect to
hasjs.html immediately.
The hasjs.html tests for Java:
Detect if Java is enabled
Check Java version using something along the lines of javascript:alert(java.lang.System.getProperty('java.version')). It works in the address
bar of FF to pop a dialog that reports 1.6.0_24 on this box.
(Finally) to determine that the applet itself is active (as opposed to crashed/refused at run-time),
see Detect if an Applet is ready.
So as can be seen, JS will not only be able to check if Java is enabled, but can also check the version & that any specific applet has loaded successfully.
You can prompt the user to input which version of Java they have installed. Otherwise, no.
Well, without using Java Applet and without using JavaScript. What else can you use? You are trying to access client specific data, you can't grab such data in the server side.
Rewrite your application in .NET, and then you can enjoy User-Agent lines like this:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
.NET CLR 1.1.4322; .NET CLR 2.0.50727)2011-04-27 23:02:21
I wish browsers were sending same stuff for installed Java... alas, they don't.

develop a user defined plugin for web browser

How to develop a user defined plugin for a web browser.
It should features:
It should be installed in any browsers.
It should be executed whenever the browser starts.
It should monitor the web page and access the web page that the browser displays.
It should monitor and access the web page (for example, getting a value from a text box) irrespective of the web page the browser displays. (The web page can be of any URL either google or any domain)
How to start with it? It would be helpful if there is some sample. Thanks in advance
For Firefox < 4 write an Addon, for 4 and above Jetpack will be the way to go. For Chrome write a Extension. Opera, well wait till 11.5 ships. Safari 5. IE.
Read the documentation for each browser.
Hm...
I hope you tell the user about that.
Right now it reads like you want to deploy something to a PC and monitor all browsers, well if you want to do that you'll have to put some effort into it.
I don't think 1. is possible, you will have to create multiple versions of your plugin in order to work with each browser.
There is not a single example, because as I mentioned, you are going to have to do something different. You will need to determine and target specific browsers. I would suggest starting with one and once you have it have it working move to the next browser.
Do you mean a Plugin (like Flash, PDF Reader) or and Extension?
Plugins are native programs and extensions are normally coded in JavaScript & HTML.
Depending on what you want to do, an extension is enough powerful and the better choice.
There is no browser independent way to implement plugins. For each browsers you must read the interface reference. For example the reference for chrome: http://code.google.com/chrome/extensions/getstarted.html

Categories