r/SeleniumPython • • Nov 01 '24

Looping through a CSV to fill a website form out multiple times

1 Upvotes

I'm wrote this script to fill out a form using a CSV for the required fields. It fills it out once and clicks the submit button, but then it closes the browser and the script stops. I originally had the open browser part outside of the function but even within the loop, the script stops after one input.

import csv
import os
import chromedriver_binary
from selenium import webdriver
import selenium
import time
import dotenv
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.select import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from dotenv import load_dotenv, find_dotenv

load_dotenv('C:/path/credentials.env')
user=os.environ.get("USER")
pass=os.environ.get("PASS")


# Use Google Chrome as the browser to add entries
driver = webdriver.Chrome()
website="https://URL"


#Create function
def LoginToSite(): 
    with open('C:/path/clients.csv', mode='r', newline='') as csv_file:
        csv_reader = csv.DictReader(csv_file)
        for row in csv_reader:
            driver.get(website)
            time.sleep(2.5)
            UserField=driver.find_element(By.XPATH, "/html/body/div[3]/div[2]/div/div[2]/div/div[2]/div/div[1]/div/input")
            UserField.send_keys(user)
            PassField=driver.find_element(By.XPATH, "/html/body/div[3]/div[2]/div/div[2]/div/div[2]/div/div[2]/div/input")
            PassField.send_keys(pass)
            driver.find_element(By.XPATH, "/html/body/div[3]/div[2]/div/div[2]/div/div[2]/div/div[3]/button").click()
            time.sleep(15)
            #Sets variables from CSV file
            ClientName=row['Name']
            ClientDomain=row['Domain']
            ClientAddress=row['StreetAddress']
            ClientCity=row['City']
            ClientCountry=row['Country']
            ClientProvinceState=row['ProvinceState']
            ClientUserCount=row['UserCount']
            #ClientManaged=row['Managed']
            #ClientAccountType=row['AccountType']
            #ClientPermission=row['Permission']
            ClientNotes=row['Notes']
            print(f'Name {ClientName} Domain {ClientDomain} Country {ClientCountry}')
            #Fills form out
            CompanyName=driver.find_element(By.XPATH, "/html/body/div[3]/div[2]/div/div/div[2]/div/div[3]/div/div/div/article/div/flowruntime-flow/flowruntime-lwc-body/div/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[3]/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[1]/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field/flowruntime-lwc-field/div/flowruntime-flow-screen-input/flowruntime-input-wrapper2/div/lightning-input/lightning-primitive-input-simple/div[1]/div/input")
            CompanyName.send_keys(ClientName)
            DomainName=driver.find_element(By.XPATH, "/html/body/div[3]/div[2]/div/div/div[2]/div/div[3]/div/div/div/article/div/flowruntime-flow/flowruntime-lwc-body/div/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[3]/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[2]/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[1]/flowruntime-lwc-field/div/flowruntime-flow-screen-input/flowruntime-input-wrapper2/div/lightning-input/lightning-primitive-input-simple/div[1]/div/input")
            DomainName.send_keys(ClientDomain)
            Address=driver.find_element(By.XPATH, "/html/body/div[3]/div[2]/div/div/div[2]/div/div[3]/div/div/div/article/div/flowruntime-flow/flowruntime-lwc-body/div/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[4]/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[1]/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[1]/flowruntime-lwc-field/div/flowruntime-flow-screen-input/flowruntime-input-wrapper2/div/lightning-input/lightning-primitive-input-simple/div[1]/div/input")
            Address.send_keys(ClientAddress)
            City=driver.find_element(By.XPATH, "/html/body/div[3]/div[2]/div/div/div[2]/div/div[3]/div/div/div/article/div/flowruntime-flow/flowruntime-lwc-body/div/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[4]/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[2]/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[1]/flowruntime-lwc-field/div/flowruntime-flow-screen-input/flowruntime-input-wrapper2/div/lightning-input/lightning-primitive-input-simple/div[1]/div/input")
            City.send_keys(ClientCity)
            Country=driver.find_element(By.XPATH, "/html/body/div[3]/div[2]/div/div/div[2]/div/div[3]/div/div/div/article/div/flowruntime-flow/flowruntime-lwc-body/div/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[4]/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[1]/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[2]/flowruntime-lwc-field/div/flowruntime-dependent-picklists/lightning-select/div[1]/div/select")
            countryselect=Select(Country)
            countryselect.select_by_visible_text(ClientCountry)
            ProvinceState=driver.find_element(By.XPATH, "/html/body/div[3]/div[2]/div/div/div[2]/div/div[3]/div/div/div/article/div/flowruntime-flow/flowruntime-lwc-body/div/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[4]/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[1]/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[2]/flowruntime-lwc-field/div/flowruntime-dependent-picklists/lightning-select[2]/div[1]/div/select")
            provincestateselect=Select(ProvinceState)
            provincestateselect.select_by_visible_text(ClientProvinceState)
            UserCount=driver.find_element(By.XPATH, "/html/body/div[3]/div[2]/div/div/div[2]/div/div[3]/div/div/div/article/div/flowruntime-flow/flowruntime-lwc-body/div/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[5]/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[1]/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[1]/flowruntime-lwc-field/div/flowruntime-flow-screen-input/flowruntime-input-wrapper2/div/lightning-input/lightning-primitive-input-simple/div[1]/div/input")
            UserCount.send_keys(ClientUserCount)
            driver.find_element(By.XPATH, "/html/body/div[3]/div[2]/div/div/div[2]/div/div[3]/div/div/div/article/div/flowruntime-flow/flowruntime-lwc-body/div/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[5]/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[2]/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[1]/flowruntime-lwc-field/div/flowruntime-radio-button-input-lwc/fieldset/div/span[1]/label").click()
            driver.find_element(By.XPATH, "/html/body/div[3]/div[2]/div/div/div[2]/div/div[3]/div/div/div/article/div/flowruntime-flow/flowruntime-lwc-body/div/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[5]/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[2]/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[2]/flowruntime-lwc-field/div/flowruntime-radio-button-input-lwc/fieldset/div/span[1]/label").click()
            Notes=driver.find_element(By.XPATH, "/html/body/div[3]/div[2]/div/div/div[2]/div/div[3]/div/div/div/article/div/flowruntime-flow/flowruntime-lwc-body/div/flowruntime-list-container/div/flowruntime-base-section/div/flowruntime-screen-field[6]/flowruntime-lwc-field/div/flowruntime-flow-screen-input/flowruntime-input-wrapper2/div/lightning-textarea/div/textarea")
            Notes.send_keys(ClientNotes)
            time.sleep(10)
            #clicks Next button
            driver.find_element(By.XPATH, "/html/body/div[3]/div[2]/div/div/div[2]/div/div[3]/div/div/div/article/div/flowruntime-flow/flowruntime-navigation-bar/footer/div[2]/lightning-button/button").click()
#closes browser
#driver.quit()


LoginToSite()

r/SeleniumPython • • Nov 08 '24

Can Selenium click acuarding to string content

1 Upvotes

Hi, my scrapper gonna be linked to an LLM, so the scrapper gonna send the data to LLM and LLM uses the scraped data to tell the Scraper where it should click and then scrape again.

The question is, how should it be done? Can I tell the LLM to choose string of the right options? Or another part should be returned from the output?


r/SeleniumPython • • Aug 03 '24

AttributeError: module 'selenium.webdriver' has no attribute 'PhantomJS'

Thumbnail
gallery
2 Upvotes

r/SeleniumPython • • Jul 29 '24

Selenium Unable book exam slots which are sold instantly

2 Upvotes

I'm working on a Selenium project to book exam slots for the Goethe exam. The booking opens at a specific date and time, and I'm struggling to secure a slot. My current script refreshes the page to detect when the booking button appears and then attempts to click it immediately. However, even if I click the button the moment it appears, the slots are already full.

Has anyone tackled a similar issue? Are there more effective methods with Selenium to achieve this without continuously refreshing the page? Any advice or alternative approaches ?


r/SeleniumPython • • Aug 13 '24

Help can someone help me and tell me why my code is throwing syntax errors? thanks

2 Upvotes

import os
import time
import requests
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.binary_location = '/Applications/Opera GX.app/Contents/MacOS/Opera'
driver_path = 'file_path/operadriver_mac64/operadriver'
service = Service(executable_path=driver_path)
driver = webdriver.Chrome(service=service, options=chrome_options)


r/SeleniumPython • • Jul 13 '24

Help How to click on an Instagram post using selenium

3 Upvotes

Hey everyone,

Trying to build a project and want to click on the Instagram post then collect the username and put it into a csv. Any insights on how I can do that ?


r/SeleniumPython • • Jan 07 '25

Web Scraping Made Easy with Python Selenium | Beginner's Guide to Automa...

Thumbnail
youtube.com
2 Upvotes

r/SeleniumPython • • Sep 27 '23

How to separate multiple pricing options for one product in CSV?

1 Upvotes

Hi all, first time poster here. Been building a scraper for the past few days, but I am completely stuck on how to differentiate between pricing of options for the same product in my CSV. I can pull ALL of the pricing from the menu of items page, but then it will get them out of order in the python lists because pricing for one item with variations/options will end up taking up multiple spaces in the list, and make them match up with the wrong indexes of the item name/brand/etc.

Also, I can't find anything unique and in a pattern via ID, CLASS or XPATH to break the options' pricing up into their own list items.

Can anybody help?


r/SeleniumPython • • Jan 30 '24

Help Code doesn’t work when browser is minimized

1 Upvotes

The selenium code works when the browser tab is visible on screen, but doesn’t when the tab is minimized.

On macOS running geckodriver for firefox, selenium code calls execute_script a lot to run javascript.

Is this a common issue? (and if so how would I avoid this?)


r/SeleniumPython • • Jul 19 '23

issue with iwebdriver and selenium chrome

1 Upvotes

Today in the morning it was working correctly but I update chrome and it doesn't work anymore, it stays like this and starts 😥 does anyone know how to fix it.

I already tried to reinstall the previous version of chrome but it gives me the same error.

My current version of chrome is 115.xx and earlier it was with 114.xx


r/SeleniumPython • • Jan 23 '24

Inserting HTML as formatted text with active link

1 Upvotes

How do I insert HTML text as formatted text with active links into CK-Editor, which doesn't have custom HTML insertion?


r/SeleniumPython • • Jul 18 '23

Python FREE CURSE - Selenium WebDriver with Python

Thumbnail
testautomationu.applitools.com
1 Upvotes

r/SeleniumPython • • Apr 27 '23

100+ Selenium Python Interview Questions: Ace Your Job Interview

2 Upvotes

Are you preparing for a job interview that involves Selenium and Python? Do you want to stand out from other candidates and prove your skills? Then you need to be ready to answer tough questions about automation, web testing, data handling, and more.

That's where this ebook comes in. Written by an experienced Selenium and Python developer, it features a comprehensive list of 100+ interview questions and answers that cover all the essential topics.

Here are some of the topics covered in the book:

Basic Selenium concepts and terminology How to handle web elements and navigate pages Best practices for writing efficient and readable code How to use Selenium with Python frameworks like PyTest and Behave Common challenges in Selenium testing and how to overcome them How to integrate Selenium with other tools and technologies Each question and answer is accompanied by detailed explanations, examples, and references to official documentation and external resources. Don't let your next job interview catch you off guard. Get your copy of 100+ Selenium Python Interview Questions today and boost your confidence and expertise!

Link: https://www.amazon.com/dp/B0C3MXZT85


r/SeleniumPython • • Mar 26 '24

Message: no such element: Unable to locate element:

1 Upvotes

I get this error, despite locating the right element

While running the py file it pops out the below error

Message: no such element: Unable to locate element: {"method":"xpath","selector":


r/SeleniumPython • • Jan 22 '24

Help Unable to discover proper chromedriver version in offline mode in Docker Web App (Azure)

1 Upvotes

I'm running a web app on Azure from a Docker container based on a Selenium image (selenium/standalone-chrome:latest). It ran perfectly fine, but out of nowhere (after changing something unrelated in the data handling section separate from my scraper) started giving me the following error: "Unable to discover proper chromedriver version in offline mode".

The weird thing is that my API is still running fine online; I can get and post requests and from my logs I can see they're received and handled properly up until the chromedriver is initiated (which fails).

The error occurs here during the instantiation of the driver:

# import chromedriver_binary

from selenium.webdriver import Chrome, ChromeOptions

def _GetDriver() -> Chrome:

options = ChromeOptions()

options.add_argument("--headless")

options.add_argument('--disable-gpu')

options.add_argument('--no-sandbox')

return Chrome(options=options) # <--- Error happens here.

def _EnrichAtomicAddress(info: dict) -> dict:

with _GetDriver() as driver: # <--- Only place _GetDriver is called.

data = XXXXXX(driver, info)

data['lastScrapedDate'] = date.today()

data['retrievalDate'] = date.today()

if 'errorMessage' in data:

return data

data.update(XXXXX(driver, data))

return data

My Dockerfile:

FROM selenium/standalone-chrome:latest

LABEL authors="Robert"

# Set the working directory to /app

WORKDIR /app

# Copy the current directory contents into the container at /app

COPY . /app

# Install any needed packages specified in requirements.txt

RUN sudo apt-get install -y python3

RUN sudo apt-get update && sudo apt-get install -y python3-pip

RUN sudo pip install --no-cache-dir -r requirements.txt

# Ports

EXPOSE 443

EXPOSE 80

# Define environment variable

ENV FLASK_APP function_app.py

# Run the Flask app

# CMD ["flask", "run", "--host=0.0.0.0"]

CMD ["flask", "run"]

\# ENTRYPOINT ["top", "-b"]```

I've tried:

- different selenium image versions;

- different selenium images (chrome, edge, firfox, etc) also changing the corresponding webdriver instantiation in Python;

- including my own chromedriver via the Python package chromedriver-binary;

- removing all the chrome options I have set for in _GetDriver();

- reverting the unrelated code chance

yet to no avail.

What is causing this and how can I fix this? Thanks in advance! <3


r/SeleniumPython • • Dec 31 '23

Selenium What is a "W3C WebDriver-compatible clients" in relation to Selenium

1 Upvotes

I'm reading this article about Geckodriver proxy http://www.automationtestinghub.com/selenium-3-0-launch-firefox-with-geckodriver/ and he says that

Geckodriver is a proxy for using W3C WebDriver-compatible clients to interact with Gecko-based browsers i.e. Mozilla Firefox in this case. This program provides the HTTP API described by the WebDriver protocol to communicate with Gecko browsers. It translates calls into the Marionette automation protocol by acting as a proxy between the local and remote ends.

So is geckodriver a proxy between the browser and the selenium script? How can calls to extract data from a webpage sitting in the DOM of a browser translate to the HTTP API? Could someone explain what is going on between a selenium script and a browser that has loaded your webpage: how exactly does the selenium-python script extract the data within the DOM of the browser?


r/SeleniumPython • • Jul 13 '22

Python Selenium Script for adding IPs to VPN Exclusion for new gui - Add button XPATH not working

4 Upvotes

I'm attempting to modify this projecthttps://github.com/oborys/Selenium_automation_Adding_Cisco_Meraki_VPN_exclusion_rules to the current Meraki dashboard setup. I'm running into some issues with the 'add' button on the 'Local internet breakout' box.

I've tried several methods for the locator with various errors.

time.sleep(3)

#button = driver.find_element(By.TAG_NAME, "//a[@class='btn btn-default']")

#button = driver.find_element(By.TAG_NAME, "fa fa-plus plus")

#button = driver.find_element(By.TAG_NAME, 'add')

#button = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.ID, "btn btn-default")))

#button = WebDriverWait(driver, 10).until(By.CSS_SELECTOR, "a[class='btn btn-default']")

button = WebDriverWait(driver, 10).until(By.XPATH, "//a[@class='btn btn-default']")

time.sleep(1)
button.click()

Using selectors hub I've confirmed the XPATH is //a[@class='btn btn-default'] but when I debug I get the error'str' object is not callable. I've appended this to the below line but it never actually clicks it.

button = driver.find_element(By.XPATH, "//a[@class='btn btn-default']").click()

I haven't been able to locate the actual ID to try that. Inspecting the element I see that the below section contains the "Add"<a class="btn btn-default" data-toggle="dropdown" data-domplate="href" href="#rule\\\\\\\\\\\\\\_menu\\\\\\\\\\\\\\_vpn\\\\\\\\\\\\\\_exclusion\\\\\\\\\\\\\\_shaper">Add<i class="fa fa-plus plus"></i></a>

If I try by tag name I get the errorMessage: no such element: Unable to locate element: {"method":"tag name","selector":"//a[@class='btn btn-default']"}

Message: no such element: Unable to locate element: {"method":"tag name","selector":"fa fa-plus plus"}

Message: no such element: Unable to locate element: {"method":"tag name","selector":"add"}

If there is a better method for this I'm open to it but I didn't have much luck using autogui and I'd like this to be able to work from multiple pcs so using selenium would be preferred.


r/SeleniumPython • • Jul 04 '23

Help Tips to reduce Test Automation Execution Times

1 Upvotes

Time is of the importance in today’s fast-paced software development environment. So here are 10 Tips to Speed Up Test Automation. Fast and effective test execution is essential for producing high-caliber software.

Here are 10 tips you may follow if you’re sick of waiting for tests to finish and want to step up your automation game.

1. Recognise and effectively use page elements

How you will identify the objects on the page is among the most crucial factors to take into account while writing automation code. So that your tests pass, you need to perform this in a trustworthy and effective manner.

Adding distinctive characteristics to the items on the website is one significant tactic. This helps prevent flakiness and makes it much simpler for the automation code to find the elements.

You can enhance your locator approach in two more ways besides leveraging distinctive qualities.

Use common locators first, such as ID, name, CSS selector, and link text. Compared to other locators, like XPath, these locators are more trustworthy.

Second, avoid employing link text as a location in your content. Your various tests could fail since the link text is subject to change. Use the href attribute or the link’s entire text as a substitute.

2. Set smart waits

The automation tool can be instructed to wait until a certain condition is met before continuing using smart waits. When an element is not yet loaded or enabled, this can assist prevent errors.

A few pointers for making wise waits:

Use a pre-set series of intelligent waits.

Keep an eye on how well your tests are performing to make sure that smart delays aren’t holding them up.

To ensure that smart waits are used in all new automation tests, adopt a code review procedure.

Go to the repository for code.

3. Streamline your code

Here are some tips for improving your automation code:

Apply the right data structures. Each and every programming language, including Java, Python, and others, has a wide variety of data structures. It is crucial to pick the best candidate for the job because of this.

Reduce the number of HTTP and DB calls. Every time you call a database or make an HTTP request, your code is burdened. Therefore, by caching data that may store multiple values, you can aim to reduce the amount of calls you make.

Alternatively, conditions. You should have another condition if you have an if condition. Instead of doing additional steps and causing a failure at a separate point, this will assist you in capturing failures at the same state.

4. Use the cache memory that the browser itself provides

You can make a cache in the browser itself so that data isn’t constantly fetched from the data server. This will enable you to obtain the info more rapidly by storing it locally.

The cache’s expiration dates can also be configured, and as new data becomes available, the cache will be immediately renewed. Your web automation tests may perform better as a result.

5. Don’t open new browser tabs for every situation

Yes, it’s crucial to avoid starting new browser instances or sessions for every other test case. Making autonomous scenarios at first is one of the keys.

Using the same browser session for a variety of circumstances saves time by preventing the need to set browser preferences, delete cookies, and create cache. This may take longer than doing the test itself.

Additionally, it’s crucial to avoid running numerous scripts in the same browser session. Due to the use of variables and other resources, this would require memory. However, starting a new browser for each script is not required. Instead, it is possible to combine related test scripts into a single browser session and run them all at once.

6. Use the API rather than UI interactions

In some scripts, UI interactions are still required, but in others, API calls can take their place. For instance, utilizing API testing, products can be added to the shopping cart when interacting with an e-commerce site. For necessary operations, such as adding items for checkout scripts, UI interactions can be avoided.

As the Selenium API testing library, REST Assured is also referenced.

To get user feedback, some businesses use user interface (UI) tests, although APIs make the process easier. Utilizing specified functions, functional and API testing could be merged. Through this integration, needless UI interactions can be skipped and the end-to-end flow is streamlined.

7. Disable the unstable visuals and pop-ups

The loading of a large number of graphics and pop-up windows can considerably slow down some apps, such e-commerce websites. In light of the fact that validation is more concerned with the characteristics of the products than the actual photos, blocking image loading may be a useful option.

The majority of contemporary browsers allow you to block graphics. This significantly cuts down on testing time.

Pop-ups frequently come in surprising promotional forms that cannot be foreseen or prepared for in advance. You must build a URL parameter that turns off all pop-ups in order to prevent waiting for them to appear while testing. As a result, testing will go more smoothly and won’t be interrupted by unanticipated pop-up windows.

8. Allow parallel testing

Teams can create numerous machines on a local laptop by using Docker. This enables them to swiftly verify scenarios and perform tests in parallel. However, it’s crucial to make sure that all other tests are independent of one another and do not depend on one another.

Teams can use APIs to fetch data from a database server and process it concurrently. By doing this, you can be sure that each Docker is using the same data.

Testing in parallel has advantages

Shortened test execution duration

Improved test stability and increased test coverage

9. Delete any obsolete code

When managing a big number of scripts, teams frequently overlook irrelevant code. They periodically check the scripts to ensure functionality and get rid of dated code in order to handle this, whether it’s once a quarter or at regular intervals. By using this procedure, the codebase is kept current while also saving time.

A few pointers for clearing out outdated code:

Regularly review your scripts.

Any code that is no longer in use should be noted.

Delete or comment out the outdated code.

Scripts should be backed up before any modifications are made.

It’s crucial to delete code safely even though some people may be hesitant to do so.

10. Execute headlessly

Automated tests can be run more quickly by using the headless execution technique, which disables the GUI. Teams can use headless mode to visualize how the application will look on multiple devices by taking advantage of tools like Chrome emulation. The execution times are sped up by this method.

You can alert the team if a test fails by doing the following:

Utilizing email or a notification system like Slack

Include the test name, the error message, and the procedures to duplicate the error

Organizing the failures into categories will help the team rapidly determine the problem

The tests presently take about 3 hours. It is likely that the runtime would be longer without the optimisations.


r/SeleniumPython • • Oct 04 '23

selenium automation

1 Upvotes

Hey guys....I am using selenium python to automate ERP system but there is a 2F authentication which stops my automation. The 2F authentication usually requires the user to enter the SMS code they receive on their phone. Please let me know how I can bypass this?


r/SeleniumPython • • Feb 03 '24

Help Can’t figure out Autocomplete on Via.com

1 Upvotes

Hey Folks! I am trying to automate the flight booking process on Via.com but I can’t get past the Source and Destination autocomplete dropdowns. Can someone help me out please?


r/SeleniumPython • • Feb 09 '24

Screen resolution issue in switching window

1 Upvotes

I automated window switching with the "switch_to_window" method along with some validation using selenium python. And now whenever I run my test suite in headless=new mode, the second window opens with a screen resolution of 1024*728.

I have used options.add_argument(size) to set the window size to 19201080 while running in headless new mode. It seems to work because my main window is opening with 19201080, but the second window is getting this weird screen resolution. Can anyone please help me?


r/SeleniumPython • • Jul 29 '23

Selenium Chrome Webdriver out of date

Post image
2 Upvotes

My program gets a error "there is no such driver by URL https://chromedriver.storage.googleapis.com/LATEST_RELEASE_115.0.5790". The driver is out of date on this link. I get The original file but on my code I use a reference to it. Someone who do It like me know How did now?


r/SeleniumPython • • Feb 15 '23

Anyone wants to try scraping this using Selenium and Python ? - Public Attorney Contact info

1 Upvotes

Site Fields needed are all fields after clicking the hyperlinked name.


r/SeleniumPython • • Mar 25 '24

How to do properly loop in Seleniumbase?

2 Upvotes

Hello!

I am struggling with doing driver loops using BaseCase on SeleniumBase.

It doesnt work to do self.open() and go to another page for example

How to loop drivers in seleniumbase? (pytest)

Thank you!