I am automating one web application which contains very heavy javascript file. I am using PhantomJS and selenium webdriver with java for automation.
When the browser launch then on console a lot of errors shown for failure of javascripts used by that application.
And failure of these javascript impacts on the functionality of application.
Anyone faced this problem, give me some appropriate solution.
Related
I am trying to record JS page using jmeter but nothing is recorded. Please help me
Can Jmeter able to record JavaScript web page
JMeter can download the JS files as part of the requests but it wont execute it.
To make JMeter behave more like a browser that gets HTML, enable the Retrieve All Embedded Resources option in Advanced tab of HTTP Sampler.
JMeter can record browser network activity in terms of HTTP requests
If your JavaScript triggers network requests (you can double check it using "Network" tab of your browser developer tools) - JMeter should be able to record it, if it doesn't - it means that your JMeter and/or browser configuration is wrong. Double check all the parameters or consider switching to JMeter Chrome Extension
If your JavaScript doesn't generate any network calls you won't be able to test your application using JMeter's HTTP Request samplers, if you would like to do client-side performance testing: measure page rendering or scripts execution time - consider going for WebDriver Sampler which provides JMeter integration with Selenium browser automation framework
It's been noticed by all web extension developers that Firefox is going to stop SDK support (API that allows shell execution in client side) and will only accept web extensions.
Due to above-mentioned changes, I'm trying to get a shell command executed by javascript code in Firefox's web extensions' API.
I'm dealing with a web page that executes the web extension (I solved it by using javascript events), but the real trouble is that I need to execute a shell command in the javascript main code to open client programs such as LibreOffice or a background Java code and I don't know how to achieve it.
It's also necessary to execute these shell commands on Windows, OSX and Linux.
You can't directly run a shell command but native messaging lets you exchange messages with a specific native application that could launch other applications on your extension's behalf:
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging
I'm developing a PHP project which utilizes Javascript with jquery for a number of functions (particularly authentication/api calls). The long and short of my problem is that I cannot get Javascript console logs to appear in the eclipse console. At all.
Not only this, but some of my functions work...sometimes. I'm trying to debug the cause of this, but without any form of logging occurring, it's extremely difficult.
How do I configure my Eclipse Neon PHP project to output Javascript console logs?
Edit: The project is a PHP Web Application. I'm currently running a local PHP server for the project via the php command php -S localhost:8000
The JavaScript built-in function console.log(message); logs the given message to the console in the browser window, which is accessible via the developer tools of your browser.
If you open your webapp via the built-in Eclipse browser, you do not have access to those tools, just because Eclipse is using a closed, minified browser (just like the browser widget for QT or Visual C# WinForms or even a distributed Electron app).
Using the Eclipse browser is not really helpful when trying to debug webapps, because you can't even see loading times of the pages and so on.
I have designed a JavaFX application I would like to make accessible from my web server. It is coded in Java, uses JavaFX, and I have attempted to make it accessible here: bencitrin.com.
I tried embedding it into the homepage with the Java Development Toolkit. However, I get an error: "JavaFX Application could not launch due to system configuration."
I am unsure how to go about this--I have tried running it both unsigned and self-signed. Does it need to be "trusted"? The .jar works fine on my computer even though it is self-signed.
Thanks!
I heard one can load a custom Firefox profile when starting webdriver, but I've yet to find a way to do that. The Python binding documentation doesn't state it very clearly.
I need to start up Firefox without JS because the site I'm testing has a lot of ads injected by Google and some are very slow to load, making the tests slow as well because it waits for all the page objects to finish loading.
You can use the -firefoxProfileTemplate command line option when starting the Selenium server. But it seems rather counterproductive to disable javascript when testing how browsers behave on your site (unless your site doesn't have any scripts of its own) - you should rather use adblock, or disable the IP used by Google ads in the hosts file of the Selenium server, or set a custom useragent for Selenium tests and don't load ads based on that.