selenium | python selenium | Functional Testing library
kandi X-RAY | selenium Summary
kandi X-RAY | selenium Summary
python selenium
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of selenium
selenium Key Features
selenium Examples and Code Snippets
Community Discussions
Trending Discussions on selenium
QUESTION
I am having problems getting data from a element using Selenium with the line:
...ANSWER
Answered 2021-Jun-15 at 20:06When an element has spaces in the class
attribute, that means it has multiple classes, so you'll need to handle that another way.
One option is with CSS selectors.
https://selenium-python.readthedocs.io/locating-elements.html#locating-elements
https://selenium-python.readthedocs.io/api.html#locate-elements-by
QUESTION
I am currently working on the Selenium Nunit Testing using C# with VS code.
We are following page object model.
We just wanted to list down all the methods and class in a document or web page (localhost) like how api document look like ..
How to achieve this?
Thanks
...ANSWER
Answered 2021-Jun-15 at 15:22To be clear, you are looking for some way to document all the classes/methods that make up your page object model?
That doesn't have anything to do with selenium or nunit. Just document your C# code with XML documentation comments like this:
QUESTION
Weird case happening here. I am trying to insert some keys in a username and password input field. It was working just fine and suddenly it did stop.
Just to make thing clear for everyone. Once I click on login button, I get redirected to the login page where I have my username and password input fields. and their divs are as follow.
in my selenium code I target the username and password element by their name.
...ANSWER
Answered 2021-Jun-15 at 15:02I think you need ExplicitWait
:
try this :
QUESTION
I'm trying to get an access to div.y element.
...ANSWER
Answered 2021-Jun-15 at 00:03I'm not sure why you don't just try it, but yes, you can do so and it works as you probably expect. That is, it will find the first element with class y
that is a descendant of the first x
element on the page.
QUESTION
I have two grid setup's
Local grid setup (hub and nodes are running in my local machine) and my
local machine
connected tonetwork#1
VM grid setup (hub and nodes are running in my virtual machine) and my
virtual machine
connected tonetwork#2
When I execute the scripts I need to pass the IP address
as a parameter. Here,
I can run my scripts successfully in local machine(code is available in local machine) by passing the network#1
IP address
but if I pass the network#2
IP address
(VM IP address) to local machine
then I am getting below exception,
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
As per my knowledge, hub and nodes should be connected to same network. Cannot we run the scripts by passing the VM IP address to local machine?
Trace:
...ANSWER
Answered 2021-Jun-15 at 13:57Yes, the exception occurred due to firewall. The ping test
is successful from local machine to VM but not from VM to local. I contacted the organization network administrator to confirmed this.
QUESTION
ANSWER
Answered 2021-Jun-15 at 13:10class=OTSigninButton
QUESTION
Heyy ^^ I'm coding a selenium program, but I'm stuck in one place. This program is made to buy 1 graphics card, on a French site, for my son's birthday. So there you have it, I coded everything but now my concern is that the web page of this graphics card is only available when it is in stock so the program cannot find the button by xpath "add to cart" . So I had the idea to make a loop so that as long as the "add to cart" button is not available, the program opens the page of the graphics card to infinity (like this when it is available, the button appears and the rest is done). However, I don't know how to achieve this condition, this loop, can you help me? I am on selenium with webdriver
...ANSWER
Answered 2021-Jun-15 at 10:13addtocart = driver.find_elements_by_xpath('somexpath')
while (not addtocart):
time.sleep(10) # wait for 10 seconds
driver.refresh()
addtocart = driver.find_elements_by_xpath('somexpath') # refind to avoid stale element exception
addtocart[0].click()
QUESTION
My classes are Hooks for setup and test. I try to click on cookie pop-up, using WebdriverWait, but don't work. I have no idea why.
I am a beginner with selenium and automation testing and I am writing a selenium script using java, TestNG, and maven. When I write everything in one class, all works fine, but I want to have a package for all objects, a package for tests, and Hooks with the main setting.
...ANSWER
Answered 2021-Jun-06 at 12:31
public WebDriver driver;
This declares a field, named driver
. Not sure why you made it public.
WebDriver driver = new ChromeDriver();
This declares a local variable, also named driver
, which is completely unrelated to the field you declared. As all local variables go, it ceases to exist when the method you declared it in ends. Because it has the same name, referencing variable driver
in this method refers to the local variable and not the field.
All you really wanted was to make that second line:
QUESTION
Please find the attached image i want to fetch the Admins and moderators name and href link .
i have tried below :
...ANSWER
Answered 2021-Jun-15 at 08:30for Admins and moderators name you can do this :
QUESTION
So I have a problem that I have been noticing with selenium when I run it headless where some pages don't totally load/render some elements. I don't exactly know what's happening not to load 100%; maybe JS
not running?
My code:
...ANSWER
Answered 2021-Mar-13 at 11:51from selenium import webdriver
from time import sleep
options = webdriver.ChromeOptions()
options.add_argument("--window-size=1920,1080")
options.add_argument("--headless")
options.add_argument("--disable-gpu")
options.add_argument(
"user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36")
browser = webdriver.Chrome(options=options)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
Install selenium
You can use selenium like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page