Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

javascriptexecutor scripts run in Firefox v35 return the error "arguments[0] is undefined". Same code and tests work fine in v 34.05 #8418

Closed
lukeis opened this issue Mar 4, 2016 · 3 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 8418

Running FF v 35 on Mac 10.9.3, with selenium 2.44.  jsexecutor script fails run in java
via selenium, with error "arguments[0] is undefined".  Same code etc works when i fall
back to FF 34.05.  My code in question is:

    element = driver.findElement(By.xpath("//a[contains(@href,'/index.php?main_page=login')]"));
                Log.info("found link");
                Log.info(element.getText());
                Log.info(element.getAttribute("target"));
                Log.info(element.getAttribute("class"));
              String js1 = "arguments[0].removeAttribute('target')"
                jsexecutor.executeScript(js1, element);


Below is my log output, showing that the element is correctly found:

2015-01-20 18:05:13,615 INFO  [Log] found link 
2015-01-20 18:05:13,632 INFO  [Log] Storefront 
2015-01-20 18:05:13,643 INFO  [Log] _blank 
2015-01-20 18:05:13,667 INFO  [Log] header-button 
2015-01-20 18:05:13,689 ERROR [Log] Storefront link not found. 


The element's html code is:  

<a class="header-button" target="_blank" href="https://qa-exchange.parchment.com/send/adds/index.php?main_page=login&s_id=PjoDfkXNIPaQawpP">
    <span class="content">
        <i class="icon-shopping-cart icon-2x"></i>
        <br></br>
        Storefront
    </span>
</a>




Actual results:

 "arguments[0] is undefined".  


Expected results:

jsexecutor should executre correctly and html element be modified.

I have filed this as a bug for Mozilla, at https://bugzilla.mozilla.org/show_bug.cgi?id=1123998.
 Mozilla is calling this a bug in JavascriptExecutor.

Reported by jalexander@parchment.com on 2015-01-21 19:11:25

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by jmleyba on 2015-01-21 19:47:07

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

sorry for submitting the dupe. Search by default was for only Open items.

Reported by jalexander@parchment.com on 2015-01-21 19:58:56

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by luke.semerau on 2015-09-17 18:25:06

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 4, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant