webdriverwait

Unable to locate element: {“method”:“xpath”,“selector”:“//li[@id=”tablist1-tab3“]”} error using Selenium and Java

為{幸葍}努か 提交于 2020-12-12 04:47:25
问题 I have received this error for several times: Unable to locate element: {"method":"xpath","selector":"//li[@id="tablist1-tab3"]"} Code that I have used is: options.addArguments("--headless"); options.addArguments("window-size=1200x900"); driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); WebElement tab = driver.findElement(By.xpath("//li[@id=\"tablist1-tab3\"]")); tab.click(); Can someone help me with this error? 回答1: You need to use WebDriverWait for the elementToBeClickable()

Selenium C# ElementNotVisibleException: element not interactable but the element is actually visible

戏子无情 提交于 2020-11-29 08:52:06
问题 I'm using Selenium.WebDriver for C# to ask a question on Quora just typing my question in notepad. Everything worked fine since I had to post it. To post it I need to click on a link inside a span like this: <span id="__w2_wEA6apRq1_submit_question"> <a class="submit_button modal_action" href="#" id="__w2_wEA6apRq1_submit">Add Question</a> </span> In order to click it I've tried this method, that I've used for all my previous button clicks: Selecting the element and clicking it: var element =

Assert if text within an element contains specific partial text

痞子三分冷 提交于 2020-11-25 04:36:07
问题 I have an element within tag that has release notes. I have to validate if it contains specific text. I am able to extract the text using following code: WebDriverWait(self.driver, 10).until(EC.visibility_of_element_located((By.XPATH, ManageSoftware.release_notes_xpath))).get_attribute("innerHTML") How do I assert if it contain a specific text, say "abc". Is there any function like contains() or isPresent() that I can use here? The code that I am working on is: <div id="dialog" class="ui