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

RESOLVED INVALID

Status

()

RESOLVED INVALID
4 years ago
4 years ago

People

(Reporter: jason.alexander.az, Unassigned)

Tracking

35 Branch
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

4 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.99 Safari/537.36

Steps to reproduce:

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.

Comment 1

4 years ago
(In reply to jason.alexander.az from comment #0)
> 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);
> 


This is a bug with selenium's jsexecutor. You should file it in their bugtracker, not here.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → INVALID
(Reporter)

Comment 2

4 years ago
Submitted to selenium at https://code.google.com/p/selenium/issues/detail?id=8418.  However, it seems awfully curious that this only occurs on FF v. 35, and falling back to FF v 34.05 it works (and has worked) fine. Can you provide any more details on how you concluded its a bug with selenium?

Comment 3

4 years ago
(In reply to jason.alexander.az from comment #2)
> Submitted to selenium at
> https://code.google.com/p/selenium/issues/detail?id=8418.  However, it seems
> awfully curious that this only occurs on FF v. 35, and falling back to FF v
> 34.05 it works (and has worked) fine. Can you provide any more details on
> how you concluded its a bug with selenium?

Because normal arguments accessing in Firefox works fine (e.g. the testcase in the URL field I just made up), and element.removeAttribute works fine, and so the thing that's breaking is how selenium passes/runs things on Firefox, apparently. That could theoretically point to a bug in Firefox, but it'd require knowing more about what's going on in the selenium webdriver bits, at which point the selenium folks can file a bug about what exactly they think is going wrong in Firefox.
You need to log in before you can comment on or make changes to this bug.