我认为,这是一个与此不同的问题(远程拒绝主人 - >主人(预接收挂钩拒绝)),很多人都面临同样的问题,所以我在这里发布一个新的.
我的朋友在bitbucket.org上添加了我作为管理员,以便我可以帮助他的项目.所以,我想从我当地的一些最新代码开始.
我遵循的步骤:
git initgit remote -v (这什么都没有)git remote add origin <path to git repo>git remote add master <path to git repo>git remote -v (这显示了fetch和push in括号)git fetch origin mastergit pull origin master (我现在有最新的代码,所有文件和文件夹)touch test (让我们测试"测试"提交)git statusgit add .git commit -m "testing, first commit"git push origin master错误:
Counting objects: 4, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing …Run Code Online (Sandbox Code Playgroud) 我最近下载了Maven和遵循此给出的说明这个页面.我已经在我的机器上安装了ant.现在,如果我想验证Maven是否安装完好,它会给我一个JAVA_HOME设置不正确的错误,但同样适用于ANT.
For Maven I tried :
1. open cmd
2. type mvn -version
3. Error appeared :
C:\Users\Admin>mvn -version
ERROR: JAVA_HOME is set to an invalid directory.
JAVA_HOME = "C:\Program Files\Java\jre7\bin"
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation
For ANT I tried and worked :
1. open cmd
2. type mvn -version
3. Apache Ant(TM) version 1.9.1 compiled on May 15 2013
Run Code Online (Sandbox Code Playgroud)
我去了目录检查java.exe实际上是否存在于该目录中,它就在那里.我检查了他们设置好的环境变量.我重新启动系统并再次检查但同样的问题.请让我知道我错过了什么.
我的问题似乎与此处有所不同测试运行失败:由于"进程崩溃",仪表运行失败.在测试多个Android活动时,
我遵循了pdf中给出的步骤.我已经创建了测试项目"TestAndroidCalculatorBlackbox"(我们需要有两个项目一个测试和一个主项目,也许这可能是原因,因为在Robotium"入门"链接他们希望我们为记事本创建项目),
并添加罐子robotium-solo-5.0.1.jar,robotium-solo-1.6.0.jar以摆脱solo.功能和下面的红色错误行jay.way package.
我附上错误截图:
y AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.testcalculator"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.testcalculator" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" android:debuggable="true">
<uses-library android:name="android.test.runner" />
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)
我在仪表列表中添加了包:
c:\> adb shell pm list instrumentation
instrumentation:PACKAGE.test.test/android.test.InstrumentationTestRunner (target=PACKAGE)
instrumentation:PACKAGE.test.test.test.test.test.test/android.test.InstrumentationTestRunner (target=PACKAGE.test.test)
instrumentation:com.example.android.apis/.app.LocalSampleInstrumentation (target=com.example.android.apis)
>> instrumentation:com.testcalculator/android.test.InstrumentationTestRunner (target=com.testcalculator) <<
Run Code Online (Sandbox Code Playgroud) 使用current_page时,有没有人经历过神秘的路线无法察觉?在Rails 3?即使完全生成的脚手架配有路线,视图和控制器,我也会收到"无路由匹配"错误.
这是代码:
if current_page?(:controller => 'users', :action => "show")
Run Code Online (Sandbox Code Playgroud)
如果我向routes.rb添加"match"命令,它可以正常工作,但是如果资源已经创建,为什么我需要这样做呢?我错过了什么?
之前我把Chrome二进制文件"chromedriver.exe"放在"C:/ Windows"目录中,Watir从那里选择它.现在我必须将我的项目移动到另一台机器,因此我无法对可执行路径进行硬编码.我还希望二进制文件与Git上的代码保持一致,而不是让每个测试工程师在发布新版本时手动更新二进制文件.
现在我已经将Chrome二进制文件放在绝对路径上了,但是找不到它.这是我试过的(hooks.rb):
Before do
puts "inside hooks in before"
profile = Selenium::WebDriver::Chrome::Profile.new
profile['download.prompt_for_download'] = false
profile['download.default_directory'] = File.join(File.absolute_path('../..', File.dirname(__FILE__)),"browsers/chromedriver.exe")
@browser = Watir::Browser.new :chrome, :profile => profile
end
Run Code Online (Sandbox Code Playgroud)
输出是:
inside hooks in before
Selenium::WebDriver::Error::WebDriverError: Unable to find the chromedriver executable. Please download the server from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH. More info at http://code.google.com/p/selenium/wiki/ChromeDriver.
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/chrome/service.rb:21:in `executable_path'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/chrome/service.rb:34:in `default_service'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/chrome/bridge.rb:14:in `initialize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/common/driver.rb:37:in `new'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/common/driver.rb:37:in `for'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver.rb:67:in `for'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.11/lib/watir-webdriver/browser.rb:46:in `initialize'
C:/Users/Admin/watircukepractice/test_puppies/features/support/hooks.rb:11:in `new'
C:/Users/Admin/watircukepractice/test_puppies/features/support/hooks.rb:11:in `Before'
Run Code Online (Sandbox Code Playgroud)
我在Windows 7上,使用Ruby版本1.9.3p551,我指的是教程http://watirwebdriver.com/chrome/.
如何告诉Watir(和Selenium-WebDriver)chromedriver.exe的位置?
我已经尝试了一个级别,但之后我被卡住了.让我分享我遵循的步骤:
main.db在这个位置看到文件C:\Users\Admin\AppData\Roaming\Skype\paul.lowry198.main.db文件,我已安装SQL Lite BB Browser应用程序.chats.在这张桌子上我发了一个查询select * from Chats where friendlyname = 'Jimmy Trevor';结果69结果.可以向我显示消息的正确查询是什么?
我尝试过但没有奏效:
cmd.exe我还在sleep每种类型之后使用了命令,只是为了确保它不会因快速执行而跳过.
;Run application
Run("cmd.exe")
;Wait for CMD to be opened
WinWaitActive("Administrator: C:\Windows\system32\cmd.exe", "", 15)
;Write some commands on cmd
ControlSend("Administrator: C:\Windows\system32\cmd.exe", "", "Edit1", "cd\")
Sleep(10000)
Send("{Enter}")
Sleep(10000)
ControlSend("Administrator: C:\Windows\system32\cmd.exe", "", "Edit1", "cd C:\Program Files (x86)\Jenkins")
Sleep(10000)
Send("{Enter}")
ControlSend("Administrator: C:\Windows\system32\cmd.exe", "", "Edit1", "jenkins.exe start")
Sleep(10000)
Send("{Enter}")
Run Code Online (Sandbox Code Playgroud)
我得到了答案:
ControlSend("Administrator: C:\Windows\system32\cmd.exe", "", "", "cd C:\Program Files (x86)\Jenkins")
Run Code Online (Sandbox Code Playgroud)
我需要删除"编辑",因为cmd不是可编辑的窗口.
我在我的项目构建路径中添加了以下jar:
selenium-server-standalone-2.43.1
,这是我的代码:
public class SampleApp{
WebDriver dr;
@Test
public void testApp() throws MalformedURLException, InterruptedException {
String apkpath = "D:\\apkdump\\sampleapp.apk";
File app = new File (apkpath);
DesiredCapabilities capabilities= new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME,"");
capabilities.setCapability("deviceName","TestADB18");
capabilities.setCapability("platformName","Android");
capabilities.setCapability("app",app.getAbsolutePath());
capabilities.setCapability("appPackage", "com.test");
capabilities.setCapability("appActivity", "com.sampleapp.Main");
dr = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
dr.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
}
}
Run Code Online (Sandbox Code Playgroud)
我正在下面的红线说明了new AppiumDriver这一点Cannot instantiate the type AppiumDriver.现在如果删除所有selenium jars错误消失但我无法用webdriver解决错误.
罐子之间有什么冲突?
我在这里看到了类似的问题但是可以运行代码并且正在获取Null pointer exception但是在我的情况下我甚至无法运行它,它正在运行以保存代码.其次,答案已经发布,没有使用 AppiumDriver
参考:
每当我需要运行我使用的测试JavaScript JavascriptExecutor时,上面的博客都没有说明如何使用它.
我试过了:
js.executeScript(".notransition {
-webkit-transition: none !important;
-moz-transition: none !important;
-o-transition: none !important;
-ms-transition: none !important;
transition: none !important;
}");
Run Code Online (Sandbox Code Playgroud)
但它对我没有任何作用.
编辑:
我试过@AmerllicA提供的答案
public void turnOffCss () {
navigate("https://www.bureauofdigital.com");
js.executeScript("*, *:before, *:after {
-webkit-transition: none !important;
-moz-transition: none !important;
-ms-transition: none !important;
-o-transition: none !important;
transition: none !important;
-webkit-transform: none !important;
-moz-transform: none !important;
-ms-transform: none !important;
-o-transform: none !important;
transform: none !important;
}");
}
Run Code Online (Sandbox Code Playgroud) 我是HtmlUnit的新手,我在登录时遇到了一些麻烦.下面的代码工作得非常好,FireFoxDriver但却失败了HtmlUnitDriver.问题是javascript点击"登录"链接时没有执行;
用于html查看的网站网址:https://fleetworks.trimbletl.com/fleet/start.do
HtmlUnitDriver driver = new HtmlUnitDriver(BrowserVersion.CHROME_16);
driver.setJavascriptEnabled(true);
WebDriverWait wait = new WebDriverWait(driver, 10);
driver.get(fleetWorkURL);
WebElement usernameElement = driver.findElement(By.name("j_username"));
usernameElement.sendKeys(username);
WebElement passwordElement = driver.findElement(By.name("j_password"));
passwordElement.sendKeys(password);
WebElement loginButtonElement = driver.findElement(By.linkText("Log in"));
loginButtonElement.click();
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt("headerFrame"));
Run Code Online (Sandbox Code Playgroud)
堆栈跟踪:
13, 2013 2:47:54 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Obsolete content type encountered: 'text/javascript'.
13, 2013 2:47:54 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Obsolete content type encountered: 'text/javascript'.
13, 2013 2:47:55 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Obsolete content type encountered: 'text/javascript'.
2013 2:47:56 …Run Code Online (Sandbox Code Playgroud) java ×2
ruby ×2
selenium ×2
android ×1
appium ×1
autoit ×1
automation ×1
bitbucket ×1
cmd ×1
css ×1
current-page ×1
git ×1
htmlunit ×1
installation ×1
javascript ×1
maven ×1
robotium ×1
skype ×1
sqlite ×1
watir ×1