selenium-webdriver

clear() does not clear the textbox with selenium and python and firefox

左心房为你撑大大i 提交于 2020-02-03 10:47:52
问题 clear() does not work in this case. I am getting append after append. searchForMovie.clear() is not working... I have also tried to send CTRL + 'a' , and then the DELETE . Again all I got are just appends... for movie in allMissing: time.sleep (10) searchForMovie = WebDriverWait (driver, 10).until \ (EC.presence_of_element_located ((By.CSS_SELECTOR, "#search-text"))) searchForMovie.send_keys (movie) # click enter = WebDriverWait (driver, 10).until \ (EC.presence_of_element_located ((By.CSS

Selenium PHPUnit select element by label text

独自空忆成欢 提交于 2020-02-02 16:12:34
问题 I have the following HTML code snippet: <div class="modal-body" style="max-height: 317px;"> <div class="radio"> <label> <input type="radio" name="template" value="5"> <img src="/img/custom-icons/Monitor.png" style="height: 24px"> First descriptive title <p class="text-muted">Some description text</p> </label> </div> <div class="radio"> <label> <input type="radio" name="template" value="37"> <img src="/img/custom-icons/Monitor.png" style="height: 24px"> Second descriptive title <p class="text

Selenium python duplicate images

自作多情 提交于 2020-02-02 12:49:45
问题 Using python to upload images to control over selenium. It works perfect but for some reason it duplicate the images. I.E - First image is uploaded Upload as main picture is confirmed. Second image is uploaded Third images is uploaded + 2 image re uploaded etc ... Using this code for pair in pair_list: file = pathlib.Path(pair) if file.exists (): #HERE I RESIZE PHOTO basewidth = 580 img = Image.open(pair) wpercent = (basewidth/float(img.size[0])) hsize = int((float(img.size[1])*float(wpercent

How to block all pop ups using webdriver?

旧巷老猫 提交于 2020-02-02 12:03:30
问题 How to block all pop ups using webdriver+java? I know how to handle pop ups but i don't want pop up at all, i want to block all the pop ups just like a pop up blocker in a browser... 回答1: FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("dom.popup_maximum", 0); profile.setPreference("privacy.popups.showBrowserMessage", false); FirefoxDriver fd = new FirefoxDriver(profile); fd.get("http://example.com"); 回答2: Try fp = webdriver.FirefoxProfile() fp.set_preference("privacy

How to block all pop ups using webdriver?

馋奶兔 提交于 2020-02-02 12:03:07
问题 How to block all pop ups using webdriver+java? I know how to handle pop ups but i don't want pop up at all, i want to block all the pop ups just like a pop up blocker in a browser... 回答1: FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("dom.popup_maximum", 0); profile.setPreference("privacy.popups.showBrowserMessage", false); FirefoxDriver fd = new FirefoxDriver(profile); fd.get("http://example.com"); 回答2: Try fp = webdriver.FirefoxProfile() fp.set_preference("privacy

What is arguments[0] while invoking execute_script() method through WebDriver instance through Selenium and Python?

不想你离开。 提交于 2020-02-02 12:01:09
问题 I'm trying to crawl the pages that I interested in. For this, I need to remove attribute of element from HTML. 'style' is what I want to remove. So I find some codes from Stackoverflow.(i'm using Chrome for driver) element = driver.find_element_by_xpath("//select[@class='m-tcol-c' and @id='searchBy']") driver.execute_script("arguments[0].removeAttribute('style')", element) What does arguments[0] do in the code? Can anyone explain arguments[0] 's roles concretely? 回答1: arguments is what you're

What is arguments[0] while invoking execute_script() method through WebDriver instance through Selenium and Python?

我的未来我决定 提交于 2020-02-02 11:56:45
问题 I'm trying to crawl the pages that I interested in. For this, I need to remove attribute of element from HTML. 'style' is what I want to remove. So I find some codes from Stackoverflow.(i'm using Chrome for driver) element = driver.find_element_by_xpath("//select[@class='m-tcol-c' and @id='searchBy']") driver.execute_script("arguments[0].removeAttribute('style')", element) What does arguments[0] do in the code? Can anyone explain arguments[0] 's roles concretely? 回答1: arguments is what you're

What is arguments[0] while invoking execute_script() method through WebDriver instance through Selenium and Python?

别等时光非礼了梦想. 提交于 2020-02-02 11:56:27
问题 I'm trying to crawl the pages that I interested in. For this, I need to remove attribute of element from HTML. 'style' is what I want to remove. So I find some codes from Stackoverflow.(i'm using Chrome for driver) element = driver.find_element_by_xpath("//select[@class='m-tcol-c' and @id='searchBy']") driver.execute_script("arguments[0].removeAttribute('style')", element) What does arguments[0] do in the code? Can anyone explain arguments[0] 's roles concretely? 回答1: arguments is what you're

Get Session ID for a Selenium RemoteWebDriver in C#

二次信任 提交于 2020-02-02 02:25:32
问题 I'm trying to get a session id for a test being run on the SauceLabs cloud, but I can't seem to access it. I've tried the following approaches: //Returns null var sessionId = (string)((RemoteWebDriver)driver).Capabilities.GetCapability("webdriver.remote.sessionid"); //Will not compile sessionId = ((RemoteWebDriver)driver).SessionId; //This is protected. The second approach is particularly confusing. It's a protected property, but if I can only access this from a derived class, then it's

Get Session ID for a Selenium RemoteWebDriver in C#

纵然是瞬间 提交于 2020-02-02 02:25:06
问题 I'm trying to get a session id for a test being run on the SauceLabs cloud, but I can't seem to access it. I've tried the following approaches: //Returns null var sessionId = (string)((RemoteWebDriver)driver).Capabilities.GetCapability("webdriver.remote.sessionid"); //Will not compile sessionId = ((RemoteWebDriver)driver).SessionId; //This is protected. The second approach is particularly confusing. It's a protected property, but if I can only access this from a derived class, then it's