Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [python]

Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability.

0
votes
1answer
20 views

python selenium - waiting for item to load (stale element reference error)

I am executing a script which clicks through a number of pages to retrieve data. After each click the new page obviously has to load and the time to load varies greatly (mostly 2-3 seconds, sometimes >...
0
votes
0answers
23 views

Cannot Get Selenium to select a dropdown menu (PYTHON)

I swear iv'e tried everything so, I'm finally directly asking for some help on this. So basically I am trying to select the 5 value (May) I am able to click on the box to open the dropdown menu but, I ...
0
votes
1answer
22 views

Selenium Python - Unable to find an element, get stale element exception when using element locator

Scenario: 1.Login to a website using script and navigate to the Home page. 2. On the home page, click a link and navigate to a new page. 3. Then navigate back to the home page using the top navigation ...
3
votes
1answer
63 views

Can't drag and drop from source to target using selenium and python

I am trying to drag and drop using Python and Selenium. I have two containers with rows which indicate file names and by drag and drop, I want to transfer one file from the first container to the ...
0
votes
2answers
49 views

Python expected an intended block error if/else [closed]

Hello im getting in this script an indentationError time.sleep(3) driver.find_element_by_id("mainMenuRoutes").click() time.sleep(1) time.sleep(2) if driver.find_element_by_xpath('//*[@class="m-btn ...
0
votes
3answers
50 views

Python Selenium Find Button

I have a Website were I want to click a button, but I can't find in the button in the HTML script, what I have to write in my Python script? Later I want to have something like driver....
0
votes
0answers
28 views

Email Verification

I want to make steam Accounts in bulk and need email verification. How would I login into POP3 & confirm the email? I'm just looking for it, What code should I start since many on the web are ...
0
votes
2answers
39 views

SyntaxError: invalid syntax // SyntaxError: unexpected EOF while parsing

How do I detect text inside of this, this is HTML & this is XPath. I tried HTML <span class="messageText">Hello.</span> XPath //*[@id="liveAgentChatLogText"]/span[22]/span[2] ...
0
votes
1answer
51 views

Selenium XPath Invalid Syntax [duplicate]

element = wait.until(EC.presence_of_element_located((By.XPATH, '//*[@id="liveAgentChatLogText"]//*[contains(string(.), "THE_TEXT_STRING_I_AM_LOOKING_FOR")]') driver.find_element_by_xpath('//*[@id="...
0
votes
0answers
30 views

How do I make Regex work with Selenium Wait?

html = driver.page_source re.search(r"<span class="messageText">(.*)<", html) (edited) But I want it to work with wait = WebDriverWait(driver, 10) element = wait.until(EC....
0
votes
1answer
19 views

Running test suite from both terminal using pytest and unittest runner but show only unittest runner results and execute once

i am trying to execute my following test suite: import unittest from Login_Page import LoginPageAndLogout def test_suite(): # get all tests from classes login_test = unittest.TestLoader()....
0
votes
0answers
138 views

How to simulate onclick using Selenium/Python

I am using Python/Selenium to click on an icon on a web site to add it as one of my condition. It's making a Javascript call. I've tried find_element_by_css_selector and execute_script but was unable ...
0
votes
0answers
14 views

Mocking file access functions in PyTest

I was trying to implement unit tests for a YAML configuration file class. These tests work properly, however I intended to use PyTest as a testing framework, while for mocking file functions I came ...
3
votes
2answers
86 views

Fetch all the links on a page that are within the same class

Quick Links <span class="buttonContainer"><input type="image" class="helpButton" src="/images/buttons/btn_help.gif" alt="View help." title="View help."><input type="image"...
0
votes
1answer
38 views

How to run Robotframework test cases in a particular order from different suites?

We have at least ten test suites each having at least 10 test cases. I would like to know if there is a way to run selected tests from each of the suites in an order I would like? For Example., the ...
-1
votes
1answer
49 views

Pop up handling in Selenium using try and except block gives a broad exception warning

try: if browser.find_element_by_xpath('//[@id="s"]/a').is_displayed(): browser.find_element_by_xpath('//*[@id="s"]/a').click() browser.switch_to.default_content() ...
0
votes
1answer
4k views

ElementNotVisibleException: Message: element not visible Selenium in Python

I'm trying to click an options from a website dropdown menu but I am not able to click. I am using "xpath" locators for the element and I upgraded my chrome to the latest version for chromedriver. ...
0
votes
1answer
60 views

Unable to capture the alert in Selenium using Python

I am trying to test a web portal using Selenium and Python. The problem is, I am unable to get around an error, in other words, I am unable to catch the alert. Scenario: Search for a user, if the ...
0
votes
0answers
60 views

How to send XML POST request with query parameters in Python

I am writing a python code to simulate the action that am doing in SOAPUI. Here is what am doing in SOAPUI Below are the post methods: I have a endpoint+recourse Select method as post Parameters ...
2
votes
1answer
52 views

Selecting usernames from a list using selenium

This is the code I have used so far: username = browser.find_element_by_id("field67041336") email = browser.find_element_by_id("field67041337") mobile = browser.find_element_by_id("field67041338") ...
1
vote
1answer
73 views

How to properly mock dependencies

My code is organized as several independent classes. Each dependency is injected by a setter, so in the end I create instances of classes B and C, set their parameters and inject them to class A. Now ...
0
votes
1answer
34 views

Unit testing for chains of generators in Python

I want to write unit tests for methods that take a generator as input and produce a generator. I am building on this answer. For this question let's take the method: def candidates_for_deletion(self,...
0
votes
1answer
104 views

How to make while loop for example 5 automatic registration account

How to make while loop for example 5 automatic registration account this is my code and I want to make an automatic python script for 5 registration account from selenium import webdriver driver = ...
0
votes
0answers
43 views

selenium element.text() different on two different computers

What would make element.text() give different outputs on two different computers? I wrote a scraper with python and used pyinstaller to make it into a .exe file. I am using the same file on each ...
0
votes
1answer
868 views

How do I use find_elements_by_xpath to only get some elements in python selenium?

How should I use driver.find_elements_by_xpath() to get all the data-row elements that I boxed in the picture. I do not need the other tr tags. In my current code I just check all the tr tags and ...
0
votes
1answer
250 views

Does implicitIwait affect set_page_load_timeout python, selenium, chrome driver

I have a scraper where I have: driver.set_page_load_timeout(30) and driver.implicitly_wait(10) Does implicit wait affect the driver.get() call? I was wondering if my 10 second implicit wait ...
0
votes
0answers
23 views

How to write two value in same row csv with python

I have two informations (number of men and number of women) and I would like to store them in the same row of the csv named (population): nb_femme=soup.find_all("text", {"class" : "...
1
vote
1answer
185 views

How do I remove unnecessary console message pop up using selenium with Python?

When I used Chromedriver with selenium in python, I get a lot of console messages that are not useful to me and that don't affect my scraper. How do I not output these? I do not have this issue when I ...
0
votes
1answer
24 views

How to test a class that wraps methods connect to a remote database

I wrote a class creating connection to a remote database, query and do some more actions on that. Which is the best way/ strategy to test that kind of class? I tried to mock third party functions ...
0
votes
0answers
24 views

Test Impact Analysis tool for Python

Is there a Test Impact Analysis (TIA) framework/tool/extension for Python? E.g. an equivalent to JAVAs Test Impact Analysis Plugin for jQAssistant?
0
votes
0answers
34 views

Architecture unit testing for Python?

Is there an equivalent to the JAVA architecture unit test framework ArchUnit for Python?
0
votes
0answers
221 views

Selenium web driver issue with Action Chains drag drop when native functions work fine

While trying to automate using Selenium webdriver and python I am facing the following issue: Simple click is working without action chains class: element.click() But trying to click is not working ...
0
votes
2answers
868 views

Can't find any element using CSS selector with Selenium on Python

I'm running a script on vodafone.co.uk but I can't find any element using the CSS Selector. browser.get("http://freesim.vodafone.co.uk/") browser.find_element_by_css_selector("#frmNew > div:nth-...
1
vote
1answer
109 views

What Python tool support automation of Sciter based desktop application

I have been using pywinauto for automation of desktop application. This tool was fine until we started using Sciter (see https://sciter.com for more info) on some screens. Pywinauto supports Win32 API,...
0
votes
0answers
39 views

Run a selenium script on selecting the script from a multi-select in django

on a webpage there is a multi-select drop-down, once user selects any option from the drop-down, the required selenium script must run. index.html <div class="form-group"> <label class="...
1
vote
1answer
2k views

Download pdf in headless chrome and selenium

Script.py profile = {"plugins.plugins_list": [{"enabled": False, "name": "Chrome PDF Viewer"}], # Disable Chrome's PDF Viewer "download.default_directory": source_dir, "download....
0
votes
0answers
25 views

How can I make the login page methods static for selenium scripts?

Below is my code for my login page, I tried to make these methods @staticmethod, I tried to do the same by adding the @staticmethod syntax , but the problem is , after that i cant access self.driver ...
0
votes
1answer
76 views

Performance issue - Robot Framework vs Python

I am currently working on the development of a keyword that allows to separate the contents of a text file into 2 parts and create 2 new files containing each of these 2 parts. The file format is ...
1
vote
0answers
46 views

how to plot multiple locations in google.map using flask [closed]

i'm traying to showing multiple points in map from a csv file named 'likibularochelle_test.csv' this file contains 866 points with latitude and longitude but i can't view all of this points just 33 as ...
0
votes
1answer
71 views

Get certain text from website using Selenium

I'm trying to copy a certain string of a website's source code using selenium. This is the page's source code: <body data-gr-c-s-loaded="true">{"url":"https:\/\/shop.website.com\/cart\/...
0
votes
0answers
160 views

Python Kivy ScrollView is not scrollable

from kivy.app import App from kivy.lang import Builder from kivy.uix.screenmanager import ScreenManager, Screen from kivy.core.window import Window Builder.load_string(""" <But@Button>: ...
0
votes
1answer
88 views

Python stops after opening webdriver

from selenium import webdriver driver = webdriver.Chrome("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe") driver.get("https://www.google.com/") Hello, I am new to selenium and i have ...
1
vote
1answer
33 views

How do I put validations or assertions in choosing the particular file format?

I am using Robot Framework with Python and Selenium. I need to verify that files have the correct format: specifically that they are image files (e.g.: .jpg, .jpeg, etc). How do I use validations or ...
0
votes
3answers
2k views

ElementNotVisibleException: Message: element not visible

I've seen this error everywhere, but none of the solutions have seemed to work. This is my code: contpayment = driver.find_element_by_class_name('nsg-bg--nike-orange') contpayment.click() Python/...
0
votes
0answers
56 views

Selenium Python - go to the next pages

I am currently writing a python selenium script to scrape the "Likibu.com",it is a website that offers short-term accommodation such as Airbnb, booking ... I have successfully got all data that exists ...
0
votes
1answer
188 views

Error while executing javascript code in python3 while using selenium

I was trying to remove the ad and other pop-up using selenium after opening the webpage. The pop-up is getting removed but the ad is not getting removed. There is some error in executing javascript ...
0
votes
1answer
660 views

How to open browser with extension already enabled

I get the following code to open chromedriver with extension but this extension is disabled, Is there any way that when chrome is launched, it launch with enabled extension - chrome_options = ...
0
votes
0answers
59 views

using selenium with oracle JET applications

I am trying to write some python selenium scripts to automate testing of an Oracle Jet application. I used firefox's seleniumide to capture a testcase for the login page, but when I run the python ...
0
votes
0answers
15 views

Django: Need for catching unwanted exceptions?

Actually, I was a developer and also doing the white box testing of Django view functions. I have already done a lot of application, my way of testing was I will write test cases for all possible ...
-1
votes
3answers
2k views

How to Iterate and loop the select Options in dropdown box using Selenium with python?

I want to select an apple and then after "save and Go" then after it should select an orange like the way it should iterate till coconut, at end of the list it should be select 'Save & Hold'. I ...