'"bash: yamllint: command not found" after installing yamllint and trying to use it

after installing the last version of pip and successfully installing yamllint using

pip install yamllint

when I'm trying to use yamlling by writing in the terminal

yamllint .

or

yamllint file.yml

I'm getting the error

bash: yamllint: command not found

why is that?



Solution 1:[1]

There are a few advanced libraries built-in to Selenium such as EventFiringWebDriver, AbstractEventListener, etc, which can be used to log all Selenium actions being performed.

Relevant Java Docs can be found here: https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/support/events/EventFiringWebDriver.html https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/support/events/EventFiringDecorator.html https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/support/events/WebDriverListener.html

I also have a working Python SeleniumBase example from here, which performs actions that get recorded and printed out. To run that example, you'll first need to pip install seleniumbase, then run the test with pytest: pytest test_event_firing.py -s.

from selenium.webdriver.support.events import EventFiringWebDriver
from selenium.webdriver.support.events import AbstractEventListener
from seleniumbase import BaseCase

class MyListener(AbstractEventListener):
    def before_navigate_to(self, url, driver):
        print("Before navigating to: %s" % url)

    def after_navigate_to(self, url, driver):
        print("After navigating to: %s" % url)

    def before_find(self, by, value, driver):
        print('Before find "%s" (by = %s)' % (value, by))

    def after_find(self, by, value, driver):
        print('After find "%s" (by = %s)' % (value, by))

    def before_click(self, element, driver):
        print('Before clicking on element with text: "%s"' % element.text)

    def after_click(self, element, driver):
        print("Click complete!")

class EventFiringTests(BaseCase):
    def test_event_firing_webdriver(self):
        self.driver = EventFiringWebDriver(self.driver, MyListener())
        print("\n* EventFiringWebDriver example *")
        self.open("https://xkcd.com/1862/")
        self.click("link=About")
        self.open("https://store.xkcd.com/search")
        self.type('input[name="q"]', "xkcd book\n")
        self.open("https://xkcd.com/1822/")

The output of that prints the Selenium actions that were detected via the EventListener:

* EventFiringWebDriver example *
Before navigating to: https://xkcd.com/1862/
After navigating to: https://xkcd.com/1862/
Before find "About" (by = link text)
After find "About" (by = link text)
Before find "About" (by = link text)
After find "About" (by = link text)
Before clicking on element with text: "About"
Click complete!
Before navigating to: https://store.xkcd.com/search
After navigating to: https://store.xkcd.com/search
Before find "input[name="q"]" (by = css selector)
After find "input[name="q"]" (by = css selector)
Before navigating to: https://xkcd.com/1822/
After navigating to: https://xkcd.com/1822/

Similar solutions exist for the other Selenium language bindings.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Michael Mintz