selenium-webdriver

How to validate Check box if xpaths are same in case of selected and unselected

╄→гoц情女王★ 提交于 2021-02-05 07:18:06
问题 M unable to validate checkbox, if it's selected or not because both the HTML are same I tried isSelected(), but it's not working Below is the HTML code for both selected and unselected 1) Selected <label class="c-account-access-panel__checkbox " for="23336" data-js-checkbox-label=""> <input id="23336" class="c-account-access-panel__checkbox-input" type="checkbox" data-label-for-value-missing="Please select at least one account from the options below" data-form-field-validation-on-grid=""

Selenium C# : Not able to click on an element within #shadow-root (closed) which appears when user mouse over

╄→гoц情女王★ 提交于 2021-02-05 06:57:45
问题 I have attached the screenshot for my code and marked the element that i need to click in red. This element appears after we mouse over on another object - and mouse over is successful and i can see this element get displayed, but failed to click on it My code is var LinksSurce = sourceThumb.FindElement(By.ID("linkSource")); LinksSurce.Click(); Error i am getting is Element not intractable NOTE: i have already read and tried the solutions suggested on these posts but none of them working

Selenium Chrome driver - SyntaxError: (unicode error) 'unicodeescape' codec

≯℡__Kan透↙ 提交于 2021-02-05 06:35:27
问题 I am trying to type my first GUI test in pycharm with selenium. I installed selenium by cmd raport: C:>pip install selenium Requirement already satisfied: selenium in c:\users\admin\appdata\local\programs\python\python37-32\lib\site-packages (3.141.0) Requirement already satisfied: urllib3 in c:\users\admin\appdata\local\programs\python\python37-32\lib\site-packages (from selenium) (1.24.1) Then I wrote some code in pycharm: from selenium import webdriver import time driver = webdriver.Chrome

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 85

一笑奈何 提交于 2021-02-05 06:31:07
问题 Hey so I have this simple code to open google using selenium from selenium import webdriver import chromedriver_binary driver = webdriver.Chrome() driver.get('https://google.com') Instead of opening the google page I get this error. Traceback (most recent call last): File "main.py", line 5, in <module> driver = webdriver.Chrome() File "C:\Users\vipku\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in __init__ RemoteWebDriver.__init

Python and Selenium mobile emulation

孤者浪人 提交于 2021-02-04 19:08:50
问题 I'm trying to emulate Chrome for iPhone X with Selenium emulation and Python, as follow: from selenium import webdriver mobile_emulation = { "deviceName": "iphone X" } chrome_options = webdriver.ChromeOptions() chrome_options.add_experimental_option("mobileEmulation", mobile_emulation) driver = webdriver.Chrome(r'C:\Users\Alex\PythonDev\chromedriver') driver.get('https://www.google.com') However, nothing happens: my page is still a normal browser page, and I don't see it as a mobile page.

How to set window-size to fullscreen for headless-chrome using chrome options?

血红的双手。 提交于 2021-02-04 14:58:36
问题 When executing UI tests, I get an error that selenium doesn't support automatic window resizing for chromedriver, which results in tests failing. Is there a way to set this using chrome-options for headless-chrome ? I have tried the following, ChromeOptions options = new ChromeOptions(); options.addArguments("--start-maximized"); Also, replacing "--start-maximized" with "--start-fullscreen" and "--kiosk" . But none of the above worked for me, the only option that works for me is "--window

How to set window-size to fullscreen for headless-chrome using chrome options?

Deadly 提交于 2021-02-04 14:58:09
问题 When executing UI tests, I get an error that selenium doesn't support automatic window resizing for chromedriver, which results in tests failing. Is there a way to set this using chrome-options for headless-chrome ? I have tried the following, ChromeOptions options = new ChromeOptions(); options.addArguments("--start-maximized"); Also, replacing "--start-maximized" with "--start-fullscreen" and "--kiosk" . But none of the above worked for me, the only option that works for me is "--window

How can I translate the webpage opened via Selenium Webdriver to English using Python?

橙三吉。 提交于 2021-02-04 12:45:46
问题 This is my code so far: username_input = "username" password_input = "password" url='myurl' browser = webdriver.Chrome(r'chromedriver.exe') browser.get(url) browser.maximize_window() username = browser.find_element_by_id("j_username") password = browser.find_element_by_id("j_password") username.send_keys(str(username_input)) password.send_keys(str(password_input)) browser.find_element_by_xpath('//*[@id="inner-box"]/form/label[3]/input').click() time.sleep(2) Once I have logged in everything

Finding link using text in CSS Selector is not working

╄→гoц情女王★ 提交于 2021-02-04 08:38:08
问题 I am trying to locate below link by using a[text='This is a link'] and a[innertext='This is a link'] but both of them are not working. I know this can be achieved by using XPath or other ways, but I am curious why CSS Selector that I have used is not working. refer this link. <a title="seleniumframework" href="http://www.seleniumframework.com" target="_blank">This is a link</a> 回答1: You are trying to locate a link by using the following CssSelector s: a[text='This is a link'] a[innertext=

nodejs/selenium webdriver: Can't move mouse to a required position

最后都变了- 提交于 2021-02-04 08:30:08
问题 I'm having trouble in moving mouse pointer in chrome webdriver to a required position in nodejs. I'm using -selenium webdriver 4.0.0-alpha.1 . This is how i'm building the driver const {Builder,By} = require("selenium-webdriver"); let driver = new Builder().forBrowser('chrome').build(); This is where i'm defining the logic to move mouse to a position named value = { x: 262, y: 315 } await driver.wait(until.elementLocated(By.className("OUeyt"))); let a = driver.findElement(By.className("_3Bxar