GithubHelp home page GithubHelp logo

badgerati / monocle Goto Github PK

View Code? Open in Web Editor NEW
63.0 9.0 12.0 134.02 MB

PowerShell Web Automation module, made to make automating websites easier

License: MIT License

PowerShell 98.23% Dockerfile 1.77%
powershell web automation ie internet-explorer websites cross-platform selenium chrome firefox

monocle's People

Contributors

badgerati avatar fraham avatar gazataeon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

monocle's Issues

Feature Request: Invoke Screenshot of Element

Add the feature to take a screenshot of an element using Invoke-MonocoleScreenshot. It seems like in Selenium it would be something like:

#Screenshot of an element 
elem = driver.find_element_by_class_name("btn-group") 
elem.screenshot('Element.png')

Support for child/parent elements

This is to add in support for Child/Parent and Sibling elements, plus support for passing a scope element to Get-MonocleElement - so you can get the parent of an element, and then get and element by on an ID from that parent element, rather than the whole document.

Publish to powershellgallery.com

I know Monocle is already on powershellgallery.com, but it's been a while since there's been a new version. If necessary, powershellgallery.com does support pre-release versions. There's been a good chunk of changes since 1.3.4 was first released.

Typo in the readme

Where it says:

Or, you can take a screenshot directly:

Invoke-MonocoleScreenshot -Name 'screenshot.png' -Path './path'

It should read:

Invoke-MonocleScreenshot

Extend moving the page to also move to an element

The Move-MonoclePage function current moves to a position. This will extend it so you can also pass/pipe an element and Monocle will scroll to it.

Get-MonocleElement -Id 'footer' | Move-MonoclePage

Support for downloading drivers of different versions

This will be simple support, for IE, Firefox and Chrome. But have some Install-MonocleDriver that will download from nuget a different version of the driver.

Monocle will auto-detect, and use the different driver rather than the normal inbuilt one.

Fix getting selected option, and setting option on dropdowns

Currently Get-MonocleElementValue and Set-MonocleElementValue don't work on dropdowns.

They should be updated to convert the WebElement to a SelectElement if the TagName is select. With this, we can get the selected value, or set the selected value.

Get an element by JavaScript Selector

You can currently get elements by ID, Tag, Attribute, and XPath. This will add support to get an element by using a JS Selector.

(need to make sure you can safely return an element from JS).

Add support for scrolling the page

Add a new Move-MonoclePage to scroll the page - either by a preset, or by a custom amount:

Move-MonoclePage -To Bottom
Move-MonoclePage -Position 1000

Support for getting elements from within iFrames

When elements are contained within an iframe, Get-MonocleElement fails to find the element. In order for Selenium to find these elements, we need to switch context to the iframe.

To do this a new Enter-MonocleFrame will be created, this will switch the Selenium context to the iframe, run a script, and then exit the context back to the parent frame:

Get-MonocleElement -Id 'form-frame' | Enter-MonocleFrame -ScriptBlock {
    Get-MonocleElement -Id 'element-in-iframe'
    #etc
}

Mpath syntax

Hi, Thanks for your cool module.
I'm struggling with ClickElement for clicking the right element in a table.
Could you show the Mpath equivalent for Xpath /html/body/table/tbody/tr[2]/td[2] ?

If you know better ways to do this..this is my html element..much appreciated:

Setup the system.

System Setup
Setup the system.

Add support for waiting for an element to be visible

There are times when a page will hide certain inputs, only showing it when another input has been completed. In this case, the displaying of the hidden element might happen too slowly, causing Monocle attempt to edit a hidden input.

To get around this, a new Wait-MonocleElementVisible function will be added. When the element is visible, it will be returned.

Get-MonocleElement -Id 'input' |
    Wait-MonocleElementVisible |
    Set-MonocleElementValue -Value 'name'

Furthermore, Get-MonocleElement will have a new -WaitVisible switch added:

Get-MonocleElement -Id 'input' -WaitVisible | Set-MonocleElementValue -Value 'name'

Save-MonocleImage doesn't accept from pipeline

Save-MonocleImage doesn't accept the Element parameter from the pipeline where other functions like Set-MonocleElementValue allow it.

This means that the example on the main page gets stuck at the saving the screenshot line.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.