Skip to main content

easyselenium

Let us handle the boring stuff!

====================

Selenium Now Automate your browser based projects in easily and faster.

easyselenium is write on the top of selenium to make selenium easier for beginers for ready built in funtions only they need to call the functions and pass the arguments.All extra thing time delay and webdriver wait select findping xpath will do in backend. Get rid of using time delays

By Ankit Kothari Apache 2.0 license.

Advantage

  • 1.Simple easy syntax, Dont need to remeber the whole selenium syntax and google it.It will call the required code acc to your need.ie: (browser=ie/chrome/firefox)
  • 2.Dont need to download drivers for chrmoe/firefox/it it automatically download accc to your version in cache/your desired path.
  • 3.All commands are with explicit wait so dont need to use time sleep and slow your code or element not found error. It will wait untill element/page found.
  • 4.select your option with partial text
  • 5.Manage Window/Javascript alerts also.
  • 6.Debug will print line by line what going inside.
  • 7.Read element/elements its text and value automatically and print in debug mode and retun in packed list.

Documentation

from easy selenium import *

1. open_browser()

with optional arguments

open_browser(browser='chrome/firefox/ie',headless=True/False,debug=True/False)

By default
by default time: Explicit wait is 50 sec for every function
Change from passing(timeout=1)
## open_browser(headless=False,,browser='chrome',debug=False,path=cache memory to download drivers/or your customised path)

2.connect_exisitng_browser(url,session_id)

pass url nad seesion id from your existing browser which is printed when you call browser.

3.open_url(url='https://step2success.in')

with optional arguments
open_url(url='https://step2success.in',new_tab=False)
new_tab = True/False (open in new tab or same)

4.window_handle(no=1)

window_handle(title='google')

To switch to your popup or another tab window ()

5.switch_frame (no=1 or name='mainframe')

To switch to iframe or frame with no or name
switch_frame(no=1 / name='mainframe'/id='name'/css='btn-danger'/ xpath='class=btn-pop'/xpath='//[div[3]/article/div[1]]')

6.click_on (text='submit'or image='imagepath' or id='submit' or css='send' or xpath='this')

To Click on buton based on iamge/Text or xpath

with optional arguments
click_on(no=1 / name='mainframe'/id='name'/css='btn-danger'/ xpath='class=btn-pop'/xpath='//[div[3]/article/div[1]]')

repeat=True/False (True- To double click on item)

7.mosue_hover (text='submit'or image='imagepath' or id='submit' or css='send' or xpath='this')

To hover mouse on avascript element instead of click

8.send_text (text='your text' with id='submit' or css='send' or xpath='this')

```sh
with optional arguments
send_text(no=1 / name='mainframe'/id='name'/css='btn-danger'/ xpath='class=btn-pop'/xpath='//[div[3]/article/div[1]]')

with_enter=True/False (True-To enter after type text)

9.select_dropdown (option ='option to select' with id='submit' or css='send' or xpath='this')

To select option in dropdown with partial text
select_dropdown(no=1 / name='mainframe'/id='name'/css='btn-danger'/ xpath='class=btn-pop'/xpath='//[div[3]/article/div[1]]')

10.read_text (id='submit' or css='send' or xpath='this')

To read text from element/multiple elements
It is samrt enough to automatically detect if single or multiple element is present
Value/Text is present

Then return you a packed list of elemnts  containing text,value and session_id
read_text(no=1 / name='mainframe'/id='name'/css='btn-danger'/ xpath='class=btn-pop'/xpath='//[div[3]/article/div[1]]')

11.close_window (no=1 or name='yahoo')

To switch and close the provided window
optional switch_to=0
to switch to this window after closing

12.windows_alert (text='NA',with_enter=False)

To send text or enter to accept to windows authentication

13.alerts (text='yes'/'no'/'custom'/blank to read it text)

To accept/decline/send text/read text from alert box

14.page_source ()

To print raw HTML

Example :

import time

from easyselenium import *
import time
open_browser(path="chromedriver.exe",browser='chrome',debug=True)
#open_broswer(browser='firefox')
#open_broswer(browser='ie')
#open_broswer(browser='chrome',headless=True)

open_url(url="https://step2success.in/registration-page-demo/")
open_url(url="https://step2success.in/iframe-demo/",new_tab=True)
window_handle(no=0)
send_text(text='Ankit',id='first_name')
send_text(text='Kothari',id='last_name',with_enter=True)
select_dropdown(option='What is your Birthdate?',id='dropdown')
#click_on(text='REGISTER')
#click_on(id='register')


time.sleep(3)

window_handle(no=1)
switch_frame(no=0)
read_text(href ='#')
click_on(text='Follow On Twitter')

window_handle(no=2)

#close_window(no=2)

Release files for easyselenium 1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for easyselenium 1.4
File Size Uploaded
easyselenium-1.4.tar.gz 15.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for easyselenium 1.4
File Interpreter ABI Platform
easyselenium-1.4-py3-none-any.whl Python 3 none any Details

Total release size: 40.3 kB

Release files / easyselenium-1.4.tar.gz

Download URL easyselenium-1.4.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
17676f35efa26101bae462578a1d39e8cacaebd9ffe79621abda418fcc32fc80
BLAKE2b-256 checksum
How to use checksums
ea559c5baafdfc86545dd2a108dd970039ca712cd02b9bcdad516a958ac44025
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

Release files / easyselenium-1.4-py3-none-any.whl

Download URL easyselenium-1.4-py3-none-any.whl
Size 24.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc0ef2d6568d52286ca4017f7d8cbb21baddc8fa39f54dc6f370e9b9d583a8ec
BLAKE2b-256 checksum
How to use checksums
9c75a1b2e6f70b5034ae8f39e588d1daf879d7055f21a15907ecb94330959af1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

1.4 This release

2 release files

1.2

2 release files

1.1

2 release files

1.0

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page