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
-1 votes
1 answer
3k views

In Selenium using Python facing error unable to locate element

from selenium import webdriver from selenium.webdriver.common.keys import Keys # create a new Firefox session driver = webdriver.Firefox() driver.implicitly_wait(30) driver.maximize_window() # ...
dhanashree saraf's user avatar
1 vote
0 answers
78 views

Open a clickable link on a web page and take the screenshot at the same time

I'm new to Chrome headless and I have a problem. I want to randomly select two links from a web page on the page being viewed and open them at the same time. Indeed my goal is to be able to have the ...
Lionel Noutegne's user avatar
-1 votes
1 answer
43 views

Testing Question in Selenium Python

How to get required item hrefs in a flipkart page? This is my code: from selenium import webdriver driver = webdriver.Firefox(executable_path ="/home/yegaiah/Desktop/geckodriver") website_URL ="...
Yegaiah bellamkonda's user avatar
0 votes
3 answers
2k views

How to identify the web-element for a Text Box using Selenium

I am attempting to locate the empty textbox by the input id 'Department_input' <input id="Department_input" type="text" aria-required="true" size="40" class="field_input ui-widget-content" ...
pythonLearner2000's user avatar
4 votes
1 answer
9k views

Selenium: how to prevent a just-started Chrome window from receiving focus

Using Selenium + chromedriver on Linux, like so; chrome_options = Options() driver = webdriver.Chrome('/usr/bin/chromedriver',options=chrome_options) driver.get('https://www.somewebsite.com') Chrome ...
Roel Van de Paar's user avatar
2 votes
1 answer
2k views

Need help sending text to field

Using Python and Selenium, how can I send text to an element, that is 'hidden?' When trying to do it, I'm getting errors, that the element is obstructed by another element. The field I'm trying to ...
cjg123's user avatar
  • 131
2 votes
3 answers
114 views

Are there any good links and references for learning how to create an Appium Python Framework?

Are there any good links and references for learning how to create an Appium Python Framework? There seem to be a lot of Java information out there, but Python seem to have a lot less available ...
seleniumappiumnewbie's user avatar
0 votes
1 answer
2k views

How can I improve this python pytest excel data handling code? Does pytest have something like TestNG dataprovider?

Does Python Pytest have anything similiar to Java TestNG DataProvider where you can pass in a set of data for the tests? I created something to take the data from my excel list using openpyxl and it ...
seleniumappiumnewbie's user avatar
1 vote
1 answer
3k views

Selenium can't click href

I want to click on a href(all of the delete ones), but can't <a href="#delete"><img height="16px" width="16px" src="/images/icons/trash_16.gif"></a> I've tired (both delete and #...
Grzegorz Ziółek's user avatar
2 votes
4 answers
3k views

Issue using XPath

I'm using Selenium and PyCharm. Website: https://www.expedia.com/ I'm trying to click() on the Search button. I used these: driver.find_element(By.ID, "search-button-hp-package").click() ...
rodut's user avatar
  • 197
1 vote
1 answer
13k views

Selenium | Locate elements via custom attribute

I'm new to test automation with Selenium (Python) and just wondering if it makes sense to locate elements on webpages via a custom attribute? In some places the IDs of the elements are generated and ...
Matze's user avatar
  • 21
0 votes
1 answer
533 views

Adding Chrome extension in Selenium / Python / Ubuntu

I am having problems in adding extensions in Chrome before Selenium tests, using Python. On the code side, it's pretty simple: options = Options() options.add_extension(/path/to/extension) webdriver....
João Farias's user avatar
  • 10.9k
1 vote
2 answers
243 views

Strange drop down automation problem - multiple select

I've tried for days to figure this one out. I have a selector that I can't figure out. It seems to be a regular select statement with multiple options but when clicking one option directly it ...
Brian H's user avatar
  • 11
-1 votes
1 answer
402 views

Mac + PyCharm + Python 2.7: ImportError: No module named appium

I just changed PyCharm application from Professional to community and in my v first run I am getting below error. Prior this all tests was working correctly as expected: ImportError while importing ...
Narendra Chandratre's user avatar
1 vote
0 answers
2k views

Selenium headless browser - setting default page zoom

I have a problem with browser zoom in Google Chrome and FireFox. I have one button that is overlapped by another element (my page always have 100% zoom and is very bad for me because a lot of elements ...
QAP's user avatar
  • 11
3 votes
2 answers
226 views

How do you test an application that uses current time?

In an interview, they asked me to write a program to get current (live) time of given states in a list. I have written the code for it and was asked to tell how I would test the program to check if ...
joey's user avatar
  • 131
0 votes
2 answers
544 views

Python Selenium code is not able to double click on a webelement when multiple tests are run together but works when tests are run individually

Posting the code snippet for abc in self.driver.find_elements_by_xpath( "//div[@class='ag-body-viewport']//div[starts-with(@class,'ag-row')]"): ...
learner's user avatar
0 votes
2 answers
492 views

Can't switch control on elements of a chatbot using selenium in python

I am trying to send a message as input to chatbot to check the response but when I am trying to send a message to a chatbot, I need to click on the input box where one can enter a message. But it is ...
Shreyanka Manekar's user avatar
0 votes
2 answers
4k views

Reading values from CSV file and convert it to json in python [closed]

my code : import csv import json with open('file.csv', 'r') as f: reader = csv.reader(f, delimiter=';') data_list = list() for row in reader: data_list.append(row) data = [dict(...
Thamilvendan Perumal's user avatar
0 votes
2 answers
60 views

Loop Phyton / Selenium [closed]

I have a piece of code in Pycharm , and I want to loop just a part of it, not with the beginning part where are located the login info. Let's say that I want to loop from the 44 line to 99 and only ...
Alex Alex's user avatar
1 vote
1 answer
71 views

Page doesnt change / next

Why the page doesn't change, but also don't receive an error in console. Can someone please help me in this case? driver.find_element_by_link_text("»").click()
Alex Alex's user avatar
1 vote
2 answers
378 views

Can't click a button

I have this code: I have a problem clicking a button. driver.find_element_by_xpath("(.//*[normalize-space(text()) and normalize-space(.)='Editează'])[20]/following::a[1]").click() And I ...
Alex Alex's user avatar
1 vote
1 answer
62 views

Problems with login

I have this code: Enter Username or Email elem = driver.find_element_by_id("id_username") elem.send_keys(user) Enter Password elem = driver.find_element_by_id("id_password") elem.send_keys(pwd) ...
Alex Alex's user avatar
1 vote
1 answer
86 views

How can my mac be setup to run both appium/selenium with java and python without conflict?

How can my mac be setup to run both Appium/Selenium with java and python without conflict? Are there steps I should take and things I should avoid? What things should I look out for? My mac is setup ...
seleniumappiumnewbie's user avatar
2 votes
1 answer
1k views

Unable to locate button in Selenium using Python

I have this HTML code: <button> class="btn btn-lg btn-primary btn-block" type="submit">Autentificare</button> input type="hidden" name="next" value="/"/ Using below locator I'm not ...
Alex Alex's user avatar
1 vote
1 answer
6k views

Selenium python drop down menu select

I need to select an element from a drop-down menu. The dropdown menu has two value and I need to select the second "sponsor.com" <select tabindex="1" name="userDomain" onchange="javascript:...
benkimon001's user avatar
0 votes
0 answers
107 views

Autosuggest with selenium and python

I have below requirement to do the automation using selenium and python. Can someone please help me with the code: Enter the exact query string in the search box In the auto-suggest, the exact name ...
Krishna Goswami's user avatar
0 votes
1 answer
633 views

How can I set the language of Safari and launch using Selenium?

I need to launch the Safari browser for automation with a specific language(Korean) for automation purpose. I am using selenium with python for automation. How can I do that ?
Sreevalsa E's user avatar
0 votes
1 answer
221 views

Appium 1.10.0 + iOS : Unable to accept permission alert

Team, I am facing issues to accept the permission on iOS using Appium. I have tried below options: capabilities.SetCapability("autoAcceptAlerts", true); driver.switch_to_alert() driver.findElement(...
Narendra Chandratre's user avatar
0 votes
1 answer
13k views

How to get src link using Selenium?

The task is simple: to extract the link of an audio of pronunciation for a word from a Yahoo Dictionary Webpage: e.g. Yahoo's Dictionary@ "real" Using "Chropath", I can locate the Xpath of the ...
KCT's user avatar
  • 1
1 vote
1 answer
237 views

Interacting witrh elements in the new link using Selenium(Python)

I am writing a Python script for interacting with the Spotify Webplayer. Initially I have to login by entering the credentials. After I click the login button and I get redirected to the webplayer ...
user423865's user avatar
1 vote
1 answer
174 views

Appium 1.10.0 + Android : Unable to accept permission alert

Team, I am facing issues to accept the permission on Android using Appium. I have tried below options: capabilities.SetCapability("autoAcceptAlerts", true); driver.switch_to_alert() driver....
Narendra Chandratre's user avatar
0 votes
1 answer
221 views

Python Dryscrape - how to select child element?

I'm working on a project with www.NJMLS.com. I'm trying to extract email of agent name "Edward An": import dryscrape as d d.start_xvfb() br = d.Session() br.visit('http://www.njmls.com/...
Haroon Amjad's user avatar
0 votes
2 answers
402 views

How to handle multiple authentications in Selenium

Lets say for example that I have page A that prompts for HTTP Basic Auth. If correct login credentials are provided, user is redirected to another B site that has another HTTP Auth. How would you ...
phoez's user avatar
  • 1
2 votes
1 answer
4k views

How to download in headless mode with selenium?

I have a test running to download files from a website, the files download okay without the headless argument chrome_options.add_argument('--headless') but as soon as I add this line nothing downloads,...
ron's user avatar
  • 21
0 votes
2 answers
301 views

login for https url having https different url for browser popup in selenium python

I have url https://dc1-common.naops.exu.xxxx.se/cgi-bin/index.pl and after entering I got another url https://dc1-common.naops.exu.xxxx.se with Sign In Browser pop up which requires for Authentication ...
Satya Mishra's user avatar
1 vote
0 answers
840 views

Attach Existing browser session in SeleniumLibrary RobotFramework

I have an LDAP alert box that pops up as soon as the browser is opened. I am Using Robotframework with the seleniumlibrary for my automation scripts.The issue is that the execution of the script ...
Muffadal's user avatar
1 vote
1 answer
4k views

find_elements_by_xpath issue!

I'm trying to complete the basic python Selenium demo (https://selenium-python.readthedocs.io/getting-started.html) but I'm attempting to do that same procedure on https://www.ncbi.nlm.nih.gov/. ...
Auraius's user avatar
  • 11
1 vote
0 answers
48 views

Testing of console tools

From my previous experience, I am used to write tests for either unit testing or integration/deployment testing. Now I am facing the challenge to write automated tests for a console tool using a ...
J. Doe's user avatar
  • 121
0 votes
1 answer
678 views

xPath (SCRAPY) Python using two attributes together

For example : <html > <body> <a class="abcd" title="he is Gandhi"> he was good </a> <a class="bcde" > he was very good </a> <a class="abcde" title ...
xyz's user avatar
  • 1
1 vote
4 answers
3k views

Python Selenium unable to login by clicking on Button inside a form

website:https://www.etoro.com/login <button automation-id="login-sts-btn-sign-in" ng-click="loginCtrl.login(loginForm)" class="e-btn-big wide dark pointer">Sign in</button> I am trying ...
Shiv's user avatar
  • 11
1 vote
2 answers
875 views

Recommended project structure for Pywinauto project

I'm used to Selenium and the page object pattern. I'm now moving to an automation project for a Windows app, so I'm discovering Pywinauto. I've be looking for good practices and was expecting ...
Y-B Cause's user avatar
  • 179
1 vote
1 answer
2k views

Python Selenium - How to get the "Close" text to click on this button error -Unable to locate element

This is the HTML <button type="button" class="d-block p-3 mx-auto btn btn-danger btn-lg xh-highlight"> <i class="fa fa-close mr-1"> </i> Close </button> And I'm trying with: ...
Shoval's user avatar
  • 13
3 votes
1 answer
2k views

Selenium Python queston: How to extract the dynamic id generated?

I have a link inside a table with a dynamically changing id, the xpath being: //*[@id="1544727471470-1-uiGrid-0007-cell"]/a/span/span To its left is a checkbox with xpath: //*[@id="1544727471470-1-...
Angel Joy's user avatar
1 vote
1 answer
5k views

How can I prompt for input using Selenium/Webdriver and use the result?

i know this has been asked before but the last time it has been answered was about a year and a half ago main point is i want to from selenium import webdriver from selenium.webdriver.common.keys ...
Kingdomruler10's user avatar
5 votes
2 answers
28k views

How do you press two keys at the same time with Python Selenium?

Trying to do accessibility automation and want to use shift+tab to go back an element. But can't seem to get anything to work. Tried what the doc imply should work based off their "Example, pressing ...
Cynic's user avatar
  • 235
2 votes
1 answer
4k views

Python Selenium: Unable to locate element

I'd like to download the primary parcel layer from this website. First step is to click the "Add/Remove Item" button, but I am having trouble locating it. For this button, the Inspect Element window ...
aka49's user avatar
  • 23
0 votes
2 answers
3k views

How to change the pip version in pycharm

In pycharm the pip version is showing as 10.1 but when i check the pip version in my CMD it is showing as 9.0.1. I am not able to understand why it is happening. If any one know the reason can you ...
manoj's user avatar
  • 117
1 vote
2 answers
4k views

How to call rest API using python selenium?

I have a scenario where I need to call a rest API in my python selenium script but I am not sure how to do it. If anyone as idea on it can you please help me out . The API used is to delete the ...
manoj's user avatar
  • 117
0 votes
2 answers
3k views

Selenium: Why find_element_by_partial_link_text finds the first match only?

What I want to do: I want to click all the links where partial text = "105611A5C7B9_Logs_" Example: First Link Text = 105611A5C7B9_Logs_11-15-18-06-04PM.tgz Second Link Text = ...
Dipankar Nalui's user avatar

1
4 5
6
7 8
12