How do I get my Selenium Grid Hub log - selenium-webdriver

I have a selenium grid2 set up on an AWS instance, and I was wondering if there's a way I could view the logs on my local machine?
I understand I can visit: http://MyServerAddress/grid/console and view all of the nodes but I want the actual log.
Its a bit of a pain having to remote desktop to the server each time I want to view it.
I was thinking something like http://MyServerAddress/grid/log but alas, it doesnt seem to be an option.

There's nothing available out of the box. But you can build this on your own.
You would first need to enable logging for your Grid and have the logs dumped to a specific folder.
You would now need to build a custom Servlet and inject it into the servlet (See here for details on how to do it )
Assuming that your servlet is called "HubLogServlet", you should be able to access it via the link http://localhost:4444/grid/admin/HubLogServlet
You can refer to this LogServlet for a sample.

Related

Can synchronised browser testing be achieved when the user script (Tampermonkey) is developed locally?

I am developing a user script (Tampermonkey) locally. When the local JS changes, I want to automatically refresh the target URL of the user script instead of a local HTML file.
How can this be achieved? I checked every command and configuration information, but did not find a solution, so I came to ask for help.
The method of developing UserScript locally is seen here. The answerer mentioned that browser-sync can be used, but I did not find a way to achieve it.
livereload can solve this problem very well, because livereload is implemented through browser extensions and local programs. When the file changes, the target URL can be refreshed immediately.
http://livereload.com/
https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei/related

How to migrate an online angular script to local server?

Hi I'm trying to make an offline version of this page:
https://u-he.com/tools/microtuning/ the script is writtin with Angular JS how do I do that?
I saved the page control-s and copied the file to the local server I'm running.
And then I browsed the local ip. the page opened but I get repeated notes ng-repeat shows up as multiple boxes instead of 1 box that edits the same note but in different octaves.
How do I solve this problem please.
You can inspect the front-end code in your browser console. In Firefox it's in the section called "Debugger", in Chrome it's called "Sources". If you use Safari, you need to enable Developer mode first.
Once you have the appropriate view, just click on u-he.com -> tools/microtuning/ -> index
Hopefully it goes without saying that you shouldn't use large swaths of another person's code without at least giving appropriate credit, or better yet getting the developer's permission, unless there is an explicit open-source license.

How do I make selenium see the network requests made by a web browser?

I have a dotnet Selenium web driver app.
When I'm testing the page one of the things I need to confirm is that a flash object on the page has pulled correct content from a content store on my site. (i.e. the flash object should be loading content from /stuff/info.txt and including that content within the animation.)
As a human looking at this I can use the chrome network tab and see that /stuff/info.txt has been accessed.
How can I make Selenium execute a similar watch and see the network requests made by a web browser?
I did not wrote this, neither tested it however someone did it here: http://www.softwareishard.com/blog/firebug/automate-page-load-performance-testing-with-firebug-and-selenium/
Basically all the requests are exported via netexport and firebug plugins inside a HAR (Http ARchive file)
Please give us your feedback if you give it a try!
Cheers !
I assume you want to automate the process which the developer tools of browsers does. Something like firebug but for verification using Code.
I don't believe Selenium has such features. For now, you will not be able to achieve this.

IntelliJ automatic updating of jsp files in GAE module stops working with server parameters --address=0.0.0.0

I have a GAE module on IntelliJ and when I after I edit the jsp files in it I can just go to the web browser, hit refresh and the changes show up. The other day I needed to access this from a different computer so I added --address=0.0.0.0 to the server parameters and after that changes to the jsp stopped showing up on the browser until I did a server restart. I removed the option and it started working again. Added it again and it stopped working, repeated several times, always the same result.
So how I can access the server from another computer yet have the ability to make changes and have those changes show up on the web browser without a server restart?
I am using an exploded war, and I have "update classes and resources" on both "on update" and "on frame deactivation".
This is with IntelliJ 13 on OSX 10.9
Thanks.
There are two ways to make iDEA update the runtime project:
Automatic via on frame deactivation, which means that IDEA updates project when you switch to another app (usually browser), i.e. when IDEA looses window focus. This works "automagically" while you test on the same computer, because you usually switch between IDEA and browser (or mobile emulator).
Manually via on update, which requires you to manually click the update button (the green circular arrows) in IDEA inside the running project pane.

How to load a part of application before loading rest of the application in angularjs?

I could not think of a better title, Please suggest one.
I am planning to work on a large web application. It will take time to load the full application before application starts functioning.
Suppose its something like asana.com. If you have a link to the task and you open the link. It loads the application first and then shows the detail of the task.
Note: I have added another example in update 2
I want to do just the opposite. Suppose if I try to open the link directly. It should show me the tasks details first and then load the whole application in background.
What development strategy should I follow to implement such feature. Will angular be good for this? I have worked with angular for small projects and am capable of think in angular :)
I just wanted to be pointed in right direction.
Update 1:
I am using Apache2 PHP5 in backing as ReST API. I am thinking to change to GoLang http server. But that does not matter in this context :)
Update 2:
I have not yet started working on the application, but I know that its size is going to be big and its going to take time to load the application. This will be a javascript application, all the communication to web will be done mostly by API. APIs will be fast and it wont be slowing down the application. My main concern is the javascript library and the approach to the issue that I want to display the content of the page before the application is loaded and load the application in background.
As second example: https://chrome.google.com/webstore/detail/a-journey-through-middle/gjgkjeheegjnnmheaflhdocglkiegoni?utm_source=chrome-ntp-icon
If you open this link in chrome, it will load the application and then load the specific content in a popup. I want to load the content of the popup first and then load the application in background. How should I write my application to achieve that.
My suggestion (and I say this as I start to do similar vs. having proven it successful) would be to make some level of framework fairly static so that users get an almost instant response to the site loaded and then start the angular app with something like this
angular.bootstrap(document.getElementById("container"), ["app"])
Ref for the api - https://docs.angularjs.org/api/ng/function/angular.bootstrap
Ref for a demonstration of this - https://egghead.io/lessons/angularjs-angular-bootstrap-app-init
My expectation then is that you will be able to
Load your static elements quickly (which will just have placeholders for your content/material)
Access the data you want in the order you want to get it to present on the screen
Release any other part of the app you need to chrome it up/decorate or populate side items.

Resources