Danp2 Posted July 24, 2019 Posted July 24, 2019 @_leo_ When you use "contains()" in your xpath, you need a comma instead of the equal sign. Davidowicza 1 Latest Webdriver UDF Release Webdriver Wiki FAQs
_leo_ Posted July 25, 2019 Author Posted July 25, 2019 Ahhh, sometimes it is that simple. @Danp2 I finally got the syntax error out of the way - yeeyyy-. I have changed the code to the following, because I read in the "Help & Support" threat that "contain" would help if you are trying to address multiple elements. _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//div[contains(@class,'item') and contains(text(),'Noch nicht veröffentlicht')]") $NNV = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div[contains(@class,'item') and contains(text(),'Noch nicht veröffentlicht')]") _WD_ElementAction($sSession, $NNV, 'click') I am getting this result: Quote __WD_Post: URL=HTTP://127.0.0.1:9515/session/cc08fae7919653e59b568dfe72e93cdd/element; $sData={"using":"xpath","value":"//div[contains(@class,'item') and contains(text(),'Noch nicht veröffentlicht')]"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"8397171d-e146-4220-a83b-db1cc03a97f0"}} _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"8397171d-e146-4220-a83b-db1cc03a97f0"}} __WD_Post: URL=HTTP://127.0.0.1:9515/session/cc08fae7919653e59b568dfe72e93cdd/element/8397171d-e146-4220-a83b-db1cc03a97f0/click; $sData={"id":"8397171d-e146-4220-a83b-db1cc03a97f0"} __WD_Post: StatusCode=400; ResponseText={"value":{"error":"element not interactable","message":"element not interactable\n It makes no sense to me. I was able to click this button with IE, but it seems impossible with the Webdriver. What am I missing? (probably my brain this time😂)
Danp2 Posted July 25, 2019 Posted July 25, 2019 @_leo_ Since we don't have access to the site, we are limited on how to guide you further. I suspect that you are clicking the wrong element. Chances are that you should be clicking the related "input" element or maybe even the surrounding "label". Open the browser's developer's tools (F12) and review the source code. Chances are that you see some elements with an "event" marker next to it. You will have to investigate these to determine which one actually needs to be triggered. Latest Webdriver UDF Release Webdriver Wiki FAQs
_leo_ Posted July 25, 2019 Author Posted July 25, 2019 Thanks @Danp2 I got it to work!! The problem was not, that I was interacting with the wrong elements. i figured out, that adding a "sleep" solves the issue. I thought that the _WD_WaitElement would do the job, but I probably misunderstood the functionality of it. sleep(4000) _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//div[contains(@class,'item') and contains(text(),'Noch nicht veröffentlicht')]") $NNV = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div[contains(@class,'item') and contains(text(),'Noch nicht veröffentlicht')]") _WD_ElementAction($sSession, $NNV, 'click') Anyways: I am going to print the code and put it in a picture frame-hihi-.
Danp2 Posted July 25, 2019 Posted July 25, 2019 @_leo_ Glad you got it working. FWIW, I believe the functionality of _WD_WaitElement is pretty self explanatory. It could be that you should be waiting for a different element as an indicator that the page has fully loaded. Latest Webdriver UDF Release Webdriver Wiki FAQs
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now