browser-automation

How to click on a link that has a certain content in puppeteer?

[亡魂溺海] 提交于 2019-11-30 20:37:47
If I have some content in my page such as: <a>Hi!</a> How can I use Google's Puppeteer to automate the clicking of that element? I need to be able to select it based on its contents alone, not id, class or attribute. Is there something like $('a:contains("Hi!")') that I can leverage to select this element? How can I do this with https://github.com/GoogleChrome/puppeteer thanks Md. Abu Taher First, we have to find element by text. /** * findElemByText - Find an Element By Text * * @param {String} str case-insensitive string to search * @param {String} selector = '*' selector to search * @param

VBA Internet automation code not working when ie.Visible = False

蹲街弑〆低调 提交于 2019-11-30 18:31:07
问题 Good morning, I am struggling to find information on a problem which seems to not have much information available on the internet - that is the "frame notification bar" in internet explorer ( the little yellow window that asks you if you want to "save" or "open" a file downloaded). I will cut to the chase, the issue I am having is that my code works when an internet explorer visibility is set to true, but doesn't work when visibility is set to false. I have stepped through the code in both

How to click on a link that has a certain content in puppeteer?

不问归期 提交于 2019-11-30 16:59:10
问题 If I have some content in my page such as: <a>Hi!</a> How can I use Google's Puppeteer to automate the clicking of that element? I need to be able to select it based on its contents alone, not id, class or attribute. Is there something like $('a:contains("Hi!")') that I can leverage to select this element? How can I do this with https://github.com/GoogleChrome/puppeteer thanks 回答1: First, we have to find element by text. /** * findElemByText - Find an Element By Text * * @param {String} str

how does selenium webdriver upload files to the browser?

你。 提交于 2019-11-30 04:14:50
I am a javascript/java developer and I have been trying to figure out how the selenium webdriver automation framework uploads files from the file system. It is impossible to set a file input via javascript because it is a security violation. Yet somehow webdriver is able to do this with the following command: driver.setFileDetector(new LocalFileDetector()); WebElement upload = driver.findElement(By.id("myfile")); upload.sendKeys("/Users/sso/the/local/path/to/darkbulb.jpg"); driver.findElement(By.id("submit")).click(); So they are setting the value by sending keys to it? I don't get it. I have

Can I automate Chrome request blocking using Selenium-webdriver for Ruby?

点点圈 提交于 2019-11-29 23:11:31
问题 I am a QA automation analyst responsible for testing a multi-platform online banking application. For our automation testing we use RubyMine suite with Gherkin/Cucumber, Ruby-scripted steps and Selenium-webdriver, Watir and page-object gems/libraries. I have a number of scripts that I cannot automate completely without manual intervention, and these include blocking certain network calls through Telerik Fiddler to produce warning pages or error messages, etc. The future of our automation

WatiN and .net winforms WebBrowser control - is DialogWatcher possible?

筅森魡賤 提交于 2019-11-29 02:39:31
Our target is: Watin-enabled browser testing embedded in a .net winform. Currently, we are using a .net WebBrowser control to embed browser behavior in a winform. We are attaching WatiN to the WebBroswer control on the form with code like this ( thanks prostynick ): var thread = new Thread(() => { Settings.AutoStartDialogWatcher = false; var ie = new IE(webBrowser1.ActiveXInstance); ie.GoTo("http://www.google.com"); }); thread.SetApartmentState(ApartmentState.STA); thread.Start(); The problem is this - the "winform browser" needs to handle popups during testing/automation. Question: How can

how does selenium webdriver upload files to the browser?

ぐ巨炮叔叔 提交于 2019-11-29 01:34:08
问题 I am a javascript/java developer and I have been trying to figure out how the selenium webdriver automation framework uploads files from the file system. It is impossible to set a file input via javascript because it is a security violation. Yet somehow webdriver is able to do this with the following command: driver.setFileDetector(new LocalFileDetector()); WebElement upload = driver.findElement(By.id("myfile")); upload.sendKeys("/Users/sso/the/local/path/to/darkbulb.jpg"); driver.findElement

Check if “Please enter an email address” message appears

不打扰是莪最后的温柔 提交于 2019-11-28 23:55:05
Given a simple page: <form> <input type="email"> <button>click</button> </form> If I enter anything in text field that is not e-mail and click the button, Please enter an email address message appears. Is there a way to to check if the message appears using Selenium or Watir? As far as I see, nothing new appears in browser DOM. Since the page is using e-mail check that is built in feature of a browser, does it even make sense to check that error message appears? It is at the same level as checking if browser scroll bar works. We are no longer checking the web application, but the platform

IE 9 not accepting SendKeys

柔情痞子 提交于 2019-11-28 12:54:28
I posted on IE 9 not accepting SendKeys to download a file , but this problem is separate enough from the answer I received to justify another question. My problem is that I can't get IE 9 to accept any of the SendKeys . I have attempted Page Down , Tab , all of the F# keys, and none of them work. Here is the code I am using: Dim ie As Object 'This creates the IE object Sub initializeIE() 'call this subprocedure to start internet explorer up Set ie = CreateObject("internetexplorer.application") pos = 1 End Sub 'Initialize the class object Private Sub Class_Initialize() initializeIE End Sub

Workaround for Python & Selenium: authenticate against Active Directory

半腔热情 提交于 2019-11-28 12:36:39
I am using Python (2.7) and Selenium (3.4.3) to drive Firefox (52.2.0 ESR) via geckodriver (0.19.0) to automate a process on a CentOS 7 machine. I need totally unattended operation of this automation with user credentials passed through; no storage allowed and no breaking in. One piece of drama is being caused by the fact that the internal website required for the process is within an Active Directory domain while the machine running my automation is not. I have no need to validate the user, only pass the credentials to the website in such a way as to not require human interaction or for the