Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Unable to click element in web page
#1
Hello All,

I am trying to use python code for dynamic element where after login into URL I need to click element which is not happening with the below code.

from selenium import webdriver
from selenium.webdriver.common.by import By
import time
from selenium.webdriver.common.keys import Keys
from docx import Document
from docx.shared import Inches
from selenium.webdriver.common.action_chains import ActionChains

driver = webdriver.Firefox()
driver.get("URL")
#time.sleep(40)
driver.implicitly_wait(30)

iframe = driver.find_elements_by_tag_name('frame')[0]
driver.switch_to.frame(iframe)
driver.implicitly_wait(30)
#This is dummy login
username = driver.find_element_by_id("abc")
username.send_keys("admin")
#This will input username & password
username = driver.find_element_by_id("abc")
username.send_keys("admin")

password = driver.find_element_by_id("www")
password.send_keys("abc")

driver.find_element_by_id("bpm.Logon.1.btnLogon").click()
driver.switch_to.default_content()

time.sleep(20)

#switching between the iframes based on index

iframe = driver.find_elements_by_tag_name('frame')[0]
driver.switch_to.frame(iframe)

navigate = driver.find_element_by_id("bpm.mnit_Nav")
actions = ActionChains(driver) # initialize ActionChain object
actions.move_to_element(navigate)

time.sleep(10)

Administer = driver.find_element_by_xpath("//html/body/div[9]/div[1]/table/tbody/tr[7]/td[2]")
actions = ActionChains(driver) # initialize ActionChain object
actions.move_to_element(Administer).click().perform()

time.sleep(10)

[b]applicationLibrary = driver.find_element_by_xpath("//html/body/div[10]/div[1]/table/tbody/tr[7]/td[2]")
actions = ActionChains(driver)
action.click(on_element = applicationLibrary).perform() [/b]

driver.switch_to.default_content()
With this code, I am unable to click application Library element. I dont receive any error while running this code but it doesn't click.
Larz60+ wrote Jun-25-2020, 12:39 PM:
Please post all code, output and errors (in it's entirety) between their respective tags. I did it for you this time, Here are instructions on how to do it yourself next time.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  find element...click() dont work windows11 6 384 Apr-23-2020, 11:13 PM
Last Post: law
  bypassing find element click() windows11 1 213 Apr-02-2020, 11:55 AM
Last Post: Larz60+
  wait for element and click windows11 2 293 Mar-21-2020, 09:23 PM
Last Post: windows11
  use Xpath in Python :: libxml2 for a page-to-page skip-setting apollo 2 474 Mar-19-2020, 06:13 PM
Last Post: apollo
  Unable to switch out of nested frames into main page abi17124 0 417 Jul-17-2019, 06:06 PM
Last Post: abi17124
  Selenium Parsing (unable to Parse page after loading) oneclick 6 1,219 Jan-13-2019, 03:10 AM
Last Post: oneclick
  Click Element if displayed using Selenium and Python giaco__mar 1 1,448 Dec-27-2018, 06:19 PM
Last Post: metulburr
  Click a button to get next page ian 7 27,806 Apr-15-2018, 10:05 PM
Last Post: snippsat

Forum Jump:


Users browsing this thread: 1 Guest(s)