sourabhkt / robotframework-seleniumlibrary

Automatically exported from code.google.com/p/robotframework-seleniumlibrary
Apache License 2.0
0 stars 0 forks source link

control_key_down/control_key_up do not work properly with OpenLayers #173

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

the following test-case fails when access elements in a OpenLayers page:

(open browser for url)
Click Element       xpath_element1      dont_wait
Call Selenium Api   control_key_down    
Click Element       xpath_element2      dont_wait
Call Selenium Api   control_key_up  

What happens is that the invocation of the control_key_down is completely 
ignored and element1 is selected and them when the second element is selected 
the first element gets unselected.

Note that none of the keywords fails.

Setup used:
jython2.5.1
robotframework-2.5.3  
robotframework-ride-0.32.1 
robotframework-seleniumlibrary-2.6
Python 2.6.5

Regards

Roberto

Original issue reported on code.google.com by roberto....@gmail.com on 10 Feb 2011 at 2:55

GoogleCodeExporter commented 9 years ago
Notice that control_key_down/up are not even exposed as keywords. You are 
calling Selenium API directly and any possible bugs in it are direct Selenium 
bugs. I'm not even sure is control_key_down even supposed to work when clicking 
an element. Could you test this e.g. with Selenium IDE and see does it work 
with it?

Finally, if you are trying to open a context menu, you might want to look `Open 
Context Menu` keyword.

Original comment by pekka.klarck on 18 Feb 2011 at 2:16

GoogleCodeExporter commented 9 years ago
Hi, just two notes:
1) these steps of the test-case presented do not work only when is used in 
OpenLayers web pages. In all other web pages technologies seems to not have 
this multi-selection problem, so the test with Selenium IDE, as suggested, is 
not necessary.
2) after the two elements are selected the Context menu is opened using the 
'Open Context Menu' keyword, but I think that is not relevant for this problem.

Regards

Roberto

Original comment by roberto....@gmail.com on 23 Feb 2011 at 9:17

GoogleCodeExporter commented 9 years ago
First of all, if Seleniun doesn't work well with OpenLayers there isn't much 
SeleniumLibrary can do about it. The easiest way to test how Selenium handles 
some page is using the Selenium IDE. In addition to that there are two things 
you can try out:

1) If you are trying to select multiple items from a list (you haven't really 
explained your use case) you might be able to use Select From List keyword. It 
allows selecting multiple values in one go, but I don't know how well it works 
with OpenLayers components.

2) OpenLayers is JavaScript so you should be able to interact with it using 
Call Javascript keyword. That's quite low level and complex but you can hide 
the complexity into a user keyword.

Original comment by pekka.klarck on 23 Feb 2011 at 9:37

GoogleCodeExporter commented 9 years ago

I've tried the following test-case, with the same results, with Selenium IDE:

open url
waitForElementPresent locator_element1
waitForElementPresent locator_element2
controlKeyDown
click locator_element1
click locator_element2
contextMenu locator_element2

If I do it "by hand" there is no problem in getting the two elements selected 
and call the context menu in the second element.
But with Selenium IDE the only element that gets selected is locator_element2.

Original comment by roberto....@gmail.com on 10 Mar 2011 at 4:21

GoogleCodeExporter commented 9 years ago
This really seems to be a Selenium issue then. If you can get this working with 
Selenium somehow, I'm sure you can make it work with SeleniumLibrary too. I 
don't know OpenLayers nor fully understand your use case so cannot help too 
much with this.

Based on the discussion it seems to me that there's nothing that 
SeleniumLibrary can do to address this issue. If that's true then this issue 
can be closed. What do you Roborto think?

Original comment by pekka.klarck on 10 Mar 2011 at 7:32

GoogleCodeExporter commented 9 years ago
Just to be clear and avoid misunderstandings, the test-case that I showed in my 
last comment and that was used with Selenium IDE it does not work at all!
I cannot get both elements selected with this test-case. This only happens with 
OpenLayers pages. 
Is this also your understanding? Are you stating that this issue cannot be 
solved in Selenium Library? Where is the problem then?

Original comment by roberto....@gmail.com on 11 Mar 2011 at 9:04

GoogleCodeExporter commented 9 years ago
If your test doesn't work with Selenium alone then the problem is either in 
Selenium, in your test, in OpenLayers, or in your system.

Original comment by pekka.klarck on 11 Mar 2011 at 8:00

GoogleCodeExporter commented 9 years ago
I agree with you. The problem seems not to be in Selenium Library
Close the issue.

Original comment by roberto....@gmail.com on 22 Mar 2011 at 1:52

GoogleCodeExporter commented 9 years ago
Ok, closing. Hope you were able to solve your problem somehow.

Original comment by pekka.klarck on 22 Mar 2011 at 7:34

GoogleCodeExporter commented 9 years ago
Hi, 

I am having same problem...
Herewith I am sending my test case....any of your suggestions are very helpful 
for me.

<tr>
    <td>click</td>
    <td>tn_td_4091505</td>
    <td>click</td>
</tr>
<tr>
    <td>controlKeyDown</td>
    <td>tn_td_4091505</td>
    <td></td>
</tr>
<tr>
    <td>click</td>
    <td>tn_td_4091530</td>
    <td>click</td>
</tr>
<tr>
    <td>controlKeyUp</td>
    <td>tn_td_4091505</td>
    <td></td>
</tr>

Original comment by pravinbd...@gmail.com on 6 May 2011 at 7:37

GoogleCodeExporter commented 9 years ago
Hi,

from my comments above you can check that this problem seems not to be related 
with the Selenium Library itself since the problem also occurs using the 
Selenium IDE.
Did you try it with Selenium IDE?

I'm currently not looking anymore into this issue since the project were I was 
working has finished.

Cannot help you more than this.

Sorry for that.

Regards

Roberto

Original comment by roberto....@gmail.com on 6 May 2011 at 9:32