Giter Club home page Giter Club logo

jserrorcollector's People

Contributors

dependabot[bot] avatar gregory144 avatar lcmtwn avatar mguillem avatar tporeba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jserrorcollector's Issues

Oldest FireFox

What is the oldest version of FireFox that this tool (JSErrorCollector) will work with?

Michael

Capturing warnings!

Excellent!
however does it support capturing warnings? I did try but it didn’t find any. Kindly please update.

Store URL information in JavaScriptError class

Thank you for the great API. Not long ago I've started use it and found several js-errors with it. When I wrote bug-reports about found errors I realized that it's not always obvious to find the page on which the js-error occured if we read errors after visit more than one page. Therefore it would be great if JavaScriptError class collects not only errorMessage, sourceName and lineNumber but also URL of the page with an error too.

JavaScriptError.readErrors(driver) always fails

I'm using WebDriver to start Firefox.
Then I use SikuliX to send keystrokes and mouse clicks.
After, I try to collect all errors by using:

JavaScriptError.readErrors(driver)

The result is always:

NoSuchWindowException Browsing context has been discarded

even though I haven't called driver.close().
How can I capture errors?

More info:

Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 66.0.5, 
javascriptEnabled: true, moz:accessibilityChecks: false, moz:geckodriverVersion: 0.24.0, 
moz:headless: false, moz:processID: 2248, moz:profile: /tmp/rust_mozprofile.4rGV9F..., 
moz:shutdownTimeout: 60000, moz:useNonSpecCompliantPointerOrigin: false, 
moz:webdriverClick: true, pageLoadStrategy: normal, platform: LINUX, 
platformName: LINUX, platformVersion: 3.10.0-862.14.4.el7.x86_64, rotatable: false, 
setWindowRect: true, strictFileInteractability: false, 
timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, 
unhandledPromptBehavior: dismiss and notify}

Versions:

  • CentOS 7
  • Firefox 66.0.5
  • Java WebDriver 3.141.59
  • Java 8
  • JSErrorCollector 0.5-atlassian-2

This trace could provide a hint of what is going on:

File /tmp/rust_mozprofile.QWClT5upzfGf/extensions/[email protected] does not contain a valid manifest(resource://gre/modules/addons/XPIInstall.jsm:557:11) JS Stack trace: [email protected]:557:11
[email protected]:186:3
[email protected]:620:10
[email protected]:2340:21
[email protected]:2700:21
[email protected]:2570:34
[email protected]:2148:25
[email protected]:203:12
[email protected]:652:5
[email protected]:805:9
[email protected]:2775:5
[email protected]:66:9

Getting all errors on console

Is there anyway such that I can get all the console error logs (not only javascript) using this , maybe be tweaking this source code?

JSErrorCollector seems broken with FF19 / Selenium 2.31.0

When I try to set up to use JSErrorCollector with a JavaScriptError.addExtension(profile) call, WebDriver hangs creating the driver with a stack like this:

Thread main
Thread.sleep(long) line: not available [native method]
NewProfileExtensionConnection.start() line: 111
FirefoxDriver.startClient() line: 244
FirefoxDriver(RemoteWebDriver).(CommandExecutor, Capabilities, Capabilities) line: 110
FirefoxDriver.(FirefoxBinary, FirefoxProfile, Capabilities, Capabilities) line: 188
FirefoxDriver.(FirefoxBinary, FirefoxProfile, Capabilities) line: 183
FirefoxDriver.(Capabilities) line: 100

When moving to a different page intermittent "window.JSErrorCollector_errors is undefined" exception

To reproduce:

  • Add the extension to the FF profile and get a driver with that profile (as shown on the sample code)
  • Perform an event that will move to a different page (click a button in my case)
  • Call JavaScriptError.readErrors(driver);

Notice that you'll start getting "window.JSErrorCollector_errors is undefined" exception intermittently.
I was able to get around this issue by sleeping for 100ms before making the JavaScriptError.readErrors(driver) call. I also tried with 50ms but it I still got the exception sporadically.

Here is the stack trace that I see:
[ERROR][2011-11-04 13:28:53,360][c.s.s.c.xxx]- [assertNoJSErrors] Unexpected exception on assertNoJSErrors()
org.openqa.selenium.WebDriverException: window.JSErrorCollector_errors is undefined (WARNING: The server did not provide any stacktrace information); duration or timeout: 250 milliseconds
Build info: version: '2.8.0', revision: '14056', time: '2011-10-06 12:42:36'
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.6.0_26'
Driver info: driver.version: ReportingWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.6.0_26]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[na:1.6.0_26]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[na:1.6.0_26]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[na:1.6.0_26]
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:147) ~[selenium-java-2.8.0.jar:na]
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:113) ~[selenium-java-2.8.0.jar:na]
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:415) ~[selenium-java-2.8.0.jar:na]
at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:327) ~[selenium-java-2.8.0.jar:na]
at net.jsourcerer.webdriver.jserrorcollector.JavaScriptError.readErrors(JavaScriptError.java:95) ~[JSErrorCollector-0.1.jar:na]

Permission denied to access property "pump"

Hello ! Thanks for your API!
As I can see in source code you use window.JSErrorCollector_errors.pump() , but when the code try to execute this command we can see next error in console
Permission denied to access property "pump"
Can you help with it ?

Errors persisted across pages

Currently errors are captured and persisted across pages. This is impacting our implementation as, when we want to check if any errors are present on the current screen, we are also seeing errors from all the previous screens. This makes it impossible to determine whether it is the current page or a previous page that has errors.

Tool fails to catch jquery type errors

Tool fails to catch this error "TypeError: $(...) is null" on this page http://www.cnn.com/POLITICS/

As reported by FireBug.

I have two suspicions as to why this would be.

  1. This isn't really a "JavaScript" bug, but rather a jquery bug.
    or
  2. The error message occurs because the script was run before jquery was loaded. And firebug checks the script before rendering the page, while JSErrorCollector is checking afterwards.

JSErrorCollector is broken with webdriver 2.45.0 and Firefox 36

I get following error after updating to webdriver 2.45.0 and Firefox 36:

org.openqa.selenium.WebDriverException: Exposing privileged or cross-origin callable is prohibited
Command duration or timeout: 31 milliseconds
Build info: version: '2.45.0', revision: '5017cb8e7ca8e37638dc3091b2440b90a1d8686f', time: '2015-02-27 09:10:26'
System info: host: 'TPOREBA-W', ip: '10.10.8.47', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_10'
Session ID: c0dc3661-9622-47c9-88af-566e20a25e9a
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=WINDOWS, acceptSslCerts=true, javascriptEnabled=true, cssSelectorsEnabled=true, databaseEnabled=true, browserName=firefox, handlesAlerts=true, nativeEvents=false, webStorageEnabled=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=36.0}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:508)
at net.jsourcerer.webdriver.jserrorcollector.JavaScriptError.readErrors(JavaScriptError.java:135)

It seems new Firefox doesn't like the script from JavaScriptError.readErrors line 134:
return window.JSErrorCollector_errors ? window.JSErrorCollector_errors.pump() : []

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.