webdriver

How to use existing login token for telegram web using selenium webdriver

独自空忆成欢 提交于 2021-01-01 07:12:33
问题 I'm trying to read telegram messages from https://web.telegram.org with selenium. When i open https://web.telegram.org in firefox i'm already logged in, but when opening the same page from selenium webdriver(firefox) i get the login page. I saw that telegram web is not using cookies for the auth but rather saves values in local storage. I can access the local storage with selenium and have keys there such as: "dc2_auth_key", "dc2_server_salt", "dc4_auth_key", ... but I'm not sure what to do

Message “org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the XPath expression” using sendKeys

假装没事ソ 提交于 2020-12-21 02:15:51
问题 I am having trouble trying to upload a file using Selenium. I am not able to use the sendKeys() function to pass the path due to the browse button not having an input tag. It's written in Angular. Here's the browse button element: <a id="attachmentUpload-browse0" name="attachmentUpload-browse0" ng-click="clickBrowse($index)" class="btn-pri" xpath="1"></a> I did find an input tag right below the code above in the source, but I am getting errors when trying to use .sendKeys() . <input type=

Message “org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the XPath expression” using sendKeys

我们两清 提交于 2020-12-21 02:13:31
问题 I am having trouble trying to upload a file using Selenium. I am not able to use the sendKeys() function to pass the path due to the browse button not having an input tag. It's written in Angular. Here's the browse button element: <a id="attachmentUpload-browse0" name="attachmentUpload-browse0" ng-click="clickBrowse($index)" class="btn-pri" xpath="1"></a> I did find an input tag right below the code above in the source, but I am getting errors when trying to use .sendKeys() . <input type=

Message “org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the XPath expression” using sendKeys

时光毁灭记忆、已成空白 提交于 2020-12-21 02:13:02
问题 I am having trouble trying to upload a file using Selenium. I am not able to use the sendKeys() function to pass the path due to the browse button not having an input tag. It's written in Angular. Here's the browse button element: <a id="attachmentUpload-browse0" name="attachmentUpload-browse0" ng-click="clickBrowse($index)" class="btn-pri" xpath="1"></a> I did find an input tag right below the code above in the source, but I am getting errors when trying to use .sendKeys() . <input type=

Loop through Web Elements and Click each link

£可爱£侵袭症+ 提交于 2020-12-15 06:24:23
问题 Hi my code works My goal is to loop through each element in the table and and click the element so i can go to the next page basically I want to do this 1 click element form drop down 2 //code some stuff 3 Go back 4 click next element from drop down 5 code some stuff and etc My code: List<WebElement> CCTable = driver.findElements(By.id("companyIdBarCompListGrid_rows_scrollpane")); for ( WebElement client: CCTable) { System.out.println("\n"+client.getText().substring(0, 20)+"\n"); client.click

Are element IDs numbers in Webdrivers?

梦想的初衷 提交于 2020-12-13 05:37:09
问题 In the specs it seems to state that element IDs are meant to be numbers. However, both Firefox and Chrome (in w3c mode) return something like c87e08da-358e-45a8-b75c-c17cde92f606 . Chrome returns something like 45.32131231423424324324254245 when NOT in w3c mode. So... are they meant to be numbers? Or, are those strings representing numbers? How do I cast them back to Integer? 回答1: As you mentioned element IDs are meant to be numbers , straight answer is No . As Firefox (being W3C compliant)

How to wait for number of elements to be loaded using Selenium and Python

徘徊边缘 提交于 2020-12-13 03:23:05
问题 Let's say I'm selecting with the selector: //img[@data-blabla] And I want to wait for 10 elements to be loaded, not just one. How would this be modified? I'm making a guess with the index [9] WebDriverWait(browser, 5).until(EC.presence_of_element_located((By.XPATH, '//img[@data-blabla][9]'))) 回答1: To wait for 10 elements to load you can use the lambda function and you can use either of the following Locator Strategies: Using > : myLength = 9 WebDriverWait(browser, 20).until(lambda browser:

What's the get_Text() equivalent in python bindings for Selenium/Webdriver

青春壹個敷衍的年華 提交于 2020-12-05 11:56:10
问题 I would like to move from Selenium 1 to Selenium 2. I use python binding however I can not find any get_text() functions. eg. selenium.find_elements_by_css_selector("locator").get_text() Is there such function in python bindings for Selenium/Webdriver ? 回答1: use the '.text' property. element.text 回答2: This line of code... selenium.find_elements_by_css_selector("locator").get_text() ...have exactly two (2) issues to be addressed. Details As per the current documentation get_Text() can be

“Error while loading shared libraries: libnss3.so” while running Gtlab CI job to perform automated testing using webdriverio

随声附和 提交于 2020-12-05 07:16:35
问题 I'm setting up the CI job for automated testing in selenium inside Gitlab CI, but the test is failing due to the issue. 019-09-27T11:03:17.404Z INFO @wdio/cli:Launcher: Run onPrepare hook /builds/shauryav/test-react-ci-cd/node_modules/chromedriver/lib/chromedriver/chromedriver: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory I have tried numbers of solutions like installing package "@wdio/cli": "^5.13.2", "webdriverio": "^5.13.2" but

“Error while loading shared libraries: libnss3.so” while running Gtlab CI job to perform automated testing using webdriverio

╄→гoц情女王★ 提交于 2020-12-05 07:16:09
问题 I'm setting up the CI job for automated testing in selenium inside Gitlab CI, but the test is failing due to the issue. 019-09-27T11:03:17.404Z INFO @wdio/cli:Launcher: Run onPrepare hook /builds/shauryav/test-react-ci-cd/node_modules/chromedriver/lib/chromedriver/chromedriver: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory I have tried numbers of solutions like installing package "@wdio/cli": "^5.13.2", "webdriverio": "^5.13.2" but