r/selenium • • Nov 28 '20

Resource "Sillynium" - Auto generate working Python Selenium scripts by drawing coloured rectangles around web elements on a page that you want to automate - UPDATE from yesterday (I made this)

TLDR: 60 sec video here:https://streamable.com/1y17lt

TLDW: When I want to automate actions on a site, such as logins or forms, or scraping pages with JavaScript, I manually inspect each web element I need and begin writing a script.

I'm lazy though and had the idea to automate the creation of these automation/testing scripts. And thus "Sillynium" was born.

Sillynium allows you to draw boxes around the elements you require on a page and automatically gets the element and its properties for you. Different coloured rectangles tell the program you want to do different things. Eg: Red means "Input text", Green means "Click button".

When you've finished drawing boxes, a working python selenium script is generated. If you run that script, it does exactly what you told it to do! All this without you writing any code, and losing time.

Working 60 second video link of program in action: https://streamable.com/1y17lt

I made this project over the course of a day as a quick and dirty proof of concept. Its very flawed in its current iteration (taking a screenshot of webpage), so V2 I'm trying to figure out how to draw directly to the browser. Critique it and rip it to shreds. I'm aware of browser recorders btw so I know those exist, this is my twist on automation

Yes I posted on Python as well, but I wont post for a few weeks now :)

29 Upvotes

6 comments sorted by

5

u/McSHUR1KEN Nov 28 '20

Awesome concept, awesome name!

3

u/[deleted] Nov 28 '20

More proud of the name than anything šŸ˜Ž

3

u/Laserdude10642 Nov 28 '20

What methods are you using to pick the web element with the web driver?

2

u/[deleted] Nov 28 '20

Any method :) it grabs all possible attributes and uses the best one. Eg usually ID is the best to use so that has highest priority, if that doesn’t exist it goes down the list and will pick the next best, by name..... all the way down to absolute and relative XPath

1

u/BroughtMyBrownPants Nov 29 '20

This is a pretty cool concept for some simple automation, though I'm struggling to see how this differs from a record/playback IDE tool. Still, a creative idea none the less!

I'd be curious to see how it handles against sites without ID or NAME attributes for elements. Or how it handles with SPAN dropdowns. There are a lot of sites that recording tools cannot easily replicate and require custom code in order to automate the desired scenarios!

1

u/seansy5000 Dec 02 '20

I’d like further explanation on this. I’m having an issue trying to click a button that only exists when it’s in stock and is ā€œnot availableā€ otherwise. I’ve found the source xpath for the hidden button but how do I test if it works without that button being active?