Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A webdriver / selenium wrapper focusing on code completion, good page class design, and logging.
Website at: http://www.slickqa.com/webdriver/python Extensive documentation at: http://www.slickqa.com/webdriver/python/docs
Don't let the name fool you, this wrapper can be used by any project. It was written by the people who brought you the slick project, hence the name. This wrapper has the purpose of making the selenium interface more reliable for tests with less, more readable code by:
What does a test using this fabulous framework look like? Let me show you::
from slickwd import BrowserType, Browser, Container, WebElementLocator, Find
from nose import with_setup
from nose.tools import assert_regexp_matches
# Page Classes --------------------------------------------------
class GoogleSearchPage(Container):
Search_Query_Text_Field = WebElementLocator("Search Box", Find.by_name("q"))
Search_Button = WebElementLocator("Search Button", Find.by_name("btnG"))
def is_current_page(self, browser):
return browser.exists(GoogleSearchPage.Search_Query_Text_Field, timeout=0, log=False)
class SearchResultsPage(Container):
Results_Div = WebElementLocator("Results Div", Find.by_id("ires"))
def is_current_page(self, browser):
return browser.exists(SearchResultsPage.Results_Div, timeout=0, log=False)
# Tests ---------------------------------------------------------
browser = None
def s():
global browser
if browser is not None:
browser.quit()
browser = Browser(BrowserType.FIREFOX)
def cleanup():
global browser
if browser is not None:
browser.quit()
@with_setup(s, cleanup)
def test_google_search():
global browser
browser.go_to('http://www.google.com')
browser.wait_for_page(GoogleSearchPage)
browser.click_and_type(GoogleSearchPage.Search_Query_Text_Field, "Slick Test Manager")
browser.click(GoogleSearchPage.Search_Button)
browser.wait_for_page(SearchResultsPage)
assert_regexp_matches(browser.get_page_text(), '.*SlickQA:.*')
The test is written so the code can be read, easily modified if something in the page is changed, and allow for code reuse (page classes). Normally page classes would be held in a different module for better organization. This is what is referred to in the documentation as the "static page class model". There is also a different way to structure page classes that allows for nesting of containers (page classes) to make a hierarchy and enable code completion in IDEs.
FAQs
A webdriver / selenium wrapper focusing on code completion, good page class design, and logging.
We found that slick-webdriver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.