Questions tagged [python]

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

Filter by
Sorted by
Tagged with
2 votes
1 answer
3k views

How to use pytest session fixture return value in a test class

I am creating automation framework where in few parameters I have kept in a separate JSON file. I have written the below fixture which would load the data from the JSON file in conftest.py. import ...
  • 21
0 votes
1 answer
499 views

Code coverage tool for Python Web application tested by Java selenium tests

I have Web Application where the source code is in Python. All the regression tests are in Java. I wish to perform Code Coverage for the application. Please suggest a code coverage tool to instrument ...
0 votes
1 answer
252 views

Error while launching RIDE

I have installed Robot framework and installed wxPython and then Ride. When I launch it by executing python ride.py, it runs into an error as shown below. I believe it has something to do with the ...
2 votes
2 answers
4k views

Find element with BeautifulSoup in python [closed]

I'm still learn to code with python. I really need help to scrape the element from this website: https://www.tokopedia.com/craftdale/crossback-apron-hijau-army?src=topads I want to get Review data (...
0 votes
1 answer
360 views

Find element in multi layer pages for single website

I want to scrape this marketplace data https://www.tokopedia.com/search?st=shop&q=dapur but to get the data, that I want, I must go through pass some layers in the page. In this case this web have ...
2 votes
2 answers
11k views

Find button class with Selenium on Python

I scrapping the marketplace from this URL https://www.tokopedia.com/sunxin I want to get the data from the button called Info Toko, if user click this will shown a pop up content: The original source ...
1 vote
1 answer
53 views

Variable in Xpath is not working

#driver.find_element_by_xpath('//div[@id="groups"]/div/div/div/div/div[2]/div[1]/div/div/button').click() i = 5 gPath1 = str("\'//div[@id=\"groups\"]/div/div/div/div/div[2]/...
3 votes
1 answer
82 views

Unable to extract table content from webpage using selenium

I am trying to extract the tables generated by selecting "Branches", a city and a district from this site: https://www.acb.com.vn/wps/portal/en/atm So far, I have been able to write the code ...
2 votes
1 answer
411 views

Using loop how to get dataframe from each next pages and store table values using Selenium Python

https://seffaflik.epias.com.tr/transparency/tuketim/gerceklesen-tuketim/gercek-zamanli-tuketim.xhtml from the above website, I've achieved to enter date picker for two date range and then clicking &...
1 vote
1 answer
2k views

Using sendkeys multiple times to scroll down

I am trying to scroll down a drop-down menu, but since scrolling with a mouse will just scroll the page instead of the drop-down, I thought of using sendkeys by sending DOWN_ARROW multiple times. ...
  • 11
1 vote
1 answer
2k views

Selenium thinks button is clickable even when disabled

I'm having an issue where Selenium is saying a button is clickable even, when it's disabled. I'm using Selenium with a website, where you have to select a date 1st and then time slot from a drop-down ...
  • 113
0 votes
0 answers
103 views

Selenium drop down menu can't locate 11th element

Trying to scrape data from https://www.sgx.com/research-education/securities and the code below works but only for the first 10 iterations after which it throws a NoSuchElement Exception. Starting ...
  • 11
1 vote
3 answers
335 views

Why does Google Chrome initiated through Selenium shows less attributes for anchor tags compared to normal Chrome session?

I'm trying to scrape some image href attributes from the <a> tags from a Google search using Selenium, ChromeDriver and Chrome. When the url is accessed manually I'm able to locate the required ...
0 votes
1 answer
537 views

Can Robot Framework framework iterate over example data?

The BDD sample below is written using Katalon Studio Scenario Outline: Verify Price of <plan> Plan Given <accountType> account is currently logged in When User navigates to Publish ...
  • 121
-1 votes
1 answer
5k views

How to configure path for file download in python-selenium

I have changed the path of file download from using below code. chromeOptions=Options() chromeOptions.add_experimental_option("prefs", {"download.default_directory": r"C:\...
0 votes
1 answer
5k views

Get most recent downloaded file using python-Selenium

My Python-Selenium script is downloading the particular file but the file is taking long time to start and get completed downloaded. It starts after clicking in 25/30 seconds and completed in 50/55/60 ...
0 votes
1 answer
250 views

Electron Application toolbar automation using selenium python

Is it possible to automate the tool bar options like File. Edit, View , Window and Help options using Selenium webdriver with python?
0 votes
2 answers
205 views

Trouble logging on to a website with selenium web driver

I'm fairly new to developing but I'm having a problem logging into a website. The code I have currently typed in the username, password, and correctly clicks the log in button. However, the page ...
1 vote
1 answer
5k views

Find Text without span Text - Python - Selenium

I want to get text that is stored on an element. Text is not a property instead when I expand Element (in chrome's inspection [DevTools]) it has two sub-properties, span and text. it looks something ...
-1 votes
2 answers
1k views

How to get incremental xpath for newly added rows in webtable using robot framework-python-selenium

I came across a certain requirement. There is a web table where new rows are added daily.I want to write an automation script in Robot Framework-Python-Selenium-Eclipse-RedEditor Plugin. Right now, I ...
  • 21
1 vote
1 answer
4k views

Find childs of element without sub-childs - Python - Selenium

I'm trying to create a bot. The functionality I need now is to find a way to get only childs of an element without sub-childs. Take this as example: <Body> <child1>Hi</child1> ...
0 votes
1 answer
510 views

Not able to get all values from a table with selenium chrome webdriver using python [duplicate]

I want to know the way to collect all the information from a table from a web page. At the moment I am able to get only the records which are visible in UI. (18 rows). However there are 96 rows in ...
1 vote
3 answers
10k views

How can I get the value from span class in selenium?

In the code above, how would I get the span class value (238.67) to show up? What would I exactly use?
0 votes
0 answers
445 views

getting error :: 'TestLogin' object has no attribute 'driver'

Below is code of my framework for testing which I am building, but I am getting the error 'TestLogin' object has no attribute 'driver'. Confest.py code: import pytest from selenium import webdriver ...
1 vote
2 answers
144 views

Best way to architect test development in Python so that tests can be run either with a mock or without a mock?

I'm starting a fresh python project and I want to write unit and integration tests with mocking and stubbing. However, I would like to run these tests during the build-pipeline against actual services ...
1 vote
1 answer
2k views

Element <div class="gQzdc _3sdhb"> is not reachable by keyboard

I'm trying to scrap WhatsApp using python selenium. I'm trying to find name by locating the search box and typing the name over there. But I'm getting error as Message: Element <div class="gQzdc ...
0 votes
2 answers
2k views

How to select values from dynamic drop down using selenium?

My code: from selenium import webdriver driver = webdriver.Chrome(executable_path="D:\\Work\\chromedriver.exe") driver.get("https://www.makemytrip.com/") print(driver.title) print(driver.current_url)...
2 votes
1 answer
886 views

How to fetch username and password from excel one by one to test login functionality in robot framework-selenium-python

I am trying to login to my application one by one using different credentials in robot framework-python-selenium but it is not working. Below is my code. Please suggest. Open Browser ${URL} chrome ...
  • 21
2 votes
2 answers
97 views

Is it possible to add specific tests to the collected tests?

I'm using pytest with Appium for mobile testing. I have multiple test cases and scenarios, and all of them must start with the same specific test steps. I don't want to write this steps in all other ...
  • 43
2 votes
2 answers
89 views

Help me please, how to upload file. File-input appended on click, but on click it opens OS native window

Can not upload a file. DOM elements: <button type="button" id="button-upload" data-loading-text="Loading..." class="btn btn-primary"><i class="fa fa-upload"></i> Upload</button&...
  • 21
0 votes
1 answer
5k views

failed: ModuleNotFoundError: No module named 'robot.parsing.populators' error

I was using python 3.6 for robot framework and selenium. As my client wants to upgrade to python 3.7.1 we did that. Now facing issue in running my automation scripts with the message as failed: ...
  • 21
1 vote
1 answer
44 views

How can i get an xpath or any other element for these drop downs, ? Select options or the (Sendkeys) works

How can I get an XPath or any other element for these dropdowns? Now for the first drop down with the value= 'Adrian Clarke,' I was able to get the Xpath and run it successfully. For the second drop-...
0 votes
1 answer
892 views

Rrror on running selenium python script - self._execute(self._execute(Command.SEND_KEYS_TO_ELEMENT,)

I am using selenium with python and I try to click on element below. But every time shows the error (in starting was working) only getting error on this line and have tried CSS selector id and all ...
0 votes
1 answer
173 views

Jenkins Headless Chrome Causes Staleness Errors

After about a month of creating and ironing out my Selenium automated tests, I finally added it to a Jenkins pipeline. I didn't expect it to succeed on the first try, but I didn't expect to get errors ...
2 votes
1 answer
1k views

Rrror on running selenium python script - self._execute(Command.CLICK_ELEMENT)

I am using selenium with python and I try to click on element below. But every time shows the error (in starting was working) only getting error on this line and have tried CSS selector id and all. ...
2 votes
1 answer
4k views

How to pass 3 variable to threadpoolexecutor “map”

The below code will show the issue with map func as the 3 args to login function very important import requests import random import concurrent.futures data = open("data.txt","r")....
  • 23
0 votes
1 answer
1k views

Importing test library 'AutoIt' failed: ModuleNotFoundError: No module named 'AutoIt' Error

I am trying to file upload in modal form using robot/eclipse but its not working. I added autoit library to red.xml. Giving below error . Below is my code for file upload Click Element xpath=//*[@...
  • 21
-1 votes
1 answer
26 views

“log in ” website with requests and threading “python”

I want to login to website but using threading and see many tutorial and can't find my situation import requests data = open("data.txt","r").read().splitlines() #loding the username and password ...
  • 23
0 votes
2 answers
5k views

How To Print The Text Of All Elements From List In Selenium Python?

Below is the sample class with its sample code: from webdriver_manager.chrome import ChromeDriverManager from selenium import webdriver from selenium.webdriver.common.by import By class Sample: ...
  • 3
3 votes
1 answer
1k views

Fails with Dictionary has no key even after validating key exists

I have a scenario where I need to do different set of actions depending on dictionary key and value Dictionary can be any of the below &{DICT_VAL_APPLINPUT}= Create Dictionary status=...
  • 33
0 votes
1 answer
801 views

Dropdown value disappears when I move to next dropdown

I am trying to scrape some data using the following code. When I run the code line by line, it works fine. However, when I want to run all code at one go, the dropdown options go blank and as a result,...
  • 3
1 vote
1 answer
1k views

How to select third tab on same class name by selenium python

I just jump into python programming. I couldn't solve this I tried to several ways This is target site <div class="base-components__BaseElement-sc-150tvch-0 sc-VigVT bJRDeW"> <ul role="...
  • 13
1 vote
1 answer
93 views

Selenium + Python: Abort a test after x minutes

Details My test scenarios currently cover over 300 test cases. Everything is written in Python (3.8) and Selenium and all test cases are covered by exceptions. At the moment there is only one ...
  • 1,189
1 vote
1 answer
3k views

Python Selenium to click element in table that another element is present

I am trying to create a scrapper that enters a website and downloads an XML file containing a balance sheet from real estate funds. With the code below, I enter a website for a specific fund with ...
0 votes
1 answer
337 views

Extracting all reviews of particular app from Google play store website

import time from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by ...
0 votes
2 answers
272 views

How to deal with changing xpath, when the static parts of the class name and id, are the same as the other input fields?

I am stuck at a point where I need to fill out an input form. However the full xpath is dynamic, and the static parts of the element is the exact same as the static parts of another element. So I can'...
0 votes
1 answer
204 views

Is there any possibility of semi-automated text execution in selenium? [duplicate]

Can one semi-automate the test execution, say there are certain things that we can`t do using selenium like captcha issue, so is it possible to start the script, perform some task manually and ...
-2 votes
1 answer
308 views

Testcase Python Request: 405 Error despite not accepting the certificates

Details Currently I have the problem that I cannot accept the certificate on our test page. We use Python requests for our test cases and unittest from Python directly. We have also excluded the ...
  • 1,189
0 votes
1 answer
493 views

Launching Twitter through Appium on a real device results in an error

I've just started using Appium with Python and I'm running into trouble when trying to launch the Twitter app. I have tried to launch the play store by typing: adb shell "dumpsys window windows | ...
  • 11
0 votes
0 answers
45 views

How to Access span element and change it's value

I am trying to create a python + selenium script in order to fetch CSV from a salesforce pardot page. Can Somebody please help me in accessing the nested span element inside the dropdown list which ...

1 2
3
4 5
11