findelement

Find texts that contains quotation marks by xpath in Selenium

♀尐吖头ヾ 提交于 2021-02-19 06:28:21
问题 I just got an error in Selenium(Java): Unable to locate an element with the xpath expression //*[contains(.,'The field SomeField must be a string or array type with a maximum length of '60'.')] Apparently, there are two ' which broke the expression. So I changed the code from WebElement elem = findElement(By.xpath("//*[contains(.,'" + arg + "')]")); to WebElement elem = findElement(By.xpath("//*[contains(.,'" + arg.toString().replace("'", "\'") + "')]")); WebElement elem = findElement(By

Unable to locate an element using Python Selenium library

帅比萌擦擦* 提交于 2021-01-29 13:31:08
问题 I'm not able to find an element again. I've been learning... I've already looked for the solutions seeing past questions but the answer depends on the specify code. The name of the button is "Gestione" and when you click it, you should be able to see a drop-down menù. SELECTORS BY SELENIUM IDE id=ext-gen76 css=#ext-gen76 xpath=//em[@id='ext-gen76'] xpath=//tr[@id='ext-gen43']/td[2]/em xpath=//td[5]/table/tbody/tr/td[2]/em xpath=//em[contains(.,'Gestione')] HTML CODE HTML page 1 HTML page 2

how to click button which is inside iframe using python selenium

試著忘記壹切 提交于 2020-01-06 07:23:08
问题 He is my sample snippet. i want to click the button-1034-btnIconEl using python selenium. <html> <body> <div class="x-container x-border-item x-box-item x-container-default x-layout-fit" id="iframes" > <iframe ></iframe> <iframe class="x-component x-fit-item x-component-default" frameborder="0" id="rpIFrame-1239"> <html> <body> <div> .....many divs <div> <a><span><span id="button-1034-btnIconEl"></span></span></a> </div> </div> </body> </html> </iframe> i tried this driver.switch_to.frame(1)