selenium-webdriver

How to bring browser to front using Selenium WebDriver?

孤人 提交于 2020-02-06 08:13:06
问题 I've a test where it handles login system popup using Robot of Java. But because of some issues, other applications or browser instance come to front and Robot could not perform actions on system popup of Windows. Hence before interacting with system popup using Robot , I want to bring that browser to front on machine. I tried following but it did not help - ((JavascriptExecutor)driver).executeScript("window.focus();"); Could you please suggest how I can bring it to the front? 来源: https:/

How to bring browser to front using Selenium WebDriver?

早过忘川 提交于 2020-02-06 08:12:06
问题 I've a test where it handles login system popup using Robot of Java. But because of some issues, other applications or browser instance come to front and Robot could not perform actions on system popup of Windows. Hence before interacting with system popup using Robot , I want to bring that browser to front on machine. I tried following but it did not help - ((JavascriptExecutor)driver).executeScript("window.focus();"); Could you please suggest how I can bring it to the front? 来源: https:/

Microsoft Web Driver has stopped working. A problem cause the program to stop working correctly error using EdgeDriver and Microsoft Edge in Selenium

旧城冷巷雨未停 提交于 2020-02-05 06:54:18
问题 How do I run Microsoft Edge in Selenium. Each time I run a test, the Edge browser opens but does not load any URL. It then displays a small dialog box with the text: Microsoft Web Driver has stopped working. A problem cause the program to stop working correctly. Please close the program I am using: Windows 10 OS 17763.914 Selenium.WebDriver.MicrosoftDriver version 17.17134.0 Selenium support Version 3.141.0 Selenium Web-driver version 3.141.0 and Microsoft Edge Browser Version 18.17763. It's

What is difference between selenium-server-standalone and selenium-server.

核能气质少年 提交于 2020-02-05 05:22:45
问题 I can see two repository in Maven Central repo. Please clarify what is difference between both jars 回答1: This is explained in the Selenium documentation: You may, or may not, need the Selenium Server, depending on how you intend to use Selenium-WebDriver. If your browser and tests will all run on the same machine, and your tests only use the WebDriver API, then you do not need to run the Selenium-Server; WebDriver will run the browser directly. There are some reasons though to use the

How does Selenium click on elements that are 50% on screen and 50% not on screen?

与世无争的帅哥 提交于 2020-02-05 02:53:33
问题 There is a div-Element. 50% of its size are on the screen. The other 50% go over the screen height and are not visible. There is no scrolling possible. I tried to automate a test with Selenium and click on that div-element, but sometimes it works and sometimes it does not. Why does Selenium not just click on the "on-screen-area" of that div? And how is this functionality implemented? When I tell Selenium to click on a huge div-element, does it click on a random position on that div? 回答1:

How does Selenium click on elements that are 50% on screen and 50% not on screen?

半城伤御伤魂 提交于 2020-02-05 02:52:13
问题 There is a div-Element. 50% of its size are on the screen. The other 50% go over the screen height and are not visible. There is no scrolling possible. I tried to automate a test with Selenium and click on that div-element, but sometimes it works and sometimes it does not. Why does Selenium not just click on the "on-screen-area" of that div? And how is this functionality implemented? When I tell Selenium to click on a huge div-element, does it click on a random position on that div? 回答1:

Why chrome browser doesn't launch when running Selenium chrome driver on Ubuntu 18.04

China☆狼群 提交于 2020-02-05 02:50:10
问题 I am getting various errors when I'm trying to run a python program using Selenium library and chromedriver. I follow the instructions on Selenium website to install all what I needed and then start programming my two first lines : from selenium.webdriver import Chrome driver = Chrome() I got this error message : WebDriverException Traceback (most recent call last) <ipython-input-16-dce6fb94cc37> in <module> 1 from selenium.webdriver import Chrome 2 ----> 3 driver = Chrome() ~/anaconda3/lib

How to get text of td element using selenium?

左心房为你撑大大i 提交于 2020-02-04 05:29:05
问题 I have an html table. I need to get the text of a td element with selenium. Html structure: <table id="myTable"> <tbody> <tr> <td> <b>Success: </b> You have transferred 1,000.00 USD to DIST2. Your balance is now 19,979,000.00 USD. ref: 2017011806292760301000301 </td> </tr> </tbody> </table> I tried using driver.findElement(By.xpath("//table[@id='myTable']/tbody/tr/td")).getText(); It is returning blank string. I need to get "You have transferred 1,000.00 USD to DIST2. Your balance is now 19

How to deal with single and double quotes in xpath in Python

谁都会走 提交于 2020-02-04 03:47:05
问题 I have an XPath which has a single quote in XPath which is causing a SyntaxError: error . I've tried with escape sequence: xpath = "//label[contains(text(),'Ayuntamiento de la Vall d'Uixó - Festivales Musix')]" But I am still facing an error: SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//label[contains(text(),'Ayuntamiento de la Vall d'Uixó - Festivales Musix')]' is not a valid XPath expression. 回答1: There is no quote escaping in XPath string literals. (Note: This

org.testng.TestNGException: sun.security.provider.certpath.SunCertPathBuilderException

Deadly 提交于 2020-02-03 16:44:37
问题 I am getting: org.testng.TestNGException: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:325) at org.testng.remote.AbstractRemoteTestNG.initialize(AbstractRemoteTestNG.java:136) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:97) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251) at org.testng.remote.RemoteTestNG.main