Skip to content

Technology research

Maciej Jaśkowski edited this page Sep 11, 2015 · 11 revisions

Clicking the right thing

When we want to do sth with a widget that looks like recorded widget we have a couple of options

Alternative 1

  1. find location of the widget on the current page (having screenshots, on server side)
  2. use mouse to move to the middle of the widget in question (as for click)
  3. use mouse click

Alternative 2

  1. find location of the widget on the current page (having screenshots, on server side)
  2. find identifier of the widget given the location (via e.g. extension in case of Chrome, or better JS snippet execution)
  3. click it using Webdriver API (see w3 webdriver specification)

Alternative 3

w3 webdriver specification mentions element location strategies. People claim that it is possible to add such strategy when starting selenium server. Depending on what information is provided inside such a strategy, it might useful for our purpose.

Simpler managing of environment using Docker

We might want to have multiple containers with the same or different setup for different users and create or deploy them on demand. Then these commands will be useful:

docker run --name selenium-3 -p :4444 -p :5555 -d jakozaur/docker-selenium:v1.3

docker port selenium-3 4444

docker port selenium-3 5555

Take screenshot of element

In w3 webdriver specification it is proposed that a takeScreenshotElement action is available. It's not exposed neither in nightwish nor in webdriver.io. Under Chrome 45.0.2454.85 (64-bit; MacosX 10.9.5) does not work :/

A workaround is possible with use of ImageMagick&co: http://stackoverflow.com/a/23087000