selenium

How to count the elements from a class with VBA + SELENIUM in chrome?

╄→尐↘猪︶ㄣ 提交于 2021-02-10 12:25:28
问题 I want to count the numbers of elements aiming to get all their names and store in an array. The names are highlighted in this image The names are store in "js-list list-wrapper" as shown in image My code: Public Sub seleniumtutorial() Dim bot As New SeleniumWrapper.WebDriver Dim a As WebElement Dim b As WebElement Dim x() As Integer bot.Start "chrome", "https://trello.com/login" bot.get "/" bot.Type "name=user", "biaverly@id.uff.br" bot.Type "name=password", "carambola69" bot.clickAndWait

Selenium Python Get Img SRC Returns Actual Image Data

萝らか妹 提交于 2021-02-10 12:22:31
问题 I am working with Selenium in Python and using Firefox web driver. I am trying to get the SRC of an image. When I first request the SRC I get the actual image data, not the SRC data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ ... If I run the exact same code a second time I will get the SRC example.jpg Here is my code fireFoxOptions = webdriver.FirefoxOptions() fireFoxOptions.set_headless() browser = webdriver.Firefox(firefox_options=fireFoxOptions) element = browser.find_element(By.ID ,

Selenium Python Get Img SRC Returns Actual Image Data

烂漫一生 提交于 2021-02-10 12:22:28
问题 I am working with Selenium in Python and using Firefox web driver. I am trying to get the SRC of an image. When I first request the SRC I get the actual image data, not the SRC data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ ... If I run the exact same code a second time I will get the SRC example.jpg Here is my code fireFoxOptions = webdriver.FirefoxOptions() fireFoxOptions.set_headless() browser = webdriver.Firefox(firefox_options=fireFoxOptions) element = browser.find_element(By.ID ,

How to change Allow sites to save and read cookie data (recommended) and/or Block third-party cookies

半城伤御伤魂 提交于 2021-02-10 12:13:30
问题 I've requirement to test webpages using Selenium with below cookies settings 1. Allow sites to save and read cookie data (recommended) 2. Block third-party cookies I found link how to disable cookies using webdriver for Chrome and FireFox JAVA, which does setting at global level and not individual setting under Cookies. 回答1: It depends on the driver. With Chrome and Firefox you can set the behavior by setting the preferences with the driver. Preferences with Chrome to allow/block the cookies:

How to change Allow sites to save and read cookie data (recommended) and/or Block third-party cookies

你。 提交于 2021-02-10 12:11:17
问题 I've requirement to test webpages using Selenium with below cookies settings 1. Allow sites to save and read cookie data (recommended) 2. Block third-party cookies I found link how to disable cookies using webdriver for Chrome and FireFox JAVA, which does setting at global level and not individual setting under Cookies. 回答1: It depends on the driver. With Chrome and Firefox you can set the behavior by setting the preferences with the driver. Preferences with Chrome to allow/block the cookies:

Parameterization in Selenium and TestNG

一笑奈何 提交于 2021-02-10 11:31:45
问题 I am learning Selenium by my own. I am not sure about the right way to parameterize the test cases while using Selenium with TestNG Framework. Is it better to pass the parameters in TestNG.XML file OR keep a seperate spreadsheet. For example, I need to parameterize LOGIN functionality with 100 different users' login details. Where to keep the username/password details of 100 users? If Parametrization through a spreadsheet works best, then what exactly is the purpose of having a testng.xml

Parameterization in Selenium and TestNG

和自甴很熟 提交于 2021-02-10 11:29:53
问题 I am learning Selenium by my own. I am not sure about the right way to parameterize the test cases while using Selenium with TestNG Framework. Is it better to pass the parameters in TestNG.XML file OR keep a seperate spreadsheet. For example, I need to parameterize LOGIN functionality with 100 different users' login details. Where to keep the username/password details of 100 users? If Parametrization through a spreadsheet works best, then what exactly is the purpose of having a testng.xml

“Couldn't connect to the RemoteTestNG Client” at launch of TestNG on OSX-mountain-lion

孤街醉人 提交于 2021-02-10 09:22:09
问题 I am attempting to run the most basic example test using Eclipse, Selenium, Maven, and TestNG. I can run a test with Eclipse (or IntelliJ), Selenium, and Maven, (jUnit also works) but when I try to add in TestNG, I get the following: "Couldn't connect to RemoteTestNG client. Make sure you don't have an older version of testng.jar on your class path. Reason: Timeout while trying to contact RemoteTestNG." I have followed several tutorials and youtube walkthroughs. I performed the same steps on

Double Click does not work with headless Selenium in Python

ⅰ亾dé卋堺 提交于 2021-02-10 08:02:56
问题 Im trying to double click on a selected element on a website using selenium in headless mode, however the double click action does not work. My chrome version is 72. Any help would be greatly appreciated. Below is the relevant portion of my code. element = driver.find_element_by_id('player-forpost-html5').click() time.sleep(5) action = ActionChains(driver) element_1 = driver.find_element_by_id('player-forpost-html5') action.move_to_element(element_1) action.double_click(element_1) action

Double Click does not work with headless Selenium in Python

时光毁灭记忆、已成空白 提交于 2021-02-10 08:02:22
问题 Im trying to double click on a selected element on a website using selenium in headless mode, however the double click action does not work. My chrome version is 72. Any help would be greatly appreciated. Below is the relevant portion of my code. element = driver.find_element_by_id('player-forpost-html5').click() time.sleep(5) action = ActionChains(driver) element_1 = driver.find_element_by_id('player-forpost-html5') action.move_to_element(element_1) action.double_click(element_1) action