Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMatchett committed Oct 23, 2018
1 parent 242e9d8 commit 246d6a5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ if you know that the incriment of the slider will be constant then simply pass t

<br>

MoveSliderWithInfo(int SliderMax, int SliderMin, decimal Amount, IWebElement Slider, IWebDriver driver)
### MoveSliderWithInfo(int SliderMax, int SliderMin, decimal Amount, IWebElement Slider, IWebDriver driver)

supply the method with the maximum value of the slider (what is actually output to the user), the mininum value of the slider, the amount you want the slider moved to, the slider you want moved as an IWebElement and the driver being used as an IWebDriver.

Comes with overloads for Amount in any numerical format or as a string with a basic non-numerical symbol removal filter

<hr>

MoveSliderNoInfo(IWebDriver driver, IWebElement slider, dynamic amount)
### MoveSliderNoInfo(IWebDriver driver, IWebElement slider, dynamic amount)

This is meant to be used when you do not know the maximum or mininum values of the slider on the web browser, it however relies on the slider containing the Max and Min tags within the Dom element as it uses the "Element.getAttribute" method to retrieve these values.

Expand All @@ -32,7 +32,7 @@ Supply the method with the driver being used, the slider you want moved and the

<hr>

MoveSliderUsingTextBox(IWebElement Slider, IWebElement textBox, IWebDriver driver, decimal Amount)
### MoveSliderUsingTextBox(IWebElement Slider, IWebElement textBox, IWebDriver driver, decimal Amount)

This is meant to be used when you don't know the maximum or mininum values of the slider on the web browser and the slider element does not contain the Max And/Or Min tags, it however relies on the textbox that the value of the slider is output to, to be specified as it will move the slider, read the output and then use this information to construct the values of the maximum value of the slider, mininum value of the slider to then calulcate the amount of pixels the slider has to move in order to be at the amount specified.

Expand All @@ -41,27 +41,27 @@ It employs a basic filter method that removes any non numerical symbols which I

<hr>

MoveSlider(IWebElement Slider, IWebDriver driver, int Pixels)
### MoveSlider(IWebElement Slider, IWebDriver driver, int Pixels)

This is what's called to actually move the slider, If you already know the exact pixel value from the mininum that the slider has to move then you are able to directly call this subroutine and it will move the slider to the positon you want it to be but otherwise call the most appropriate method from above to do the amount to pixel conversion and movement automatically

<hr>

GetIncrement(IWebDriver driver, IWebElement Slider, IWebElement textBox, decimal SliderMin)
### GetIncrement(IWebDriver driver, IWebElement Slider, IWebElement textBox, decimal SliderMin)

A nifty little subroutine that will find the smallest amount that the slider can be adjusted by, useful for testing.


<hr>

Filter(string TextBoxText)
### Filter(string TextBoxText)

This is used for taking an input, removing any non-numerical characters and returning the result as a decimal. This is used primarily in the "MoveSliderUsingTextBox" subroutine where the actual output from the slider through the speicfied textbox is used to calculate the amount of pixels necessary to move the slider. For example if you had a slider which output £2,000.00, the £ and , would throw an illegal input exception, this subroutine means that the program only sees "2000.00" as it only keeps numbers 0-> 9 and a decimal point.


<hr>

GetPixelsToMove(IWebElement Slider, decimal Amount, decimal SliderMax, decimal SliderMin)
### GetPixelsToMove(IWebElement Slider, decimal Amount, decimal SliderMax, decimal SliderMin)

This is where the majority of the mathematical calculation is done, using a mathematical method I came up with myself it takes in the width of the slider, the Maximum and mininum values of the slider and the amount the user wants to set the slider to and works out the amount in pixels from mininum the slider must be used.

Expand Down

0 comments on commit 246d6a5

Please sign in to comment.