• +43 660 1453541
  • contact@germaniumhq.com

Germanium 1.9.8 Changes Since Last Release




Germanium 1.9.8 Changes Since Last Release

Quite a few changes happened since our last blog post announcing the availability of Germanium 1.9.3.

Better Position Operations

For starters, the Box class that allows us to get coordinates of elements, and do simple math on these, also supports now getting single position properties (left, right, top and bottom):

So for example to get the right and left of a div we could:

1
2
3
positions = Box(Element('div.messages'))
left = positions.left() # number
right = positions.right() # number

type_keys() Allows Delays Between Keypresses

A new parameter delay is now available, that allows introducing a timed delay between each keypress.

New waited() Function

A lot of the times, we got reports that people do a sequence of actions:

1
2
3
4
wait(Button("Ok"))
click(Button("Ok"))
wait(Link("edit"))
click(Link("edit"))

The pattern is usually, wait for the next element to appear, interact with it. With waited this code can be rewritten such as:

1
2
click(waited(Button("Ok")))
click(waited(Link("edit")))

waited will return None instead of throwing, so it can also be used in if conditions:

1
2
3
4
5
6
7
8
click(Button("Ok"))

if waited(Text("Access denied")):
login_as_admin()
edit_user()
click(Button("Ok"))

assert waited(Text("Saving succeeded"))

Thus writing automation code becomes yet again simpler.