cisco-open-source / qtwebdriver

WebDriver implementation for Qt
https://github.com/cisco-open-source/qtwebdriver/wiki
197 stars 59 forks source link

Fix not being able to click on svg elements #35

Closed davidshepherd7 closed 7 years ago

davidshepherd7 commented 7 years ago

Currently attempting to click on an svg element gives the error:

Message: isElementClickable execution failed;
 undefined is not an object (evaluating 'b.length')

This is because in the IS_ELEMENT_CLICKABLE atom the Javascript code assumes that the svg element has the outerHTML property but it doesn't. The outerHTML information is only used for improved error reporting so it should be safe to ignore it for svg elements.

I guess we shouldn't be hacking on compiled javascript output like this, so if you can point me towards some instructions for making changes and re-compiling I'm happy to do that. Also are there any tests for this stuff?

P.S. it seems unlikely that this will be fixed upstream, there's a long abandoned bug report with no activity, and it appears that modern browsers support calling outerHTML on svg elements.

hekra01 commented 7 years ago

Hi,

To build atoms from source I proceeded like this:

Set env

$ export qtwebdriver=/home/hekra01/WD/qtwebdriver/out/desktop/release/Default/WebDriver $ export LD_LIBRARY_PATH=/home//hekra01/qt/lib:$LD_LIBRARY_PATH

Note the tests require ant 1.8.2 installed to work properly

$ ./go test_qtwebkit --trace

* The test results are in `build/test_logs`
* The list of all possible tests is in the Readme and in the Rakefile:

./go test_qtwebkit ./go test_wd_native_qt4 ./go test_wd_native_qt5 ./go test_wd_hybrid_qt4 ./go test_wd_hybrid_qt5 ./go test_wd_quick1 ./go test_wd_quick2

* The sources of the tests is in `selenium/java/client/test/org/openqa/selenium/qtwebkit/`
* I modified the atoms in selenium in this [commit](https://github.com/cisco-open-source/qtwebdriver/commit/a70fa15d8f0b176278b6596919497e6f6196537d)  for webdriver, this [commit ](https://github.com/cisco-open-source/selenium/commit/66a17f0f3de929822879e76c0ded7ab7392873a6)for selenium, and updated weddriver with the generated cc, since the test results show no regression (or improvement, seems we dont yet test it, TBD later):
``` Thanks for your contribution.
davidshepherd7 commented 7 years ago

Thanks for sorting that out for me, and thanks for explaining everything :+1: