Questions tagged [expected-condition]

144 questions
0
votes
3 answers

How can I find element by text but it's number in selenium

I want to get an element by text, but it is number? I guess? For example, 11 It contain a number so this code didnt work driver.find_element_by_xpath('//*[@text="11"]') How can I find this element?
0
votes
1 answer

Wait For Visibility of Nth Element

I am using the wait for visibility of an element function before clicking on that element. However, there are multiple elements in the HTML that satisfy the search I am using for my element, which is how I want it. How do I use the wait for…
0
votes
2 answers

Wait for text in an element to be a number in Selenium with Python

A dynamically generated website has such an element: After some time it fills the b element with a random number like this: 42 I want to wait for that number to be generated and for…
user1
  • 945
  • 2
  • 13
  • 37
0
votes
1 answer

How to use explicit wait on one element out of a list with Python Selenium?

I have HTML that (somehow) includes two elements with the same ID. Only one of them is clickable, and to identify the one I want to click, I am using: driver.find_elements_by_id('someID')[1] Now I want to convert this to an explicit wait. If there…
0
votes
4 answers

"TypeError: 'str' object is not callable" using WebDriverWait for link_text in Selenium through Python

This is my first post on Stack Overflow. I have been browsing and searching for every possible answer to this question on SO, and I figured at this point I should just ask a question, as I have been at this wall for days now. I am currently working…
0
votes
1 answer

How to extract the text from the sibling text nodes of the strong tag using Selenium and Java

There are 52 page objects as follows, all of which has Strong tag containing a String called "Gideon". How possibly can I get all of them by findElements method?
faa
  • 7
  • 7
0
votes
1 answer

Any Expected condition for when an item is seleted? Protractor tests

I am testing a checkbox, and i want to know if there is any expected condition to wait for the item to be selected. Right now on my tests i am using browser.sleep with 10 seconds(the checkbox takes to much time to load) but that doesnt seems the…
0
votes
1 answer

How can I use WebDriverWait from Selenium properly through Python?

I just thought I'd add an edit now that this has been resolved. Replacing those two time.sleep() took my program from 180 seconds down to 30. WebDriverWait creates a substantial improvement in runtime. I am just trying to determine if I'm setting up…
0
votes
3 answers

Selenium identifies the button as clickable when it wasn't

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 first and then time slot from a dropdown list before the "Book" button is clickable and…
0
votes
3 answers

How can I fix this syntax error using WebDriverWait in Selenium Python

I'm a beginner in learning python and have a problem with my code. It seems like a simple error but I cannot find a solution for this error. Here's a code import time from selenium import webdriver driver =…
0
votes
0 answers

Selenium (with EC and WebDriverWait) not detecting element even though it is present

So, I am using selenium and chromedriver in python to automate some tasks. I need to wait for an iframe that gets created upon clicking a button. The issue is that when I use WebDriverWait and EC to wait until the iframe becomes present, it times…
0
votes
1 answer

Protractor with Typescript: Failed: Cannot read property 'presenceOf' of undefined

I'm trying to wait for element presence using protractor, typescript. Here are my code: import { browser, by, element } from 'protractor'; import { protractor } from 'protractor/built/ptor'; export class LoginPage { title =…
khris
  • 4,809
  • 21
  • 64
  • 94
0
votes
3 answers

Selenium (Java) Correctly using explicit waits with PageFactory

After reviewing the selenium docs, I am wondering if I am attempting to implement explicit waits incorrectly. In the docs, it always shows identifying a new element, then assigning the defined wait to said element WebDriver driver = new…
0
votes
1 answer

How to handle new window, which opened automatically in new tab?

My test code do thomething, then automatically opening new tab and in a new tab automatically opening new window (not a tab). When I use this code: driver.getWindowHandles() it is returns 2 tab ID instead 3 tab ID.
0
votes
1 answer

SOLVED Selenium: Console js code works but not python -> TypeError: document.getElementById(...) null error clicking on element within iframe

My Selenium code logs into a website, then reaches a page with a button that exists within an iframe. Inspecting the element in chrome and using the console of the browser, I found the iframe: iframe =…