We just had 30 days of tools, who wants to do 30 days of CSS Selectors

What do Web Development, UI Automation and Web Scrapping have in common?

The answer is selectors, css selectors to be more exact.

What if I told you that mastering CSS Selectors only takes you 5 minutes a day for a month.

Do not believe me? Come on, take the challenge. I bet you that if you watch 1 video a day from the playlist below you will be a CSS Selector master

2 Likes

Sounds like a nice activity to start on Monday! :nerd_face:

Definitely me, can use some, but still have troubles with some non-typical and need to use xpath, that somehow is more intuitive for me, not enough practise on my side, so 30 days of hints & discussion would be great.

1 Like

Are there 30 CSS selector domain problems? I was told that CSS selectors were a single silver bullet, please don’t tell me we solved yet another non-problem?

1 Like

I love this idea. At a previous place we worked at, we used xpaths instead. Each week we’d post a Xpath challenge, pick an element on a website and write an xpath for it.

I only recently learned about CSS selectors and that bento box program really helped. Definitely recommended.

I like the idea of a daily or weekly CSS Selector challenge as well as a 30 days of CSS selectors to learn them.

2 Likes

I do not understand the question. Could you please elaborate?

In my experience selectors were not always easy and wanted to make a playlist that one can view ( maximum 5 minutes a day/video) and in the end have the know how needed to be better with the selectors.

It would help with Webdevelopment, Test automation and Web Scrapping.

I am not sure that the question was answered :slight_smile:

1 Like

It’s all good Ioan , I’m just my grumpy self still. I assume you really mean XPATH and CSS.

But I am mindfully that since not all testers actually test web apps, it’s probably a bit narrow a topic. For example, until a year ago, myself, I had 10 years of testing experience with only once touching a single web app briefly. It’s a great topic to run, just not sure we would keep everyone’s attention.

2 Likes

Well CSS selectors (and also XPATH) are very simple and pretty straight forward. Just get an ID or CLASS that’s unique and use that. No unique ID or CLASS? It’s off to the devs to put those in the code for you, or to show you how to do it yourself.

Every time someone comes up with some tool or a whole course to master CSS/XPATH it’s to mitigate symptoms, not to fix the actual underlying problem. Testability of an application is a real thing. Let’s not work around that, but actually fix it at the core of the issue.

It’s perfectly fine to say that you can’t test a certain application because there are no unique selectors. I’d wish we did that more, so people would understand that testing is a very costly and difficult activity,

4 Likes

Definitely the most important piece of advise you can give anyone trying to develop automated tests is speak to the developers about introducing unique identifiers. If you mention it enough, they will make it a habit to include them without having to be asked.

However, I have found that sometimes I’ve had to use more inventive with CSS Selectors and XPaths. Lists and tables where the content and values will change can often be a little problematic, so understanding the how to setup more complex locators better can be beneficial.

I do find that those new to XPaths and CSS Selectors struggle to setup even the simplest locators so programs like this are useful just for providing a fun way to practice creating them. I found the program mentioned in this thread particularly useful when learning about CSS Selectors after years of only working with XPaths. I would recommend it to anyone who wants to be more confident in locator strategies.

2 Likes

Good selectors are hard to write, and the language is super critical for cases where the web developers don’t know about your test framework needs and end up tagging elements that are not accessible to selenium without scripting, and then the whole thing gets complicated. There are so many aspects to follow up on, and to be honest it’s daunting for those with minimal java coding skills and limited experience of CSS. Just the other day I was pondering if it’s worth learning how shadow DOMs for example work. It’s a load to take on when planning each test case if you are doing all of the coalface work yourself.
Would love someone to cover this in a series that does not assume we all know loads about HTML and browser internals.