Application in my project is very complex with number of backend systems and heavily written on javascript for frontend. Application works only in internet explorer and hence I am using InternetExplorerDriver.
I was successful in automating single browser window instance but when clicking some links which further opens new browser window where application is throwing "a javascript error occured"(error not with selenium). When I am doing the same flow manually by opening internet explorer and launching the application with URL then I am not seeing any error. I have tried all possible Desired Capabitilies and passed different values by trial and error method.
Also I have simulated mouse and keyboard events through Actions method when I am trying to click the link. None of them working for me.
So I am trying to understand is there any difference how selenium interacts with browser and how manually we interact with browser. Please help me on this one. Thanks in advance.
Related
I just want to see if anyone ran into the following scenario where we are facing couple of issues.
scenario:-
User clicks a button with in addin webapp, popup opens up with a predefined login flow, once login is completed, token returns back to addin webapp and remaining application flow continues.
Couple of issues we are facing are ...
If we dont set/use IE in protected mode, the app doesn't seem to return the control back to the addin. Without token, we can't let the user continue.
So if we use IE in protected mode, we are facing issues like
1. the web UI app calls with excel API doesn't seem to work properly. Especially, binding and events.
2. The internal calls from web UI to rest services doesnt work properly.
Just wondering if you guys have any input.
If you are using window.open directly to create a pop-up then the behavior you described is expected; that is how IE behaves with different integrity level (which is essentially what happens when 2 sites are in different security zones).
If you are using the Dialog API to create a dialog, for rich clients, like Excel for Windows Desktop, then you should not experience this issue as the process that we create is on the same integrity level as the parent (usually a taskpane). So give that a go.
I have a web application which runs on all browsers but there is a link to another application which can only run in Internet Explorer. How I can force browser to open this link in a new IE browser when my application running in other browsers such as chrome? Should this piece of code written in server side or client side?
You can't force the client to launch a different browser like you're asking.
What I would suggest is to have your application test when it is launched to see if it is currently running in IE. If it isn't, it should issue an error message stating something like: "This application requires Internet Explorer. Please reopen in IE." Then have it stop there.
Most probably, using resources of JavaScript and HTML5, you cannot run applications on end user's computer. Moreover, it sounds incorrect in terms of security and usability.
The best thing you can do is to write a message like "Open this link in IE" near your link.
At the final page, you can detect a user's browser and, in case it is not an IE, show him a message "Unfortunately, this web-page works only with IE. Please, open it in IE".
By the way, could you tell us, why your page is not working in other browsers? Probably, we will find a proper answer there.
i have self-hosted ASP.NET web service and small HTML5 application that communicates with that service
when i try open this page in IE, browser show me notification that it has blocked ActiveX components and scripts. allowing browser to execute dynamic components, HTML/JS code working fine - queries reaches web-service, it generate needed data, send data that page needs
but when i open page in another browsers (Chrome, FF, etc), page does not reacts to the any data that server sends as callback. queries reaches web-service but all communication with page and host is stopping
all JS-libraries that i connect to page: 'jquery-2.1.0.min' and my own 'common.js'
so, how i can determine, what element is not working correctly in not-IE?
Here are some things you can try to avoid these kinds of issues:
Use jQuery 1.11.1 instead of jQuery 2.1.0 to improve compatibility between browsers.
In Chrome, right click anywhere on the page and select Inspect element. You should see a debug window open at the bottom half of the page. Navigate to the Console tab in this window to see any JavaScript errors.
In Firefox, install the Firebug add-in and use that to debug.
Make sure that you are not using any ActiveX. That is only compatible with IE.
You can use sites such as browsershots.org to test browser compatibility
Don't use browser / platform specific technologies such as Flash, Silverlight etc.
I am working on JSF with primefaces, i have been assigned a task to notify the browser when new message arrived in client desktop, its like Message alert.
I found some concepts p:poll, and p:notificationBar, p:growl but those are happeniing inside the browser window itself, when browser is minimized the user can't get notify the new message arrival.
My question is:
Is it possible to do it in JSF with the help of Javascript?
I don't know whether it is possible to notify to the client?
How can i enable notifications for window minimised state as well?
You can make the title bar flash and on some platforms, even get the user's attention.
Make browser window blink in task Bar
Possible to flash a Browser window using Javascript?
This question shows part of your possible answer.
You should then use a to watch for the notification change. You could use the push framework, but that could be a bit of overkill on the network / connectivity side.
There are some solutions that work for only specific browsers. If you are doing this for your company intranet environment and everyone uses chrome or IE, there might be better solutions. Nonetheless, you should strive to do something that works on all compliant browsers (w3c compliant, that is).
There are some boundaries you should observe, regarding web apps in browser windows and what is the expected behavior. The user expects a minimized / offline browser window to sit quiet. If you are in a corporate environment, this could be waived, but for an app for the general public on the web, some people could (I would) be annoyed by this attention-seeking behavior (on a browser game, for example).
I'm trying to click on a javascript button in this site(its the search button on the left):
http://www.amadeusepower.com/trek/portals/trek/default.aspx?Culture=en-US
I couldn't find a way to click on it using htmlunit. Now I am thinking of switching to selenium but there is a problem. My application should fill the forms and get the results from the site and parse them to get some data from the results page and send it to an android device. It will need to run one instance for each android device connected to it so if I use selenium it probably will pop up a new window for each user and that may complicate things. I want to use a headless browser but as I said htmlunit has an issue which I asked in here How to click on a javascript button in htmlunit
Does anyone know a way to run selenium as a headless browser on windows or can you suggest another tool I can use in eclipse in windows for this purpose?
You can use phantomjs. It is a complete webkit based headless browser that has builtin webdriver support.