Trouble clicking javascript element using Selenium webdriver via Python -
was hoping point me in right direction. i'm logging firewall , trying click on javascript button lives in frame using python firefox webdriver.
first off here i'm working with: http://i.imgur.com/5x8jekb.png
(sorry can't embed images first post)
after switching frame, can find element xpath no errors tells me i'm in right place.
driver.switch_to_frame("outlookframe") element = driver.find_element_by_xpath('//*[@id="nav_head2_textbox"]/a')
no errors
when click:
driver.find_element_by_xpath('//*[@id="nav_head2_textbox"]/a').click()
i exception:
elementnotvisibleexception: message: element not visible , may not interacted
what gives? if switch parent frame can't find xpath.
couple things add. can see javascript button when in web browser.
using dom inspector gives shows xml of js button:
<div xmlns="http://www.w3.org/1999/xhtml" class="nav_item" id="nav_head2_on" style="display: block;"><div id="nav_head2_textbox"><a class="nav_sub_sett" target="tabframe" onclick="javascript:hilight(this);" href="systemsettingsview.html">settings</a></div>
edit okay managed working using full xpath extracted firebug. still not sure why shorter path didn't work though:
driver.find_element_by_xpath('/html/body/div[2]/div/div[4]/div[7]/div/a').click()
Comments
Post a Comment