webautomation

How to get a specific frame in a web page and retrieve its content

别等时光非礼了梦想. 提交于 2019-12-21 06:25:58
问题 I wanted to access the translation results of the following url http://translate.google.com/translate?hl=en&sl=en&tl=ar&u=http%3A%2F%2Fwww.saltycrane.com%2Fblog%2F2008%2F10%2Fhow-escape-percent-encode-url-python%2F the translation is displayed in the bottom content frame out of the two frames. I am interested in retrieving only the bottom content frame to get the translations selenium for python allows us to fetch page contents via web automation: browser.get('http://translate.google.com/#en

Using internetexplorer object what is the correct way to wait for an ajax response?

。_饼干妹妹 提交于 2019-12-20 05:38:05
问题 I tried to upload a file to a sharepoint library, my code fails to properly detect if ie is still waiting for an ajax response or not. What is the proper way to do this ? [void] [System.Reflection.Assembly]::LoadWithPartialName("'Microsoft.VisualBasic") [void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms") function wait4IE($ie=$global:ie){ while ($ie.busy -or $ie.readystate -lt 4){start-sleep -milliseconds 200} } $global:ie=new-object -com "internetexplorer

Accessing an element with no attributes in Watir

痴心易碎 提交于 2019-12-17 18:59:22
问题 Using Watir, is there a way to access an element without attributes? For example: <span>Text</span> I'd like to avoid using xpath, but if that's the only way it's cool. 回答1: Disregarding the non-WATIR issues of having tags in the first place, or requesting unique attributes from your developers (or yourself), you can always access an element via its parent elements, or by index. For example: Text @browser.div(:name => "content").span(:index => 1) #this is the first span element inside this

How can I login to a website with Python?

隐身守侯 提交于 2019-12-17 02:25:44
问题 How can I do it? I was trying to enter some specified link (with urllib), but to do it, I need to log in. I have this source from the site: <form id="login-form" action="auth/login" method="post"> <div> <!--label for="rememberme">Remember me</label><input type="checkbox" class="remember" checked="checked" name="remember me" /--> <label for="email" id="email-label" class="no-js">Email</label> <input id="email-email" type="text" name="handle" value="" autocomplete="off" /> <label for=

jbehave + thucydides: how to override 300s timeout

放肆的年华 提交于 2019-12-12 14:04:18
问题 I'm using thucydides jbehave plugin to run Selenium tests. However, I can't run tests longer than 5 min in total due to jbehave timeout. I can't figure out how can thucydides/jbehave should be configured to override this limitation. Selenium tests use to be longer that 5 mins, so that should be an actual problem for many people. 回答1: To override the timeout the user should add thucydides.properties file to the main folder of the project (if you use thucidides jbehave archetype, there is no

can't convert webbot script to an executable

假装没事ソ 提交于 2019-12-12 01:03:21
问题 I am trying to convert a python script which uses the webbot library for web automation. As I tried to convert my running Python (3.6.5) script to an .exe file using pyinstaller I was getting an error that the path of the webbot module could not be found. In order to overcome this problem I tried to specify the path of the module in the spec file, without success. An easier workaround suggests copying the downloaded folder webbot in the same folder where the .exe file is. Its a very handy

Multi-threaded C# Selenium WebDriver automation with Uris not known beforehand

喜欢而已 提交于 2019-12-11 12:08:47
问题 I need to perform some simultaneous webdrivers manipulation, but I am uncertain as to how to do this. What I am asking here is: What is the correct way to achieve this ? What is the reason for the exception I am getting (revealed below) After some research I ended up with: 1 . The way I see people doing this (and the one I ended up using after playing with the API, before searching) is to loop over the window handles my WebDriver has at hand, and perform a switch to and out of the window

Selenium Chrome WebDriver how to scroll horizontally

耗尽温柔 提交于 2019-12-11 01:55:06
问题 Chrome web driver has a limitation that only loads webpage content that is in view. I have a website that has long horizontal table. I have Xpath that extracts column headers of a table that stretches more than the screen width. In chrome dev tool console if I run the xpath $x(myxpathgoeshere) I get all the headers including the ones that are not in view(the one that makes you scroll to see all). So I know my xpath is correct. But in code, when I access it by using selenium webdriver it only

Wait for a particular URL in selenium

大城市里の小女人 提交于 2019-12-11 00:38:43
问题 I have the requirement of waiting for a particular URL in website automation using Selenium in Chrome browser. The user will be doing online payment on our website. Fro our website user is redirected to the payment gateway. When the user completes the payment, the gateway will redirect to our website. I want to get notified redirection from gateway to our site. I got an example which waits for “Particular Id” in the web page, here is vb.net code driver.Url = "http://gmail.com" Dim wait As New

Selecting value from a dropdown list on a webpage using vba

夙愿已清 提交于 2019-12-10 12:12:20
问题 On this site I am able to select the country and language from dropdown menu but when I click on "Complete new application form" button. It says fields are empty. Any help would be appreciated. Sub Test() strURL = "https://visa.kdmid.ru/PetitionChoice.aspx" With ie .Visible = True .navigate strURL While .Busy DoEvents Wend Set html = .document 'Country where you will apply for visa. Set ctY = html.getElementById("ctl00$phBody$Country") For i = 1 To ctY.Options.Length If ctY.Options(i).Text =