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.
Related
I want to create an electron application which contains a sidebar and a improvised Web browser next to the sidebar. When a user presses the button in the sidebar i need selenium to start Interacting with the webpage in the improvised browser.
I would like to know if its possible and if there are any tools that might help me.
Selenium is using browser's driver to make the connection between your code and the browser. I haven't heard about anything similar to your project, but you will need to make your own driver for your custom browser and define from where the browser is opened (since it will be located inside your application, not on local machine)
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.
I'm trying to install a google chrome extension on a large amount of my desktop computers using python. I've gotten Selenium to open a simulated browser with the extension, but that doesn't actually download it to the computer, so that doesn't necessarily help. My current code is
import webbrowser
webbrowser.open_new_tab(
"https://panelresearch.google.com/browser/extension/download")
This just opens the page where I can find the extension, can anyone show me a library where I can click buttons that are on this page?
Additionally, I'll need to identify the extension popup and I realized that I cannot inspect any elements in that popup.
As far as I know, there is no way of operating the extension popup using any API other than simulating the clicking on OS level.
When you're testing an extension using Selenium, you have to specify a custom profile as an argument during the start of the process connected to the WebDriver. More info here or use a special ChromeDriver API.
If you just want to force install an extension in an enterprise/educational environment, you can follow this guide.
You can also edit already existing profiles (to some extend and in my experience unreliably) by editing the Preferences file in the profile directory. Just make sure you have backups and an instance of Chrome is not running with that profile.
Good luck.
Hello I am new to Weinre and I need to debug my website which seems to act strange when opened using an IOS platform.
So I am using Weinre to debug it. I installed the tool and tested it running with the demo targets in the server itself.
Now I need to add my website as a target and run it with an iphon (or ipad) and debug it with Weinre. I don't know how to add my website as a target, I cannot manually add the
<script src="http://123.456.7.89:8080/target/target-script-min.js#anonymous"></script>
script (do not have permission to manually change the page). so How can I do my debugging with Weinre?
Thanks
You can try using a bookmarklet. The main weinre server page actually has a bookmarklet in it, for itself, that you should be able to use directly, if you can figure out how to set up a bookmarklet for your device. This seems to change release-release for mobile browsers, so you might want to do a google search on "bookmarklet" and your device's name or the OS release, to see if anyone has any tips.
I have seen several posts that talk about remote debugging of javascript code on Android, but they all miss the point of what I am trying to do.
I have a Nexus 7 and I want to use it as a remote development environment when I am away from my desktop. I have created a chrooted debian distribution to run apache and php and git (via ssh). This chrooted environment mounts a subdirectory of the /sdcard directory from outside the chroot environement. Apache document root of a virtual host is pointing at a directory within this. Before leaving the desktop I can git push the latest release to the tablet. When I return git pull can get what I have done back again.
I then (when away from home and NOT connected to any network) can edit the code using an Android editor (using the 920 text editor), but then run the browser to look at what I have developed using localhost the apache virtual host picks this up and displays it.
The application I am developing IS NOT FOR ANDROID - it is ultimately for the desktop. But I want to be able to debug it like I was on the desktop. Breakpoints and single stepping are the prime thing, but also I tend to use the html section in firebug to adjust my CSS before editing it.
Is there a way to get either the chrome developer tools or firebug add on for firefox to load into a browser that will run in android?
I use Firebug lite bookmarklet for iPhone and iPad, never tried on Android, check this out http://martinkool.com/post/13629963755/firebug-on-ipad-and-iphone it must be similar on Android.
To activate it use this steps:
Create a new bookmark or bookmark a page
Rename the bookmark to “Firebug”
Copy the textarea link:
javascript:(function(F,i,r,e,b,u,g,L,I,T,E){if(F.getElementById(b))return;E=F[i+'NS']&&F.documentElement.namespaceURI;E=E?Fi+'NS':Fi;Er;Er;Er;(Fe[0]||Fe[0]).appendChild(E);E=new%20Image;Er;})(document,'createElement','setAttribute','getElementsByTagName','FirebugLite','4','firebug-lite.js','releases/lite/latest/skin/xp/sprite.png','https://getfirebug.com/','#startOpened');
Edit the Firebug bookmarklet, remove the URL and paste the
bookmarklet
Choose “Done” (on the virtual keyboard) and you’re all set
Hitting that bookmarklet should give you a fully functioning Firebug at the bottom of your mobile device.
At least not for Firefox Mobile, because all the devtools are still partially based on XUL, where the Firefox Mobile is using Native UI.
I don't think there is any plan in the close future to change this situation; it's not a common scenario.
However, you should be able to do something using the Debugger API, creating an add-on for Firefox Mobile. But I don't know if it's worthy.