webdriver

handling submenu item with webdriver selenium

佐手、 提交于 2021-02-20 03:54:29
问题 I want to click submenu item using selenium webdriver which is invisible bydefault. It becomes visible on mousehover . I tried with some code and it is giving error as shown below Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Element is not currently visible and so may not be interacted with. Here the code: Actions actions = new Actions(driver); WebElement menuHoverLink = driver.findElement(By.linkText("RENT")); //WebElement menuHoverLink = driver.findElement(By

Get only inner text from webelemnt

扶醉桌前 提交于 2021-02-20 02:19:25
问题 I want to get only innerText from a webelement. I want to get only "Name" from the anchor tag.I have access to webdriver element associated with tag in below example(anchorElement). I tried anchorElement.getText() and anchorElement.getAttribute("innerText"). Both return me "Name, sort Z to A". What should I do here ? <a id="am-accessible-userName" href="javascript:void(0);" class="selected"> Name <span class="util accessible-text">, sort Z to A</span> <span class="jpui iconwrap sortIcon" id=

Get only inner text from webelemnt

。_饼干妹妹 提交于 2021-02-20 02:17:20
问题 I want to get only innerText from a webelement. I want to get only "Name" from the anchor tag.I have access to webdriver element associated with tag in below example(anchorElement). I tried anchorElement.getText() and anchorElement.getAttribute("innerText"). Both return me "Name, sort Z to A". What should I do here ? <a id="am-accessible-userName" href="javascript:void(0);" class="selected"> Name <span class="util accessible-text">, sort Z to A</span> <span class="jpui iconwrap sortIcon" id=

Difference between JsonWireProtocol mechanisms and the new standards in W3C Living Document when using Selenium

强颜欢笑 提交于 2021-02-19 05:34:21
问题 I'm wondering what are the differences between the mechanisms in JsonWireProtocol ( Status: OBSOLETE ) and W3C Living Document from 31 December 2019 ( the new standard ) when using Selenium for UI tests. I know that Selenium have used the following: When we make a new instance of a driver (C#): using OpenQA.Selenium; using OpenQA.Selenium.Chrome; IWebDriver driver = new ChromeDriver(); we actually make a POST /session request to the selenium server. After that via JsonWireProtocol and, in

Selenium Webdriver - how to close the first pop up window and go to the actual page

旧巷老猫 提交于 2021-02-19 04:13:54
问题 I'm trying to automate the webpage "http://www.quikr.com",when I open this you will get a pop up window first saying "Please Choose Your Location" then after closing it , I can see the main page of quikr. I tried closing that Popup page by automation ,but not able to do Tried using xpath driver.findElement(By.xpath("//*[@id='csclose']/strong")).click(); Tried using className driver.findElement(By.className("cs-close cs-close-v2")).click(); Tried using id driver.findElement(By.id("csclose"))

Selenium Webdriver - how to close the first pop up window and go to the actual page

空扰寡人 提交于 2021-02-19 04:13:17
问题 I'm trying to automate the webpage "http://www.quikr.com",when I open this you will get a pop up window first saying "Please Choose Your Location" then after closing it , I can see the main page of quikr. I tried closing that Popup page by automation ,but not able to do Tried using xpath driver.findElement(By.xpath("//*[@id='csclose']/strong")).click(); Tried using className driver.findElement(By.className("cs-close cs-close-v2")).click(); Tried using id driver.findElement(By.id("csclose"))

Uploading all files in a folder with windows file upload - Selenium

假装没事ソ 提交于 2021-02-18 18:51:03
问题 I am uploading files to a website using Selenium 2. I can upload one file by specifying the upload path, but I want to upload all files within a folder. Here's my code: if (driver.findElements(By.xpath("//input[@type='file']")).size() > 0) { driver.findElement(By.xpath("//input[@type='file']")).sendKeys("C:\\Users\\Bernard\\Dropbox\\Demo Submission\\Submissions\\Cooley - Imagination Land EP\\Cooley - Imagination Land.mp3"); } "Cooley - Imagination Land EP" is the folder that contains all the

C#/ASP.NET Selenium WebDriver - Re-using Cookies

若如初见. 提交于 2021-02-18 07:00:07
问题 I want to: Login to a website Save Cookies Give user a choice to do A, B or C A,B and C all require being logged in. Each will open a FirefoxDriver and do their own thing What i want to do, is login ONCE , save the cookies from that, and add them to any other FirefoxDriver i want to open. Right now I'm trying to save the cookies in public ReadOnlyCollection<Cookie> Cookies { get; set; } which is the result of WebDriver.Manage().Cookies.AllCookies; Assuming login worked and cookies were saving

[WinError 2]FileNotFoundError in python Selenium webDriver

匆匆过客 提交于 2021-02-17 06:57:22
问题 I'm started to learn python Selenium. I just downloaded by pip pip install python-selenium and started to write first lines and at this moment appeares >>> from selenium import webdriver >>> from selenium.webdriver.common.keys import Keys >>> driver = webdriver.Firefox() [WinError2] FileNotFoundError... ... Then I tried it with Chrome but appeares the same thing. Who can solve this problem? 回答1: You do following things and check whether it works. Upgrade python bindings using pip install -U

WebDriverException: disconnected: unable to connect to renderer even on providing correct path of latest chromedriver

我怕爱的太早我们不能终老 提交于 2021-02-16 14:52:37
问题 package Testing_Forum; import java.util.concurrent.TimeUnit; import org.openqa.selenium.PageLoadStrategy; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class XTR { public static void main(String arg[]) { System.getProperty("webdriver.chrome.driver,D:\\Important\\chromedriver_win32_important\\chromedriver.exe"); WebDriver driver=new ChromeDriver(); driver.get("https://www.google.com/"); driver.manage().window().maximize(); driver.manage().timeouts