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
0
votes
1answer
12 views

How would I retrieve links of every page, and through those links, I want to retrieve links of the products

next_btn = driver.find_element_by_xpath("//a[@class='ge-49M']") for i in next_btn: driver.get(i) lnks = driver.find_elements_by_xpath("//a[@class='_2UzuFa']") for z in ...
0
votes
1answer
16 views

10th element in rating is not present so what should i do to print dash(-) in that place tto matchup the data frame

import pandas as pd import selenium from selenium import webdriver from selenium.common.exceptions import NoSuchElementException import pandas as pd import time driver = webdriver.Chrome(r"C:\...
1
vote
0answers
26 views

Delineating unit tests and integration tests in Testing Library for React and unittest

This question is related to Testing Library for React and unittest for Python. I'd like like to have a single file that contains unit tests and integration tests for a component, and be able to target ...
1
vote
2answers
39 views

Selenium (Python) is having issues finding and interacting with a button that has formmethod="get" in it

I am attempting to click a delete button but Selenium does not locate it even though a save button next to it is completely intractable. The only difference is the delete button has this in the html &...
2
votes
1answer
44 views

Differentiating between two items with the same class name using selenium

As a learning project, I am trying to use selenium webdriver with python 3 to collect my shopping for the week from sainsburys website. At the moment, the script will loop through a bunch of URLs for ...
1
vote
1answer
46 views

Selenium is not finding button even though it has a Class Name and XPath

I am attempting to click a save button but Selenium (with Python) is having issues. I keep getting the error, "Message: no such element: Unable to locate element" Here is the HTML <input ...
0
votes
1answer
21 views

Android Function testing report generate using Appium + Python

I am currently working on a mobile application with appium with python. There are a lot of options for every file selection in that. Currently checking if processing all the types of files are ...
1
vote
1answer
45 views

Cant access elements in authentication popup that says ```sign in with google```

Trying selenium for a webpage which only have google authentication. When the Join button is clicked, a popup window comes up which only have a button named sign uo with google. As i am new to ...
-1
votes
1answer
24 views

cannot click on link Python Selenium

I am trying to add a confirmation link on selenium but selenium is not able to click on that link its on yopmail with name janemartin90452 It doesn't click on the confirmation link Name "Activate ...
0
votes
3answers
48 views

how to get span based on the <p> found

How do i find the element Jessica based on 3000 using xpath. I'm getting ...not a valid xpath error. Jessica Total Wealth ($): 3000 <div> <span><b>Jessica</b></...
0
votes
1answer
42 views

selenium select checkboxes between checkboxes : Python

This is the how my HTML looks like: <tr> <td class = 'text-bar'> id </td> <td> <input type="checkbox" size = "20" value= 'Yes' id =...
0
votes
0answers
31 views

How can I use a for loop in this code in python

I want to run my code 10 times in 10 new tabs. Kindly help me on how can I use a for loop and open in 10 different tabs. code; import time from selenium import webdriver from selenium.webdriver....
0
votes
1answer
31 views

How can I handle browser alert

I do not understand how to click allow button. import time from selenium import webdriver chrome_options = webdriver.ChromeOptions() chrome_options.add_argument("--disable-notifications") ...
0
votes
3answers
153 views

Cant fill out Username and Password field using Selenium

I'm trying to fill out a Username and Password field on a website. The id changes every time, so I cant find the elements by using the id. So I tried by using XPath and class name, but none of them ...
0
votes
0answers
49 views

Is it possible to automate electron applications with RobotFramework Browser library?

I am currently using selenium and python to launch and access elements from an electron application. I've used RobotFramework Browser (rfbrowser) library to automate angular webpages previously and I ...
0
votes
1answer
194 views

AttributeError: module 'selenium.webdriver.common.keys' has no attribute 'RETURN'

When I run my script it gives me this error: Traceback (most recent call last): File "C:\Development\Python_Project\SDETpythonProject\SDET_Package\my_firstProject.py", line 18, in <...
0
votes
2answers
125 views

Finding sibling of found element using selenium

I've got a field with a date in it that's identified by a code that's shown in the div previous to it. <div class="fcode"> <div class="fcode_n">(123)</div> ...
1
vote
0answers
49 views

How do I handle Chrome Autofill using Selenium Python?

I encountered an issue using the chrome autofill option. There is any way to handle the options list? (please see the image) What I've done: Load my Chrome Profile Launch Chrome with my loaded ...
0
votes
1answer
547 views

To click on an element which contains class and title in selenium python

I want to click on an element which contains class and title in selenium python. A webpage contains certain folders with unique name. I want to click on a folder by specifying its name or title. Below ...
1
vote
2answers
117 views

New to automation testing of APIs with Pycharm and Pytest

We are moving all manual testers to automation. I am very familiar with 'concepts' but really need a beginners step into automation for new API Service and endpoints. The developer is coding a new ...
0
votes
1answer
30 views

how to get the values of "term_from" and "term_to" using selenium

How can i get the value of term_from and term_to from this html table.
1
vote
2answers
90 views

Send_keys in selenium doesn't activate the submit button but manual entering does

I'm struggling with a phone number field that I fill using send_keys function in selenium. Actually, the submit button is supposed to be enabled after filling out the phone number, but it doesn't ...
0
votes
2answers
68 views

I have a dynamic xpath which is based on 4 values, if I am using OR condition the xpath looks huge, any other way to handle this?

_OPTION_1 = "Average" _OPTION_2 = "M" _OPTION_3 = "Casual" _OPTION_4 = "D" _WIDTH_VALUE_XPATH = f"//mat-option/span[contains(text(),'{...
-3
votes
1answer
58 views

How can i repeat this script many times [closed]

driver.find_element_by_class_name("submit").click() time.sleep(2.5) driver.find_element_by_xpath("//input[@value='Continue >>']").click() time.sleep(2.5) driver....
0
votes
1answer
29 views

How to handle the exact position of runtime creating webelement in selenium python

I've been writing a couple of tests using selenium for my website. However, I've not found a way to test multiselect dropdown with checkboxes that is filled by V-autocomplete(vuetifyjs) component . As ...
0
votes
0answers
60 views

Python selenium - How to loop to register Mega.nz accounts with mails.json (Protonmail)

Everything is fine, but when the script ends it does not loop with the json information. It stays in the Protonmail mailbox and the script no longer works. Try to make the browser completely close the ...
-2
votes
1answer
42 views

Selenium Webdriver: HOW TO CLICK IN A BUTTON WITHIN A CLASS OVER OTHER CLASS?

I've been trying to click in a button and haven't success. Want to acess line 130 Começa a new game It has two class="responsive-lg" and the I Want is the second. I need help to overcame ...
1
vote
1answer
52 views

Selenium closing the brower alone after finishing all the function [closed]

I'm pretty new in programming so I might be an easy question but I don't understand why the browsers opened by Selenium closes at the end of the code : def login(Email, Password): Driver = ...
3
votes
1answer
32 views

How to scroll an element to the center of the screen

driver.get( "http://www.uitestingplayground.com/scrollbars") time.sleep(10) driver.execute_script( "arguments[0].scrollIntoView()", driver.find_element_by_id("...
0
votes
1answer
879 views

how to click on the dropdown list items using selenium python without select tag?

I need to click on the dropdown list of items that are hidden and only the list visible once we click on the particular search box. HTML TAG: <div class="main-search_suggestions suggestions-...
1
vote
3answers
42 views

Print with specific text selenium & python

I have a program with python & selenium. I will print the program like this : end-bubble bubble ok end-bubble bubble high My goals are like this: ok high My idea is to print without the end-...
0
votes
0answers
65 views

Python / Selenium is starting an old script before running new script. Do anybody can solve this issue?

I have a problem with Selenium(Python). Does Somebody know a solution? THE PROBLEM If I run a new Script the browser opens and runs an old script, then closes and opens again, and then runs the new ...
1
vote
2answers
129 views

How to Deal With Changing Elements In XPath?

My Code is: bar = browser.find_element_by_xpath("//*[@id='ember26']/input") But it changes every time I login. I can login with my codes but inside the LinkedIn, search bar XPath changes, ...
0
votes
1answer
39 views

safaridriver can't be enabled

I'm trying to use the safaridriver but every time I try to enable it I get a segmentation fault. I already tried to restart my laptop but the problems stays. admin@Bens-Air ~ % safaridriver --enable ...
1
vote
0answers
84 views

RobotFramework AutoItLibrary.Run test case passing, but no window shown

I have Python 3.7.0, Robot Framework 3.2.2, and AutoItLibrary 1.2.7 installed. I have the following test case to simply run an app I have developed in .NET: *** Settings *** Library ...
0
votes
1answer
58 views

How can I count how many times this selenium script has been run in Python?

for example, I run this script 200 times and now I want to run more time. then I count every time and show me in console import time from selenium import webdriver start_time = time.time() driver = ...
1
vote
1answer
52 views

Is there a way to make Selenium use cookies to autologin?

I don't want to have to make the script log in every time. Is there to stop the web driver opening a "fresh" browser and instead make it open my standard version/load cookies so it auto-logs ...
0
votes
3answers
119 views

How to scrape text from html using Selenium or Beautiful Soup

here is the html <div data-v-026c45df="" class="col text-undefined">$682.0</div> I need the '$682.0'. I have tried : start_aum = driver.find_element_by_class_name('col ...
1
vote
2answers
83 views

How to select an element using text() in Selenium with Python?

I am not able to select "Event" in following code using text(). <a class="atg-p-8" href="https://www.abc.com"> <span class="atg-mr-12">.....
0
votes
1answer
446 views

Can't import AutoItLibrary in RIDE/Robot Framework

I have Python 3.7.0, Robot Framework 3.2.2 and RIDE 1.7.4.2 installed on Windows 10. I want to use the AutoItLibrary with RobotFramework. I have installed it as follows: pip install robotframework-...
1
vote
1answer
40 views

What is the correct way to test classes in Python?

There is a class named State that has several attributes, which I need to write unit tests for. The test will need to have certain actions that change attribute values of the State instance. Expected ...
1
vote
1answer
167 views

How to verify the page load opened in a new tab with a redirection?

I am testing a website that redirects the user to another website for buying stuff. Once I click on the Buy Now button a new browser tab opens and another website is launched displaying the product. ...
-1
votes
3answers
1k views

AttributeError: 'TestOne' object has no attribute 'driver'

When I run my script it gives me this error, CONSOLE ERROR : "C:\Users\LENOVO L540\PycharmProjects\easyNeasypytest\venv\Scripts\python.exe" "C:\Program Files\JetBrains\PyCharm Community ...
0
votes
1answer
235 views

i want to run my selenium python script with appachi jmeter .how we integrate selenium python script in apache jmeter

import time from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support.select import Select driver = webdriver.Chrome(...
-2
votes
2answers
132 views

How to structure or architect an automated testing project? [closed]

We are implementing automated testing from scratch and we want to use the Python language. We want to build all the tests, based on Selenium (Acceptance tests), in a project separate from the main one ...
1
vote
1answer
41 views

Did not send values in phone number option

I have problems: first, it did not send keys to the phone number, and the second when I select the value in a dropdown it shows me this error. CONSOLE ERROR: Traceback (most recent call last): File &...
1
vote
1answer
189 views

Unable to locate/no such element python selenium

I am trying to click the place order button. Button code : <button type="button" data-ng-disabled="activeStep.position !== 6" class="primary-button place-order-btn" ...
2
votes
1answer
44 views

Selenium screenplay pattern vs PageObject with `isLoaded`

I'm starting to embrace and utilize the screenplay pattern with selenium testing. It's a new concept for me which has me un-learning old behavior. I've been slowly translating some sample tests ...
0
votes
0answers
32 views

How to choose a result in a dynamic webtable that has the same name and later timing in Selenium Python?

I have been working on a Selenium project in Python where I want to choose the result which has a later timing than the earlier one but have trouble implementing it. What I meant is this, Example if ...
0
votes
2answers
135 views

How to solve AssertionError in Selenium Python?

I am currently working on a project in Selenium in Python and I am getting AssertionError when I put a specific parametrised value 6.00 in the parentheses. Test.py Class Test: def test_voidnewcard(...

1
2 3 4 5
10