selenium

How to switch window handles using Selenium and Python

醉酒当歌 提交于 2021-02-05 08:56:33
问题 If you click a link in a Windows program other than a web browser, a pop-up window appears. I want to get the url of this popup window. Pop-up windows will only open in IE. driver = webdriver.Ie('C://Users/aaa/IEDriverServer.exe') driver.implicitly_wait(3) pyautogui.moveTo(1576, 660) pyautogui.click() time.sleep(3) driver.switch_to_window(driver.window_handles[1]) # error =>driver.switch_to_window(driver.window_handles[1]) # IndexError: list index out of range driver.get_window_position

How to remove the message Browser is under remote control from Firefox using Selenium

[亡魂溺海] 提交于 2021-02-05 08:53:19
问题 I want to remove this machine icon while running firefox using selenium using python3 Here is my code :- from selenium import webdriver from webdriver_manager.firefox import GeckoDriverManager from selenium.webdriver.firefox.firefox_binary import FirefoxBinary profile = webdriver.FirefoxProfile('C:\\Users\\you\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\64nrwj2y.default-release') PROXY_HOST = "87.255.27.163" PROXY_PORT = "3128" user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3)

How to remove the message Browser is under remote control from Firefox using Selenium

痴心易碎 提交于 2021-02-05 08:53:05
问题 I want to remove this machine icon while running firefox using selenium using python3 Here is my code :- from selenium import webdriver from webdriver_manager.firefox import GeckoDriverManager from selenium.webdriver.firefox.firefox_binary import FirefoxBinary profile = webdriver.FirefoxProfile('C:\\Users\\you\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\64nrwj2y.default-release') PROXY_HOST = "87.255.27.163" PROXY_PORT = "3128" user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3)

How to locate the last web element using classname attribute through Selenium and Python

若如初见. 提交于 2021-02-05 08:47:05
问题 getphone = driver.find_element_by_class_name('_3ko75')[-1] phone = getphone.get_attribute("title") Not working I need to get the title on string format. Exception has occurred: TypeError 'WebElement' object is not subscriptable File "C:\Users\vmaiha\Documents\Python Projects\Project 01\WP_Answer.py", line 43, in check getphone = driver.find_element_by_class_name('_3ko75')[-1] 回答1: Based on your code trials, to get the title of the last WebElement based on the value of the classname attribute

SessionNotCreatedException: Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary'

感情迁移 提交于 2021-02-05 08:41:29
问题 When I try to create a Firefox instance in Selenium, I get the following error: Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line I'm running on Ubuntu 20.04 Any suggestions would be appreciated . browser = webdriver.Firefox() Traceback (most recent call last): File "key.py", line 10, in <module> browser = webdriver.Firefox() File "/usr/local/lib/python3.8

Ember: Best practices with Selenium to make integration tests in browser

岁酱吖の 提交于 2021-02-05 08:36:21
问题 Have you any experiences/examples to make Selenium tests with ember.js? I cannot "grab" views (I use router), because they have not-deterministic ids. Any ideas? 回答1: You can set your own id's for view elements explicitly. Directly from handlebars like: {{#view Ember.TextField elementId="my_id"}} Or from your view object: MyApp.MyView = Ember.View.Extend({ elemntId: "my_id" }); 回答2: EmberJS generates/assigns dynamic values for id attributes, example, ember32 , ember33 , ember34 , etc. In

How to run a maven Project?

扶醉桌前 提交于 2021-02-05 08:29:10
问题 I have created java project called OneReports . How can i shift the entire project to Maven. Once i shifted to maven how can run in command prompt. Currently i have the problem of dependency. So i plan to move the project. Could anyone help me to step by step process. C:\Jars>javac -cp "C:\Program Files\Java\selenium\*.jar";"OneReports.jar";"testng.jar" test\TestngTestSuiteUsingXML.java C:\Jars>java -cp "C:\Program Files\Java\selenium\*.jar";"OneReports.jar";"testng.jar" test

How to run a maven Project?

让人想犯罪 __ 提交于 2021-02-05 08:29:07
问题 I have created java project called OneReports . How can i shift the entire project to Maven. Once i shifted to maven how can run in command prompt. Currently i have the problem of dependency. So i plan to move the project. Could anyone help me to step by step process. C:\Jars>javac -cp "C:\Program Files\Java\selenium\*.jar";"OneReports.jar";"testng.jar" test\TestngTestSuiteUsingXML.java C:\Jars>java -cp "C:\Program Files\Java\selenium\*.jar";"OneReports.jar";"testng.jar" test

java.lang.UnsupportedClassVersionError: org/openqa/selenium/WebDriver : Unsupported major.minor version 52.0 error with Selenium through Java 7

China☆狼群 提交于 2021-02-05 08:28:06
问题 This is the code of selenium code to open the chrome browser and closing it. import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.By; public class TC001_Login_Logout { public static void main(String args[]) throws Exception { System.setProperty("webdriver.chrome.driver", "C:\\Eclipse\\Selenium\\chrome"); WebDriver driver = new ChromeDriver(); driver.get("http://127.0.0.1/orangehrm-2.6/login.php"); System.out.println("Application

Java selenium how to open a link from google search results?

坚强是说给别人听的谎言 提交于 2021-02-05 08:25:08
问题 I am new to automation testing in Selenium and i am doing some basic automation testing such as searching for something in Google and then clicking on a link which is required from the search results. The code below, which i have produced works up until i get to the testing method. I am unable to select a link from the Google search page but i am not being shown any errors on my console. So i setup a thread on this particular line and it mentioned it could find the link name however the link