0
votes

Hello,

I am working with Selenium IDE with firefox, but one of the links that I need to click on has a target of '_blank' and Selenium IDE cannont seem to follow it or it loses its location. I have tried using the following code to get rid of the target in the link and to open it:

<tr>
   <td>getEval</td>
   <td>this.page().findElement('css=html body#reportViewer div#frame.column div.content div#display.body div#reportViewFrame.column div.content div.body center div#reportContainer div div div span span a span').removeAttribute('target')</td>
   <td></td>
</tr>
<tr>
   <td>storeEval</td>
   <td>this.page().findElement('css=html body#reportViewer div#frame.column div.content div#display.body div#reportViewFrame.column div.content div.body center div#reportContainer div div div span span a span').href</td>
   <td>url</td>
</tr>
<tr>
   <td>getEval</td>
   <td>getEval | this.page().findElement('xpath=//html/body/div[18]/div[9]/div[2]/div/div[9]/div[2]/center/div/div/div[2]/div/span/span/a').href = 'javascript:window.open('${url}','myWindow')'</td>
   <td></td>
</tr>
<tr>
   <td>click</td>
   <td>css=html body#reportViewer div#frame.column div.content div#display.body div#reportViewFrame.column div.content div.body center div#reportContainer div div div span span a span</td>
   <td></td>
</tr>

The error that I am getting is:

[error] Threw an exception: invalid assignment left-hand side

The error is at the second "getEval" statement (lines 12 -15). Anything will help, thank you.

The IDE is saying that this script:

[info] script is: getEval | this.page().findElement('xpath=//html/body/div[18]/div[9]/div[2]/div/div[9]/div[2]/center/div/div/div[2]/div/span/span/a').href = "javascript:window.open(\"null\",\"myWindow\")" 

is being executed so, the url variable isn't getting any value stored in it.

2

2 Answers

1
votes

Looks like you have a quoting problem

'javascript:window.open('$url','myWindow')'

Swap the inside ' with "

0
votes

Can you post a link to the page you're trying to get the link from? One thing you might try is after you store the value in {url}, do an echo | ${url} | command right after that and then step through the test to see if it's actually returning what you expect it to return.

Klendathu