selenium-webdriver

How to handle Windows file upload in .Net core using Selenium?

ⅰ亾dé卋堺 提交于 2020-05-14 10:25:31
问题 I am new to the C# world and I want to know how can a Windows file upload form be automated using Selenium in a .Net core project as it doesn't support AutoIt. 回答1: Zehra - It really depends on how precise you want to get to mimicking the user functionality. Typically you click a button that opens a windows dialog where you locate the file on your pc/phone. Since this is really not testing the application and is just a Windows function, I just use send keys. If you want to get more precise,

Block request URL selenium firefox python

佐手、 提交于 2020-05-14 07:46:13
问题 Im trying to block certain URLs while acessing a website. Meaning i only make the requests required to proceed. There is one url automatically loading a 5mb code i cant block disabling css by firefox profiles. I read selenium doesnt allow that amount of control but im unshure if there is some way to set it using an addon. However im unable to control block url addon using python. Is there any way apart from modifying the hosts file? I sucessfully blocked the urls using network monitor

Block request URL selenium firefox python

白昼怎懂夜的黑 提交于 2020-05-14 07:45:11
问题 Im trying to block certain URLs while acessing a website. Meaning i only make the requests required to proceed. There is one url automatically loading a 5mb code i cant block disabling css by firefox profiles. I read selenium doesnt allow that amount of control but im unshure if there is some way to set it using an addon. However im unable to control block url addon using python. Is there any way apart from modifying the hosts file? I sucessfully blocked the urls using network monitor

OpenQA.Selenium.WebDriverException: 'Cannot start the driver service on http://localhost:60623/'

允我心安 提交于 2020-05-14 07:15:10
问题 Following code worked well in the past. After some days, I try to run it again but it throws such error. using OpenQA.Selenium; using OpenQA.Selenium.Chrome; using OpenQA.Selenium.Support.UI; public static ChromeDriver driver; protected void initDriver(string userDataPath) { var driverService = ChromeDriverService.CreateDefaultService(AppDomain.CurrentDomain.BaseDirectory); ChromeOptions options = new ChromeOptions(); driverService.HideCommandPromptWindow = true; //options.AddArguments("-

OpenQA.Selenium.WebDriverException: 'Cannot start the driver service on http://localhost:60623/'

点点圈 提交于 2020-05-14 07:11:48
问题 Following code worked well in the past. After some days, I try to run it again but it throws such error. using OpenQA.Selenium; using OpenQA.Selenium.Chrome; using OpenQA.Selenium.Support.UI; public static ChromeDriver driver; protected void initDriver(string userDataPath) { var driverService = ChromeDriverService.CreateDefaultService(AppDomain.CurrentDomain.BaseDirectory); ChromeOptions options = new ChromeOptions(); driverService.HideCommandPromptWindow = true; //options.AddArguments("-

OpenQA.Selenium.WebDriverException: 'Cannot start the driver service on http://localhost:60623/'

拥有回忆 提交于 2020-05-14 07:11:08
问题 Following code worked well in the past. After some days, I try to run it again but it throws such error. using OpenQA.Selenium; using OpenQA.Selenium.Chrome; using OpenQA.Selenium.Support.UI; public static ChromeDriver driver; protected void initDriver(string userDataPath) { var driverService = ChromeDriverService.CreateDefaultService(AppDomain.CurrentDomain.BaseDirectory); ChromeOptions options = new ChromeOptions(); driverService.HideCommandPromptWindow = true; //options.AddArguments("-

Cannot locate a partial id on selenium

99封情书 提交于 2020-05-13 09:47:08
问题 Hi everyone ! I am trying to locate an element with a dynamic ID, but ! whatever i do, the except NoSuchElementException is systematically raised... There is my code : try: driver.get('http://www.website.com/') usr = driver.find_element_by_css_selector("a[id*='txtEmail']") pwd = driver.find_element_by_css_selector("a[id*='txtPassword']") usr.send_keys(username) pwd.send_keys(password) driver.find_element_by_css_Selector("a[id*='btnLogin']").click() if (driver.find_element_by_css_Selector("a

Cannot locate a partial id on selenium

99封情书 提交于 2020-05-13 09:46:28
问题 Hi everyone ! I am trying to locate an element with a dynamic ID, but ! whatever i do, the except NoSuchElementException is systematically raised... There is my code : try: driver.get('http://www.website.com/') usr = driver.find_element_by_css_selector("a[id*='txtEmail']") pwd = driver.find_element_by_css_selector("a[id*='txtPassword']") usr.send_keys(username) pwd.send_keys(password) driver.find_element_by_css_Selector("a[id*='btnLogin']").click() if (driver.find_element_by_css_Selector("a

Cannot locate a partial id on selenium

浪子不回头ぞ 提交于 2020-05-13 09:45:34
问题 Hi everyone ! I am trying to locate an element with a dynamic ID, but ! whatever i do, the except NoSuchElementException is systematically raised... There is my code : try: driver.get('http://www.website.com/') usr = driver.find_element_by_css_selector("a[id*='txtEmail']") pwd = driver.find_element_by_css_selector("a[id*='txtPassword']") usr.send_keys(username) pwd.send_keys(password) driver.find_element_by_css_Selector("a[id*='btnLogin']").click() if (driver.find_element_by_css_Selector("a

How to automatically accept Chrome's “Always open these types of links in the associated app” dialogs in Selenium

匆匆过客 提交于 2020-05-13 06:42:38
问题 I'm automating tests using Selenium and C# and I need to open an external app from the browser. The problem is, I always get this notification and it blocks the test execution. Does anyone know how to deal with this? 回答1: Chrome stores the settings for the acceptance of protocol handlers in the user profile. When running Chrome from Selenium, Chrome doesn't seem to use the standard Chrome user profile by default, and instead uses some default settings that are not persisted. To get around