How can we upload image from URL in selenium
up vote
-1
down vote
favorite
image = driver.find_element_by_id('url-upload-input').send_keys('https://images.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940')
time.sleep(20)
image_upload = driver.find_element_by_id("url-uploaded-preview-img")
driver.execute_script("arguments[0].click();", image_upload)
I am getting this error may i know how can we upload the image from URL
Traceback (most recent call last):
File "F:/automation/check.py", line 38, in <module>
image = driver.find_element_by_id('url-upload-input').send_keys('https://images.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940')
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebelement.py", line 479, in send_keys
'value': keys_to_typing(value)})
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "F:automationvenvlibsite-packagesseleniumwebdriverremoteerrorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not visible
python selenium
add a comment |
up vote
-1
down vote
favorite
image = driver.find_element_by_id('url-upload-input').send_keys('https://images.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940')
time.sleep(20)
image_upload = driver.find_element_by_id("url-uploaded-preview-img")
driver.execute_script("arguments[0].click();", image_upload)
I am getting this error may i know how can we upload the image from URL
Traceback (most recent call last):
File "F:/automation/check.py", line 38, in <module>
image = driver.find_element_by_id('url-upload-input').send_keys('https://images.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940')
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebelement.py", line 479, in send_keys
'value': keys_to_typing(value)})
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "F:automationvenvlibsite-packagesseleniumwebdriverremoteerrorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not visible
python selenium
According to the error message the problem is, that there is no element with ID 'url-upload-input' visible.
– Michael
Nov 20 at 6:04
there is id with same name <input type="url" class="form-control" id="url-upload-input" placeholder="Provide an image URL">
– sourav sharan
Nov 20 at 6:08
Checkprint(len(driver.find_elements_by_id('url-upload-input')))
. Is it1
?
– Andersson
Nov 20 at 6:12
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
image = driver.find_element_by_id('url-upload-input').send_keys('https://images.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940')
time.sleep(20)
image_upload = driver.find_element_by_id("url-uploaded-preview-img")
driver.execute_script("arguments[0].click();", image_upload)
I am getting this error may i know how can we upload the image from URL
Traceback (most recent call last):
File "F:/automation/check.py", line 38, in <module>
image = driver.find_element_by_id('url-upload-input').send_keys('https://images.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940')
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebelement.py", line 479, in send_keys
'value': keys_to_typing(value)})
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "F:automationvenvlibsite-packagesseleniumwebdriverremoteerrorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not visible
python selenium
image = driver.find_element_by_id('url-upload-input').send_keys('https://images.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940')
time.sleep(20)
image_upload = driver.find_element_by_id("url-uploaded-preview-img")
driver.execute_script("arguments[0].click();", image_upload)
I am getting this error may i know how can we upload the image from URL
Traceback (most recent call last):
File "F:/automation/check.py", line 38, in <module>
image = driver.find_element_by_id('url-upload-input').send_keys('https://images.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940')
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebelement.py", line 479, in send_keys
'value': keys_to_typing(value)})
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "F:automationvenvlibsite-packagesseleniumwebdriverremoteerrorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not visible
python selenium
python selenium
edited Nov 20 at 8:38
ewwink
7,88222234
7,88222234
asked Nov 20 at 5:56
sourav sharan
124
124
According to the error message the problem is, that there is no element with ID 'url-upload-input' visible.
– Michael
Nov 20 at 6:04
there is id with same name <input type="url" class="form-control" id="url-upload-input" placeholder="Provide an image URL">
– sourav sharan
Nov 20 at 6:08
Checkprint(len(driver.find_elements_by_id('url-upload-input')))
. Is it1
?
– Andersson
Nov 20 at 6:12
add a comment |
According to the error message the problem is, that there is no element with ID 'url-upload-input' visible.
– Michael
Nov 20 at 6:04
there is id with same name <input type="url" class="form-control" id="url-upload-input" placeholder="Provide an image URL">
– sourav sharan
Nov 20 at 6:08
Checkprint(len(driver.find_elements_by_id('url-upload-input')))
. Is it1
?
– Andersson
Nov 20 at 6:12
According to the error message the problem is, that there is no element with ID 'url-upload-input' visible.
– Michael
Nov 20 at 6:04
According to the error message the problem is, that there is no element with ID 'url-upload-input' visible.
– Michael
Nov 20 at 6:04
there is id with same name <input type="url" class="form-control" id="url-upload-input" placeholder="Provide an image URL">
– sourav sharan
Nov 20 at 6:08
there is id with same name <input type="url" class="form-control" id="url-upload-input" placeholder="Provide an image URL">
– sourav sharan
Nov 20 at 6:08
Check
print(len(driver.find_elements_by_id('url-upload-input')))
. Is it 1
?– Andersson
Nov 20 at 6:12
Check
print(len(driver.find_elements_by_id('url-upload-input')))
. Is it 1
?– Andersson
Nov 20 at 6:12
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
Try to wait for element to be visible:
WebDriverWait(driver, 30).until(
EC.visibility_of_element_located((By.ID, "url-uploaded-preview-img"))
)
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Try to wait for element to be visible:
WebDriverWait(driver, 30).until(
EC.visibility_of_element_located((By.ID, "url-uploaded-preview-img"))
)
add a comment |
up vote
0
down vote
accepted
Try to wait for element to be visible:
WebDriverWait(driver, 30).until(
EC.visibility_of_element_located((By.ID, "url-uploaded-preview-img"))
)
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Try to wait for element to be visible:
WebDriverWait(driver, 30).until(
EC.visibility_of_element_located((By.ID, "url-uploaded-preview-img"))
)
Try to wait for element to be visible:
WebDriverWait(driver, 30).until(
EC.visibility_of_element_located((By.ID, "url-uploaded-preview-img"))
)
answered Nov 21 at 17:20
applekate
345
345
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53387049%2fhow-can-we-upload-image-from-url-in-selenium%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
According to the error message the problem is, that there is no element with ID 'url-upload-input' visible.
– Michael
Nov 20 at 6:04
there is id with same name <input type="url" class="form-control" id="url-upload-input" placeholder="Provide an image URL">
– sourav sharan
Nov 20 at 6:08
Check
print(len(driver.find_elements_by_id('url-upload-input')))
. Is it1
?– Andersson
Nov 20 at 6:12