Skip to content

Instantly share code, notes, and snippets.

View adiralashiva8's full-sized avatar

Shiva Prasad Adirala adiralashiva8

  • Hyderabad
  • 18:56 (UTC +05:30)
View GitHub Profile
Basics
Searching is based on Tags and Attributes.
Instructions:
/ -> absolute xpath, start searching from the root node
// -> relative xpath, starts from the node of your choice
//* -> we can put * if we don’t want to specify tag name (means ANY tag)
[@attributeName] -> @ means attribute in [ ]
‘Value’ -> all values we should put inside ‘ ‘
@leeuwe
leeuwe / ReadMe.md
Last active December 20, 2023 16:06
Base file to speed up your migration from Robot Framework® SeleniumLibrary to Browser

This is a base file to speed up your migration from Robot Framework® SeleniumLibrary to Browser library. The file contains over 40 SeleniumLibrary keywords and may require adjustment to your specific situation.

You should import this resource file INSTEAD of the SeleniumLibrary, NOT in combination with the SeleniumLibrary.

@leeuwe
leeuwe / Check CSS from Element.robot
Last active August 7, 2021 08:55
This git lets you grab the Computed style
*** Settings ***
Library SeleniumLibrary
*** Keywords ***
Check CSS from element
[Documentation] This keyword only works with xpath and is based on [https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle|getComputedStyle]
... You can use this keyword as follows
... | Check CSS from Element | //path/to/element | style | Expected Value |
... | Check CSS from Element | //h2/div | font-size | 24px |
[Arguments] ${xpath} ${CheckStyle} ${ExpectedComputedStyle}
@rengler33
rengler33 / scrape_with_logs.py
Last active February 8, 2025 04:09
How to Capture Network Traffic When Scraping with Selenium & Python
# see rkengler.com for related blog post
# https://www.rkengler.com/how-to-capture-network-traffic-when-scraping-with-selenium-and-python/
import json
import pprint
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
capabilities = DesiredCapabilities.CHROME
@gvasanka
gvasanka / JenkinsPipelineForRobotTestRuns
Last active November 9, 2023 17:01
Jenkins pipeline script run robot test cases, re-run test cases, merge report and pass the test report
pipeline {
agent {
label 'qatest'
}
environment {
QA_SERVER = 'https://qa.application.com/'
CT_SERVER = 'http://ct.application.com/'
}
stages {
@dmmeteo
dmmeteo / 1.srp.py
Last active January 27, 2025 12:38
SOLID Principles explained in Python with examples.
"""
Single Responsibility Principle
“…You had one job” — Loki to Skurge in Thor: Ragnarok
A class should have only one job.
If a class has more than one responsibility, it becomes coupled.
A change to one responsibility results to modification of the other responsibility.
"""
class Animal:
def __init__(self, name: str):
@xrman
xrman / gist:4468f545b169969466bceb694d742dad
Created March 12, 2019 21:47
FastStone Capture Full Serial Key
Registration Code
Name : www.xyraclius.com
Serial : OOCRYIMDMDPWRETFPSUZ
@harbdog
harbdog / robot-email-template.groovy
Last active July 25, 2021 20:18
Jenkins Robot framework Email-ext plugin template example
<!-- Robot Framework Results Email-ext jenkins plugin template -->
<!-- copy to Jenkins master server inside JENKINS_HOME/email-templates -->
<%
import groovy.util.XmlSlurper
import jenkins.util.VirtualFile
%>
<STYLE>
BODY, TABLE, TD, TH, P {
font-family:Verdana,Helvetica,sans serif;
@b4oshany
b4oshany / chrome.robot
Created May 26, 2018 02:21
Python Robot Framework with Headless Chrome Setup and Robot Files
*** Keywords ***
Open Chrome
[Arguments] ${url}
${chrome_options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
Call Method ${chrome_options} add_argument --disable-extensions
Call Method ${chrome_options} add_argument --headless
Call Method ${chrome_options} add_argument --disable-gpu
Call Method ${chrome_options} add_argument --no-sandbox
Create Webdriver Chrome chrome_options=${chrome_options}
import numpy as np
import cv2
# for windows, mac users
# from PIL import ImageGrab
# for linux users
import pyscreenshot as ImageGrab
# four character code object for video writer
fourcc = cv2.VideoWriter_fourcc(*'XVID')
# video writer object