Finding CSS Changes in Selenium

I am making an ajax form where I change some CSS elements on the fly, and I was wondering if it is possible to check these changes in selenium, for example, it will check the background color: #ffffff, click button, background. Color :. # 000000

I conducted a study on the network, but I can only find information by the type of locator "css =", which gives me only selector places in the Dom model, and not the css elements themselves.

Can I do what I described?

+3
source share
1 answer

The way I will do something like this is to make a statement on the attribute

css = selenium.getAttribute("locator@attribute");

and then make your statements on the returned item. So if this is the style you would do

css = selenium.getAttribute("locator@style");

or if its new class do

css = selenium.getAttribute("locator@class");
+6
source

Source: https://habr.com/ru/post/1793986/


All Articles