How to use getSize method of org.openqa.selenium.remote.RemoteWebElement class

Best Selenium code snippet using org.openqa.selenium.remote.RemoteWebElement.getSize

Source:pureElement.java Github

copy

Full Screen

...145 this.refresh(); // Method to detect, update and centre the object on screen if existing.146 return ( org.openqa.selenium.Point )this.pureElementMethodCall( "getLocation" );147 }148 // ************************************************************************************************************************ clear149 // WebElement [2] = public abstract org.openqa.selenium.Dimension org.openqa.selenium.WebElement.getSize()150 // AndroidElement [34] = public org.openqa.selenium.Dimension org.openqa.selenium.remote.RemoteWebElement.getSize()151 // IOSElement [33] = public org.openqa.selenium.Dimension org.openqa.selenium.remote.RemoteWebElement.getSize()152 // MobileElement [33] = public org.openqa.selenium.Dimension org.openqa.selenium.remote.RemoteWebElement.getSize()153 public org.openqa.selenium.Dimension getSize(){154 this.refresh(); // Method to detect, update and centre the object on screen if existing.155 return ( org.openqa.selenium.Dimension )this.pureElementMethodCall( "getSize" );156 }157 // ************************************************************************************************************************ clear158 // WebElement [3] = public abstract org.openqa.selenium.WebElement org.openqa.selenium.WebElement.findElement(org.openqa.selenium.By)159 // AndroidElement [2] = public org.openqa.selenium.WebElement io.appium.java_client.android.AndroidElement.findElement(org.openqa.selenium.By)160 // IOSElement [3] = public org.openqa.selenium.WebElement io.appium.java_client.ios.IOSElement.findElement(org.openqa.selenium.By)161 // MobileElement [5] = public java.util.List io.appium.java_client.MobileElement.findElements(org.openqa.selenium.By)162 public pureElement findElement( Object by ){163 this.refresh(); // Method to detect, update and centre the object on screen if existing.164 Object SourceObject = this.pureElementMethodCall( "findElement", by );165 if ( SourceObject != null ) {166 pureCore.peMethod myMethod = pureCore.peMethodFromBy( by.toString() );167 pureElement newPureElement = new pureElement( "The Name", "The Type", myMethod.peMethodid, myMethod.peSearch, pureCore.defRefreshMode, this );168 newPureElement.theElement = SourceObject;169 newPureElement.refrehCode = "0xFFFFFFFF";170 return newPureElement;171 }else {172 return null;173 } 174 }175 // ************************************************************************************************************************ clear176 // WebElement [4] = public abstract java.util.List org.openqa.selenium.WebElement.findElements(org.openqa.selenium.By)177 // AndroidElement [16] = public java.util.List io.appium.java_client.MobileElement.findElements(org.openqa.selenium.By)178 // IOSElement [15] = public java.util.List io.appium.java_client.MobileElement.findElements(org.openqa.selenium.By)179 // MobileElement [4] = public org.openqa.selenium.WebElement io.appium.java_client.MobileElement.findElement(org.openqa.selenium.By)180 public pureElements findElements( Object by ){181 this.refresh(); // Method to detect, update and centre the object on screen if existing.182 Object feedback = this.pureElementMethodCall( "findElements", by );183 List<Object> myObjectList = pureCore.CastObjecttoList( feedback );184 if ( myObjectList != null ) {185 pureCore.peMethod myMethod = pureCore.peMethodFromBy( by.toString() );186 pureElements newPureElements = new pureElements( "-", "-", myMethod.peMethodid, myMethod.peSearch, pureCore.defRefreshMode, this );187 newPureElements.theElements = myObjectList;188 newPureElements.refrehCode = "0xFFFFFFFF";189 return newPureElements;190 }else {191 return null;192 }193 }194 195 // ************************************************************************************************************************ clear196 // WebElement [5] = public abstract void org.openqa.selenium.WebElement.click()197 // AndroidElement [38] = public void org.openqa.selenium.remote.RemoteWebElement.click()198 // IOSElement [37] = public void org.openqa.selenium.remote.RemoteWebElement.click()199 // MobileElement [37] = public void org.openqa.selenium.remote.RemoteWebElement.click()200 public void click() {201 this.refresh(); // Method to detect, update and centre the object on screen if existing.202 // this.centerOnScreen(); // Method to put object in center of the screen if partially or not visible203 this.pureElementMethodCall( "click" );204 }205 206 // ************************************************************************************************************************ clear207 // WebElement [6] = public abstract void org.openqa.selenium.WebElement.sendKeys(java.lang.CharSequence[])208 // AndroidElement [39] = public void org.openqa.selenium.remote.RemoteWebElement.sendKeys(java.lang.CharSequence[])209 // IOSElement [38] = public void org.openqa.selenium.remote.RemoteWebElement.sendKeys(java.lang.CharSequence[])210 // MobileElement [38] = public void org.openqa.selenium.remote.RemoteWebElement.sendKeys(java.lang.CharSequence[])211 public void sendKeys( String charSequence ) {212 this.refresh(); // Method to detect, update and centre the object on screen if existing.213 this.centerOnScreen(); // Method to put object in center of the screen if partially or not visible214 pureDriverDetails myDriver = pureDrivers.getCurrentDriverDetails();215 java.lang.CharSequence mySequency[] = new java.lang.CharSequence[ charSequence.length() ];216 for( int iLoop = 0; iLoop < charSequence.length(); iLoop++ ) {217 mySequency[ iLoop ] = charSequence.substring( iLoop, iLoop +1 );218 }219 pureCore.callMethod( this.theElement, myDriver.elementClass, "sendKeys", java.lang.CharSequence[].class, "pureElement.sendKeys", mySequency );220 }221 // ************************************************************************************************************************ clear222 // WebElement [7] = public abstract void org.openqa.selenium.WebElement.submit()223 // AndroidElement [12] = public void io.appium.java_client.android.AndroidElement.submit() throws org.openqa.selenium.WebDriverException224 // IOSElement [12] = public void io.appium.java_client.ios.IOSElement.submit() throws org.openqa.selenium.WebDriverException225 // MobileElement [23] = public void io.appium.java_client.MobileElement.submit() throws org.openqa.selenium.WebDriverException226 public void submit() {227 this.refresh(); // Method to detect, update and centre the object on screen if existing.228 this.centerOnScreen(); // Method to put object in center of the screen if partially or not visible229 this.pureElementMethodCall( "submit" );230 }231 232 // ************************************************************************************************************************ clear233 // WebElement [8] = public abstract java.lang.String org.openqa.selenium.WebElement.getTagName()234 // AndroidElement [40] = public java.lang.String org.openqa.selenium.remote.RemoteWebElement.getTagName()235 // IOSElement [39] = public java.lang.String org.openqa.selenium.remote.RemoteWebElement.getTagName()236 // MobileElement [39] = public java.lang.String org.openqa.selenium.remote.RemoteWebElement.getTagName()237 public String getTagName() {238 this.refresh(); // Method to detect, update and centre the object on screen if existing.239 return (String)this.pureElementMethodCall( "getTagName" );240 }241 242 // ************************************************************************************************************************ clear243 // WebElement [9] = public abstract java.lang.String org.openqa.selenium.WebElement.getAttribute(java.lang.String)244 // AndroidElement [41] = public java.lang.String org.openqa.selenium.remote.RemoteWebElement.getAttribute(java.lang.String)245 // IOSElement [40] = public java.lang.String org.openqa.selenium.remote.RemoteWebElement.getAttribute(java.lang.String)246 // MobileElement [40] = public java.lang.String org.openqa.selenium.remote.RemoteWebElement.getAttribute(java.lang.String)247 public String getAttribute( String AttributeName ) {248 this.refresh(); // Method to detect, update and centre the object on screen if existing.249 return (String)this.pureElementMethodCall( "getAttribute", (Object)AttributeName );250 }251 252 // ************************************************************************************************************************ clear253 // WebElement [10] = public abstract boolean org.openqa.selenium.WebElement.isSelected()254 // AndroidElement [42] = public boolean org.openqa.selenium.remote.RemoteWebElement.isSelected()255 // IOSElement [41] = public boolean org.openqa.selenium.remote.RemoteWebElement.isSelected()256 // MobileElement [41] = public boolean org.openqa.selenium.remote.RemoteWebElement.isSelected()257 public boolean isSelected() {258 this.refresh();259 return (boolean)this.pureElementMethodCall( "isSelected" );260 }261 262 // ************************************************************************************************************************ clear263 // WebElement [11] = public abstract boolean org.openqa.selenium.WebElement.isEnabled()264 // AndroidElement [43] = public boolean org.openqa.selenium.remote.RemoteWebElement.isEnabled()265 // IOSElement [42] = public boolean org.openqa.selenium.remote.RemoteWebElement.isEnabled()266 // MobileElement [42] = public boolean org.openqa.selenium.remote.RemoteWebElement.isEnabled()267 public boolean isEnabled() {268 this.refresh();269 return (boolean)this.pureElementMethodCall( "isEnabled" );270 }271 272 // ************************************************************************************************************************ clear273 // WebElement [12] = public abstract java.lang.String org.openqa.selenium.WebElement.getText()274 // AndroidElement [44] = public java.lang.String org.openqa.selenium.remote.RemoteWebElement.getText()275 // IOSElement [43] = public java.lang.String org.openqa.selenium.remote.RemoteWebElement.getText()276 // MobileElement [43] = public java.lang.String org.openqa.selenium.remote.RemoteWebElement.getText()277 public String getText() {278 this.refresh();279 return (String)this.pureElementMethodCall( "getText" );280 }281 282 // ************************************************************************************************************************ clear283 // WebElement [13] = public abstract boolean org.openqa.selenium.WebElement.isDisplayed()284 // AndroidElement [45] = public boolean org.openqa.selenium.remote.RemoteWebElement.isDisplayed()285 // IOSElement [44] = public boolean org.openqa.selenium.remote.RemoteWebElement.isDisplayed()286 // MobileElement [44] = public boolean org.openqa.selenium.remote.RemoteWebElement.isDisplayed()287 public boolean isDisplayed() {288 this.refresh();289 return (boolean)this.pureElementMethodCall( "isDisplayed" );290 }291 // ************************************************************************************************************************ clear292 // WebElement [14] = public abstract org.openqa.selenium.Rectangle org.openqa.selenium.WebElement.getRect()293 // AndroidElement [46] = public org.openqa.selenium.Rectangle org.openqa.selenium.remote.RemoteWebElement.getRect()294 // IOSElement [45] = public org.openqa.selenium.Rectangle org.openqa.selenium.remote.RemoteWebElement.getRect()295 // MobileElement [45] = public org.openqa.selenium.Rectangle org.openqa.selenium.remote.RemoteWebElement.getRect()296 public org.openqa.selenium.Rectangle getRect() {297 this.refresh();298 return (org.openqa.selenium.Rectangle)this.pureElementMethodCall( "getRect" );299 }300 // ************************************************************************************************************************ clear301 // WebElement [15] = public abstract java.lang.String org.openqa.selenium.WebElement.getCssValue(java.lang.String)302 // AndroidElement [13] = public java.lang.String io.appium.java_client.android.AndroidElement.getCssValue(java.lang.String) throws org.openqa.selenium.WebDriverException303 // IOSElement [13] = public java.lang.String io.appium.java_client.ios.IOSElement.getCssValue(java.lang.String) throws org.openqa.selenium.WebDriverException304 // MobileElement [24] = public java.lang.String io.appium.java_client.MobileElement.getCssValue(java.lang.String) throws org.openqa.selenium.WebDriverException305 public String getCssValue( String cssValue ) {306 this.refresh();307 return (String)this.pureElementMethodCall( "getCssValue", (Object) cssValue );308 }309 // ************************************************************************************************************************ clear310 // WebElement [16] = public abstract java.lang.Object org.openqa.selenium.TakesScreenshot.getScreenshotAs(org.openqa.selenium.OutputType) throws org.openqa.selenium.WebDriverException311 // AndroidElement [37] = public java.lang.Object org.openqa.selenium.remote.RemoteWebElement.getScreenshotAs(org.openqa.selenium.OutputType) throws org.openqa.selenium.WebDriverException312 // IOSElement [36] = public java.lang.Object org.openqa.selenium.remote.RemoteWebElement.getScreenshotAs(org.openqa.selenium.OutputType) throws org.openqa.selenium.WebDriverException313 // MobileElement [36] = public java.lang.Object org.openqa.selenium.remote.RemoteWebElement.getScreenshotAs(org.openqa.selenium.OutputType) throws org.openqa.selenium.WebDriverException314 public Object getScreenshotAs( org.openqa.selenium.OutputType<?> outputType ) {315 this.refresh();316 this.centerOnScreen(); // Method to put object in center of the screen if partially or not visible317 return this.pureElementMethodCall( "getScreenshotAs", (Object) outputType );318 }319 // ************************************************************************************************************************ 320 // AndroidElement [0] = public org.openqa.selenium.remote.Response io.appium.java_client.android.AndroidElement.execute(java.lang.String,java.util.Map)321 // IOSElement [0] = public org.openqa.selenium.remote.Response io.appium.java_client.ios.IOSElement.execute(java.lang.String,java.util.Map)322 // MobileElement [1] = public org.openqa.selenium.remote.Response io.appium.java_client.MobileElement.execute(java.lang.String,java.util.Map)323 public org.openqa.selenium.remote.Response execute( java.lang.String execute, java.util.Map<?,?> map ){324 this.refresh();325 this.centerOnScreen(); // Method to put object in center of the screen if partially or not visible326 pureDriverDetails myDriver = pureDrivers.getCurrentDriverDetails();327 //328 Class<?>[] myClasses = new Class[2];329 myClasses[ 0 ] = java.lang.String.class;330 myClasses[ 1 ] = java.util.Map.class;331 //332 Object[] myTrueParam = new Object[2];333 myTrueParam[ 0 ] = (Object)execute;334 myTrueParam[ 1 ] = (Object)map;335 //336 return (org.openqa.selenium.remote.Response)pureCore.callMethod(337 this.theElement, myDriver.elementClass, "execute", myClasses, "pureElement.execute", myTrueParam );338 }339 // ************************************************************************************************************************ 340 // AndroidElement [1] = public org.openqa.selenium.remote.Response io.appium.java_client.android.AndroidElement.execute(java.lang.String)341 // IOSElement [1] = public org.openqa.selenium.remote.Response io.appium.java_client.ios.IOSElement.execute(java.lang.String)342 // MobileElement [0] = public org.openqa.selenium.remote.Response io.appium.java_client.MobileElement.execute(java.lang.String)343 public org.openqa.selenium.remote.Response execute( java.lang.String execute ){344 this.refresh();345 this.centerOnScreen(); // Method to put object in center of the screen if partially or not visible346 pureDriverDetails myDriver = pureDrivers.getCurrentDriverDetails();347 return (org.openqa.selenium.remote.Response)pureCore.callMethod(348 this.theElement, myDriver.elementClass, "execute", java.lang.String.class, "pureElement.execute", execute );349 }350 351 // ************************************************************************************************************************ 352 // AndroidElement [3] = public org.openqa.selenium.WebElement io.appium.java_client.android.AndroidElement.findElement(java.lang.String,java.lang.String)353 // IOSElement [2] = public org.openqa.selenium.WebElement io.appium.java_client.ios.IOSElement.findElement(java.lang.String,java.lang.String)354 // MobileElement [3] = public org.openqa.selenium.WebElement io.appium.java_client.MobileElement.findElement(java.lang.String,java.lang.String)355 public pureElement findElement( String method, String path ){356 this.refresh(); // Method to detect, update and centre the object on screen if existing.357 pureDriverDetails myDriver = pureDrivers.getCurrentDriverDetails();358 //359 Class<?>[] myClasses = new Class[2];360 myClasses[ 0 ] = java.lang.String.class;361 myClasses[ 1 ] = java.lang.String.class;362 //363 Object[] myTrueParam = new Object[2];364 myTrueParam[ 0 ] = (Object)method;365 myTrueParam[ 1 ] = (Object)path;366 //367 Object SourceObject = (Object)pureCore.callMethod( this.theElement, myDriver.elementClass, "findElement", myClasses, "pureElement.findElement", myTrueParam );368 if ( SourceObject != null ) {369 int elemMethod = pureCore.MethodFromStringLocator( method );370 pureElement newPureElement = new pureElement( "The Name", "The Type", elemMethod, path, pureCore.defRefreshMode, this );371 newPureElement.theElement = SourceObject;372 newPureElement.refrehCode = "0xFFFFFFFF";373 return newPureElement;374 }else {375 return null;376 } 377 }378 379 // ************************************************************************************************************************ 380 // Internal optimisation for following findElement methods.381 private pureElement intFindElementXXX( String MethodName, int elementMethod, String Description ) {382 this.refresh();383 Object SourceObject = (Object) this.pureElementMethodCall( MethodName, (Object)Description );384 if ( SourceObject != null ) {385 pureElement newPureElement = new pureElement( "The Name", "The Type", elementMethod, Description, pureCore.defRefreshMode, this );386 newPureElement.theElement = SourceObject;387 newPureElement.refrehCode = "0xFFFFFFFF";388 return newPureElement;389 }else {390 return (pureElement)null;391 } 392 } 393 394 // ************************************************************************************************************************ 395 // AndroidElement [4] = public org.openqa.selenium.WebElement io.appium.java_client.android.AndroidElement.findElementByLinkText(java.lang.String) throws org.openqa.selenium.WebDriverException396 // IOSElement [4] = public org.openqa.selenium.WebElement io.appium.java_client.ios.IOSElement.findElementByLinkText(java.lang.String) throws org.openqa.selenium.WebDriverException397 // MobileElement [7] = public org.openqa.selenium.WebElement io.appium.java_client.MobileElement.findElementByLinkText(java.lang.String) throws org.openqa.selenium.WebDriverException398 public pureElement findElementByLinkText( String Description ){399 return this.intFindElementXXX( "findElementByLinkText", pureCore.elementMethod.linkText, Description );400 }401 // ************************************************************************************************************************ 402 // AndroidElement [5] = public org.openqa.selenium.WebElement io.appium.java_client.android.AndroidElement.findElementByPartialLinkText(java.lang.String) throws org.openqa.selenium.WebDriverException403 // IOSElement [5] = public org.openqa.selenium.WebElement io.appium.java_client.ios.IOSElement.findElementByPartialLinkText(java.lang.String) throws org.openqa.selenium.WebDriverException404 // MobileElement [8] = public org.openqa.selenium.WebElement io.appium.java_client.MobileElement.findElementByPartialLinkText(java.lang.String) throws org.openqa.selenium.WebDriverException405 public pureElement findElementByPartialLinkText( String Description ){406 return this.intFindElementXXX( "findElementByPartialLinkText", pureCore.elementMethod.partialLinkText, Description );407 }408 409 // ************************************************************************************************************************ 410 // AndroidElement [6] = public org.openqa.selenium.WebElement io.appium.java_client.android.AndroidElement.findElementByTagName(java.lang.String)411 // IOSElement [6] = public org.openqa.selenium.WebElement io.appium.java_client.ios.IOSElement.findElementByTagName(java.lang.String)412 // MobileElement [9] = public org.openqa.selenium.WebElement io.appium.java_client.MobileElement.findElementByTagName(java.lang.String)413 public pureElement findElementByTagName( String Description ){414 return this.intFindElementXXX( "findElementByTagName", pureCore.elementMethod.tagNamei, Description );415 }416 417 // ************************************************************************************************************************ 418 // AndroidElement [7] = public org.openqa.selenium.WebElement io.appium.java_client.android.AndroidElement.findElementByName(java.lang.String)419 // IOSElement [7] = public org.openqa.selenium.WebElement io.appium.java_client.ios.IOSElement.findElementByName(java.lang.String)420 // MobileElement [10] = public org.openqa.selenium.WebElement io.appium.java_client.MobileElement.findElementByName(java.lang.String)421 public pureElement findElementByName( String Description ){422 return this.intFindElementXXX( "findElementByName", pureCore.elementMethod.name, Description );423 }424 425 // ************************************************************************************************************************ 426 // AndroidElement [8] = public org.openqa.selenium.WebElement io.appium.java_client.android.AndroidElement.findElementByClassName(java.lang.String)427 // IOSElement [8] = public org.openqa.selenium.WebElement io.appium.java_client.ios.IOSElement.findElementByClassName(java.lang.String)428 // MobileElement [11] = public org.openqa.selenium.WebElement io.appium.java_client.MobileElement.findElementByClassName(java.lang.String)429 public pureElement findElementByClassName( String Description ){430 return this.intFindElementXXX( "findElementByClassName", pureCore.elementMethod.className, Description );431 }432 433 // ************************************************************************************************************************ 434 // AndroidElement [9] = public org.openqa.selenium.WebElement io.appium.java_client.android.AndroidElement.findElementByCssSelector(java.lang.String) throws org.openqa.selenium.WebDriverException435 // IOSElement [9] = public org.openqa.selenium.WebElement io.appium.java_client.ios.IOSElement.findElementByCssSelector(java.lang.String) throws org.openqa.selenium.WebDriverException436 // MobileElement [12] = public org.openqa.selenium.WebElement io.appium.java_client.MobileElement.findElementByCssSelector(java.lang.String) throws org.openqa.selenium.WebDriverException437 public pureElement findElementByCssSelector( String Description ){438 return this.intFindElementXXX( "findElementByCssSelector", pureCore.elementMethod.cssSelector, Description );439 }440 441 // ************************************************************************************************************************ 442 // AndroidElement [10] = public org.openqa.selenium.WebElement io.appium.java_client.android.AndroidElement.findElementByXPath(java.lang.String)443 // IOSElement [10] = public org.openqa.selenium.WebElement io.appium.java_client.ios.IOSElement.findElementByXPath(java.lang.String)444 // MobileElement [13] = public org.openqa.selenium.WebElement io.appium.java_client.MobileElement.findElementByXPath(java.lang.String)445 public pureElement findElementByXPath( String Description ){446 return this.intFindElementXXX( "findElementByXPath", pureCore.elementMethod.xpath, Description );447 }448 449 // ************************************************************************************************************************ 450 // AndroidElement [11] = public org.openqa.selenium.WebElement io.appium.java_client.android.AndroidElement.findElementById(java.lang.String)451 // IOSElement [11] = public org.openqa.selenium.WebElement io.appium.java_client.ios.IOSElement.findElementById(java.lang.String)452 // MobileElement [21] = public org.openqa.selenium.WebElement io.appium.java_client.MobileElement.findElementById(java.lang.String)453 public pureElement findElementById( String Description ){454 return this.intFindElementXXX( "findElementById", pureCore.elementMethod.id, Description );455 }456 457 // ************************************************************************************************************************ 458 // AndroidElement [14] = public void io.appium.java_client.android.AndroidElement.replaceValue(java.lang.String)459 public void replaceValue( java.lang.String value ) {460 this.refresh();461 this.centerOnScreen(); // Method to put object in center of the screen if partially or not visible462 this.pureElementMethodCall( "replaceValue", (Object)value );463 }464 465 // ************************************************************************************************************************ 466 // AndroidElement [15] = public void io.appium.java_client.MobileElement.setValue(java.lang.String)467 // IOSElement [14] = public void io.appium.java_client.MobileElement.setValue(java.lang.String)468 // MobileElement [2] = public void io.appium.java_client.MobileElement.setValue(java.lang.String)469 public void setValue( java.lang.String value ) {470 this.refresh();471 this.centerOnScreen(); // Method to put object in center of the screen if partially or not visible472 this.pureElementMethodCall( "setValue", (Object)value );473 }474 // ************************************************************************************************************************ 475 // AndroidElement [17] = public java.util.List io.appium.java_client.MobileElement.findElements(java.lang.String,java.lang.String)476 // IOSElement [16] = public java.util.List io.appium.java_client.MobileElement.findElements(java.lang.String,java.lang.String)477 // MobileElement [6] = public java.util.List io.appium.java_client.MobileElement.findElements(java.lang.String,java.lang.String)478 479 // ************************************************************************************************************************ 480 // Internal optimisation for the following findElementsXXX methods481 private pureElements intFindElementsXXX( String MethodName, int elementMethod, String Description ) {482 this.refresh(); // Method to detect, update and centre the object on screen if existing.483 Object feedback = this.pureElementMethodCall( MethodName, (Object)Description );484 List<Object> myObjectList = pureCore.CastObjecttoList( feedback );485 if ( myObjectList != null ) {486 pureElements newPureElements = new pureElements( "-", "-", elementMethod, Description, pureCore.defRefreshMode, this );487 newPureElements.theElements = myObjectList;488 newPureElements.refrehCode = "0xFFFFFFFF";489 return newPureElements;490 }else {491 return null;492 }493 }494 // ************************************************************************************************************************ 495 // AndroidElement [18] = public java.util.List io.appium.java_client.MobileElement.findElementsByLinkText(java.lang.String)496 // IOSElement [17] = public java.util.List io.appium.java_client.MobileElement.findElementsByLinkText(java.lang.String)497 // MobileElement [14] = public java.util.List io.appium.java_client.MobileElement.findElementsByLinkText(java.lang.String)498 public pureElements findElementsByLinkText( java.lang.String Description ){499 return intFindElementsXXX( "findElementsByLinkText", pureCore.elementMethod.linkText, Description );500 }501 // ************************************************************************************************************************ 502 // AndroidElement [19] = public java.util.List io.appium.java_client.MobileElement.findElementsByPartialLinkText(java.lang.String)503 // IOSElement [18] = public java.util.List io.appium.java_client.MobileElement.findElementsByPartialLinkText(java.lang.String)504 // MobileElement [15] = public java.util.List io.appium.java_client.MobileElement.findElementsByPartialLinkText(java.lang.String)505 public pureElements findElementsByPartialLinkText( java.lang.String Description ){506 return intFindElementsXXX( "findElementsByPartialLinkText", pureCore.elementMethod.partialLinkText, Description );507 }508 509 // ************************************************************************************************************************ 510 // AndroidElement [20] = public java.util.List io.appium.java_client.MobileElement.findElementsByTagName(java.lang.String)511 // IOSElement [19] = public java.util.List io.appium.java_client.MobileElement.findElementsByTagName(java.lang.String)512 // MobileElement [16] = public java.util.List io.appium.java_client.MobileElement.findElementsByTagName(java.lang.String)513 public pureElements findElementsByTagName( java.lang.String Description ){514 return intFindElementsXXX( "findElementsByTagName", pureCore.elementMethod.tagNamei, Description );515 }516 517 // ************************************************************************************************************************ 518 // AndroidElement [21] = public java.util.List io.appium.java_client.MobileElement.findElementsByName(java.lang.String)519 // IOSElement [20] = public java.util.List io.appium.java_client.MobileElement.findElementsByName(java.lang.String)520 // MobileElement [17] = public java.util.List io.appium.java_client.MobileElement.findElementsByName(java.lang.String)521 public pureElements findElementsByName( java.lang.String Description ){522 return intFindElementsXXX( "findElementsByName", pureCore.elementMethod.name, Description );523 }524 525 // ************************************************************************************************************************ 526 // AndroidElement [22] = public java.util.List io.appium.java_client.MobileElement.findElementsByClassName(java.lang.String)527 // IOSElement [21] = public java.util.List io.appium.java_client.MobileElement.findElementsByClassName(java.lang.String)528 // MobileElement [18] = public java.util.List io.appium.java_client.MobileElement.findElementsByClassName(java.lang.String)529 public pureElements findElementsByClassName( java.lang.String Description ){530 return intFindElementsXXX( "findElementsByClassName", pureCore.elementMethod.className, Description );531 }532 533 // ************************************************************************************************************************ 534 // AndroidElement [23] = public java.util.List io.appium.java_client.MobileElement.findElementsByCssSelector(java.lang.String)535 // IOSElement [22] = public java.util.List io.appium.java_client.MobileElement.findElementsByCssSelector(java.lang.String)536 // MobileElement [19] = public java.util.List io.appium.java_client.MobileElement.findElementsByCssSelector(java.lang.String)537 public pureElements findElementsByCssSelector( java.lang.String Description ){538 return intFindElementsXXX( "findElementsByCssSelector", pureCore.elementMethod.cssSelector, Description );539 }540 541 // ************************************************************************************************************************ 542 // AndroidElement [24] = public java.util.List io.appium.java_client.MobileElement.findElementsByXPath(java.lang.String)543 // IOSElement [23] = public java.util.List io.appium.java_client.MobileElement.findElementsByXPath(java.lang.String)544 // MobileElement [20] = public java.util.List io.appium.java_client.MobileElement.findElementsByXPath(java.lang.String)545 public pureElements findElementsByXPath( java.lang.String Description ){546 return intFindElementsXXX( "findElementsByXPath", pureCore.elementMethod.xpath, Description );547 }548 549 // ************************************************************************************************************************ 550 // AndroidElement [25] = public java.util.List io.appium.java_client.MobileElement.findElementsById(java.lang.String)551 // IOSElement [24] = public java.util.List io.appium.java_client.MobileElement.findElementsById(java.lang.String)552 // MobileElement [22] = public java.util.List io.appium.java_client.MobileElement.findElementsById(java.lang.String)553 public pureElements findElementsById( java.lang.String Description ){554 return intFindElementsXXX( "findElementsById", pureCore.elementMethod.id, Description );555 }556 557 // ************************************************************************************************************************ 558 // AndroidElement [26] = public java.util.List io.appium.java_client.MobileElement.findElementsByAccessibilityId(java.lang.String)559 // IOSElement [25] = public java.util.List io.appium.java_client.MobileElement.findElementsByAccessibilityId(java.lang.String)560 // MobileElement [26] = public java.util.List io.appium.java_client.MobileElement.findElementsByAccessibilityId(java.lang.String)561 public pureElements findElementsByAccessibilityId( java.lang.String Description ){562 return intFindElementsXXX( "findElementsByAccessibilityId", pureCore.elementMethod.AccessibilityId, Description );563 }564 565 // ************************************************************************************************************************ 566 // AndroidElement [27] = public org.openqa.selenium.Point io.appium.java_client.MobileElement.getCenter()567 // IOSElement [26] = public org.openqa.selenium.Point io.appium.java_client.MobileElement.getCenter()568 // MobileElement [25] = public org.openqa.selenium.Point io.appium.java_client.MobileElement.getCenter()569 public org.openqa.selenium.Point getCenter(){570 this.refresh();571 return (org.openqa.selenium.Point)this.pureElementMethodCall( "getCenter" );572 }573 // ************************************************************************************************************************ 574 // AndroidElement [28] = public boolean org.openqa.selenium.remote.RemoteWebElement.equals(java.lang.Object)575 // IOSElement [27] = public boolean org.openqa.selenium.remote.RemoteWebElement.equals(java.lang.Object)576 // MobileElement [27] = public boolean org.openqa.selenium.remote.RemoteWebElement.equals(java.lang.Object)577 public boolean equalsL( Object equalsto ){578 this.refresh();579 return (boolean)this.pureElementMethodCall( "equals", equalsto );580 }581 582 // ************************************************************************************************************************ 583 // AndroidElement [29] = public java.lang.String org.openqa.selenium.remote.RemoteWebElement.toString()584 // IOSElement [28] = public java.lang.String org.openqa.selenium.remote.RemoteWebElement.toString()585 // MobileElement [28] = public java.lang.String org.openqa.selenium.remote.RemoteWebElement.toString()586 public java.lang.String toStringL(){587 this.refresh();588 return (String)this.pureElementMethodCall( "toString" );589 }590 591 // ************************************************************************************************************************ 592 // AndroidElement [30] = public int org.openqa.selenium.remote.RemoteWebElement.hashCode()593 // IOSElement [29] = public int org.openqa.selenium.remote.RemoteWebElement.hashCode()594 // MobileElement [29] = public int org.openqa.selenium.remote.RemoteWebElement.hashCode()595 public int hashCodeL(){596 this.refresh();597 return (int)this.pureElementMethodCall( "hashCode" );598 }599 600 // ************************************************************************************************************************ 601 // AndroidElement [33] = public java.lang.String org.openqa.selenium.remote.RemoteWebElement.getId()602 // IOSElement [32] = public java.lang.String org.openqa.selenium.remote.RemoteWebElement.getId()603 // MobileElement [32] = public java.lang.String org.openqa.selenium.remote.RemoteWebElement.getId()604 public java.lang.String getId(){605 this.refresh();606 return (java.lang.String)this.pureElementMethodCall( "getId" );607 }608 // ************************************************************************************************************************ 609 // AndroidElement [35] = public void org.openqa.selenium.remote.RemoteWebElement.setParent(org.openqa.selenium.remote.RemoteWebDriver)610 // IOSElement [34] = public void org.openqa.selenium.remote.RemoteWebElement.setParent(org.openqa.selenium.remote.RemoteWebDriver)611 // MobileElement [34] = public void org.openqa.selenium.remote.RemoteWebElement.setParent(org.openqa.selenium.remote.RemoteWebDriver)612 public void setParent( org.openqa.selenium.remote.RemoteWebDriver remoteWebDriver ){613 this.refresh();614 this.pureElementMethodCall( "setParent", remoteWebDriver );615 }616 // ************************************************************************************************************************ 617 // AndroidElement [36] = public void org.openqa.selenium.remote.RemoteWebElement.setFileDetector(org.openqa.selenium.remote.FileDetector)618 // IOSElement [35] = public void org.openqa.selenium.remote.RemoteWebElement.setFileDetector(org.openqa.selenium.remote.FileDetector)619 // MobileElement [35] = public void org.openqa.selenium.remote.RemoteWebElement.setFileDetector(org.openqa.selenium.remote.FileDetector)620 public void setFileDetector( org.openqa.selenium.remote.FileDetector fileSelector ) {621 this.refresh();622 this.pureElementMethodCall( "setFileDetector", fileSelector );623 }624 625 // ************************************************************************************************************************ 626 // AndroidElement [47] = public org.openqa.selenium.WebDriver org.openqa.selenium.remote.RemoteWebElement.getWrappedDriver()627 // IOSElement [48] = public org.openqa.selenium.WebDriver org.openqa.selenium.remote.RemoteWebElement.getWrappedDriver()628 // MobileElement [46] = public org.openqa.selenium.WebDriver org.openqa.selenium.remote.RemoteWebElement.getWrappedDriver()629/* public pureDrivers getWrappedDriver(){630 this.refresh();631 Object SourceObject = this.pureElementMethodCall( "getWrappedDriver" );632 if ( SourceObject != null ) {633 pureDrivers newDriver = new pureDrivers();634 newDriver.DriverName = "WrappedDriver";635 newDriver.subDriverName = "";636 newDriver.mainDriver = SourceObject;637 return newDriver;638 }else {639 return null;640 }641 } */642 643 // ************************************************************************************************************************ 644 // AndroidElement [48] = public org.openqa.selenium.interactions.internal.Coordinates org.openqa.selenium.remote.RemoteWebElement.getCoordinates()645 // IOSElement [49] = public org.openqa.selenium.interactions.internal.Coordinates org.openqa.selenium.remote.RemoteWebElement.getCoordinates()646 // MobileElement [47] = public org.openqa.selenium.interactions.internal.Coordinates org.openqa.selenium.remote.RemoteWebElement.getCoordinates()647 public org.openqa.selenium.interactions.internal.Coordinates getCoordinates(){648 this.refresh();649 return (org.openqa.selenium.interactions.internal.Coordinates)this.pureElementMethodCall( "getCoordinates" );650 }651 652 // ************************************************************************************************************************ 653 // AndroidElement [49] = public java.util.Map org.openqa.selenium.remote.RemoteWebElement.toJson()654 // IOSElement [46] = public java.util.Map org.openqa.selenium.remote.RemoteWebElement.toJson()655 // MobileElement [48] = public java.util.Map org.openqa.selenium.remote.RemoteWebElement.toJson()656 public java.util.Map<?,?> toJson(){657 this.refresh();658 return (java.util.Map<?,?>)this.pureElementMethodCall( "toJson" );659 }660 661 // ************************************************************************************************************************ 662 // AndroidElement [50] = public void org.openqa.selenium.remote.RemoteWebElement.setId(java.lang.String)663 // IOSElement [47] = public void org.openqa.selenium.remote.RemoteWebElement.setId(java.lang.String)664 // MobileElement [49] = public void org.openqa.selenium.remote.RemoteWebElement.setId(java.lang.String)665 public void setId( java.lang.String Value ) {666 this.refresh();667 this.pureElementMethodCall( "setId", Value );668 }669 670 // ************************************************************************************************************************ 671 // AndroidElement [51] = public final void java.lang.Object.wait() throws java.lang.InterruptedException672 // IOSElement [50] = public final void java.lang.Object.wait() throws java.lang.InterruptedException673 // MobileElement [50] = public final void java.lang.Object.wait() throws java.lang.InterruptedException674 public void waitL(){675 this.refresh();676 this.pureElementMethodCall( "wait" );677 }678 679 // ************************************************************************************************************************ 680 // AndroidElement [52] = public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException681 // IOSElement [51] = public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException682 // MobileElement [51] = public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException683 public void waitL( long waitdelay, int waitdelayms ){684 this.refresh();685 this.pureElementMethodCall( "wait", waitdelay, waitdelayms );686 }687 688 // ************************************************************************************************************************ 689 // AndroidElement [53] = public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException690 // IOSElement [52] = public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException691 // MobileElement [52] = public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException692 public void waitL( long waitdelay ){693 this.refresh();694 this.pureElementMethodCall( "wait", waitdelay );695 }696 697 // ************************************************************************************************************************ 698 // AndroidElement [54] = public final native java.lang.Class java.lang.Object.getClass()699 // IOSElement [53] = public final native java.lang.Class java.lang.Object.getClass()700 // MobileElement [53] = public final native java.lang.Class java.lang.Object.getClass()701 public java.lang.Class<?> getClassL(){702 this.refresh();703 return (java.lang.Class<?>)this.pureElementMethodCall( "getClass" );704 }705 706 // ************************************************************************************************************************ 707 // AndroidElement [55] = public final native void java.lang.Object.notify()708 // IOSElement [54] = public final native void java.lang.Object.notify()709 // MobileElement [54] = public final native void java.lang.Object.notify()710 public void notifyL(){711 this.refresh();712 this.pureElementMethodCall( "notify" );713 }714 715 // ************************************************************************************************************************ 716 // AndroidElement [56] = public final native void java.lang.Object.notifyAll()717 // IOSElement [55] = public final native void java.lang.Object.notifyAll()718 // MobileElement [55] = public final native void java.lang.Object.notifyAll()719 public void notifyAllL(){720 this.refresh();721 this.pureElementMethodCall( "notifyAll" );722 }723 724 // ************************************************************************************************************************ 725 // AndroidElement [57] = public default org.openqa.selenium.WebElement io.appium.java_client.FindsByAccessibilityId.findElementByAccessibilityId(java.lang.String)726 // IOSElement [56] = public default org.openqa.selenium.WebElement io.appium.java_client.FindsByAccessibilityId.findElementByAccessibilityId(java.lang.String)727 // MobileElement [56] = public default org.openqa.selenium.WebElement io.appium.java_client.FindsByAccessibilityId.findElementByAccessibilityId(java.lang.String)728 public pureElement findElementByAccessibilityId( String Description ){729 return this.intFindElementXXX( "findElementByAccessibilityId", pureCore.elementMethod.AccessibilityId, Description );730 }731 732 // ************************************************************************************************************************ 733 // AndroidElement [58] = public default org.openqa.selenium.WebElement io.appium.java_client.FindsByAndroidUIAutomator.findElementByAndroidUIAutomator(java.lang.String)734 public pureElement findElementByAndroidUIAutomator( String Description ){735 return this.intFindElementXXX( "findElementByAndroidUIAutomator", pureCore.elementMethod.AndroidUIAutomator, Description );736 }737 // ************************************************************************************************************************ 738 // AndroidElement [59] = public default java.util.List io.appium.java_client.FindsByAndroidUIAutomator.findElementsByAndroidUIAutomator(java.lang.String)739 public pureElements findElementsByAndroidUIAutomator( String Description ) {740 return this.intFindElementsXXX( "findElementsByAndroidUIAutomator", pureCore.elementMethod.AndroidUIAutomator, Description );741 }742 // ************************************************************************************************************************ 743 // IOSElement [57] = public default org.openqa.selenium.WebElement io.appium.java_client.FindsByIosUIAutomation.findElementByIosUIAutomation(java.lang.String)744 public pureElement findElementByIosUIAutomation( String Description ){745 return this.intFindElementXXX( "findElementByIosUIAutomation", pureCore.elementMethod.IosUIAutomation, Description );746 }747 // ************************************************************************************************************************ 748 // IOSElement [58] = public default java.util.List io.appium.java_client.FindsByIosUIAutomation.findElementsByIosUIAutomation(java.lang.String)749 public pureElements findElementsByIosUIAutomation( String Description ) {750 return this.intFindElementsXXX( "findElementsByIosUIAutomation", pureCore.elementMethod.IosUIAutomation, Description );751 }752 // ************************************************************************************************************************ 753 // IOSElement [59] = public default org.openqa.selenium.WebElement io.appium.java_client.FindsByIosNSPredicate.findElementByIosNsPredicate(java.lang.String)754 public pureElement findElementByIosNsPredicate( String Description ){755 return this.intFindElementXXX( "findElementByIosNsPredicate", pureCore.elementMethod.IosNsPredicate, Description );756 }757 // ************************************************************************************************************************ 758 // IOSElement [60] = public default java.util.List io.appium.java_client.FindsByIosNSPredicate.findElementsByIosNsPredicate(java.lang.String)759 public pureElements findElementsByIosNsPredicate( String Description ) {760 return this.intFindElementsXXX( "findElementsByIosNsPredicate", pureCore.elementMethod.IosNsPredicate, Description );761 }762 // ************************************************************************************************************************ 763 // IOSElement [61] = public default org.openqa.selenium.WebElement io.appium.java_client.FindsByIosClassChain.findElementByIosClassChain(java.lang.String)764 public pureElement findElementByIosClassChain( String Description ){765 return this.intFindElementXXX( "findElementByIosClassChain", pureCore.elementMethod.IosClassChain, Description );766 }767 // ************************************************************************************************************************ 768 // IOSElement [62] = public default java.util.List io.appium.java_client.FindsByIosClassChain.findElementsByIosClassChain(java.lang.String)769 public pureElements findElementsByIosClassChain( String Description ) {770 return this.intFindElementsXXX( "findElementsByIosClassChain", pureCore.elementMethod.IosClassChain, Description );771 }772 // ************************************************************************************************************************ 773 private void refresh() {774 // Si l'Element n'a pas encore ete cherche, ou que son rafraichissement doit etre realise.775 if ( this.theElement == null || this.refreshMethod == 1 ) { // || this.refrehCode != pureCore.getLastLogCat() ) {776 pureDriverDetails myDriver = null;777 if ( this.driverLink == -1 ) {778 myDriver = pureDrivers.getCurrentDriverDetails();779 // this.driverToUse = myDriver;780 }else {781 myDriver = this.driverToUse;782 }783 this.theElement = this.detection();784 // Tout d'abord on réalise une attente pour trouver l'élément.785 /*try {786 this.theElement = (Object)(new WebDriverWait( (WebDriver)pureCore.getCurrentDriver(), pureCore.getMaxWaitDelay() )787 .until( ExpectedConditions.presenceOfElementLocated( By.xpath( pureCore.MethodToLocator( this.eMethod, this.ePath ) ) ) ) );788 }catch( Exception e ) {789 pureErrorHandler.castError( pureErrorHandler.exceptions.getType( e ), "pureElement.refresh()", this.eName, pureCore.MethodToLocator( this.eMethod, this.ePath ) );790 } */791 if ( this.parent == null ) {792 this.theElement = (Object)pureDrivers.findElementWE( pureCore.MethodToLocator( this.eMethod, this.ePath ), myDriver );793 }else {794 this.theElement = (Object)this.parent.findElement( pureCore.MethodToLocator( this.eMethod, this.ePath ) );795 }796 // this.centerOnScreen();797 }798 }799 public Object myObject = null;800 private Object detection() {801 pureDriverDetails myDriver = null;802 if ( this.driverLink == -1 ) {803 myDriver = pureDrivers.getCurrentDriverDetails();804 }else {805 myDriver = this.driverToUse;806 }807 try {808 WebDriverWait objWait = new WebDriverWait( (WebDriver)myDriver.mainDriver, 20, 500 );809 objWait.until( new ExpectedCondition<Boolean>() {810 private pureElement myElement;811 private pureDriverDetails myDriver;812 private ExpectedCondition<Boolean> init( pureElement myElement, pureDriverDetails myDriver ){813 this.myElement = myElement;814 this.myDriver = myDriver;815 return this;816 }817 public Boolean apply(WebDriver wDriver) {818 if( this.myElement.parent == null ) {819 this.myElement.theElement = (Object)pureDrivers.findElementWE( pureCore.MethodToLocator( this.myElement.eMethod, this.myElement.ePath ), this.myDriver );820 }else {821 this.myElement.theElement = (Object)this.myElement.parent.findElement( pureCore.MethodToLocator( this.myElement.eMethod, this.myElement.ePath ) );822 }823 return ( this.myElement.theElement != null );824 }825 }.init( this, myDriver ) );826 827 }catch( Exception e ) {828 pureErrorHandler.castError( pureErrorHandler.exceptions.getType( e ), "pureElement.refresh()", this.eName, pureCore.MethodToLocator( this.eMethod, this.ePath ).toString() );829 }830 return myObject;831 }832 // ************************************************************************************************************************ 833private void centerOnScreen() {834 pureDriverDetails myDriver = pureDrivers.getCurrentDriverDetails();835 // Positionner l'objet au milieu de l'ecran si possible836 if ( this.theElement !=null ) {837 // On recupere d'abord les coordonnees et dimensions de l'objet838 Point pePosition = this.getLocation();839 Dimension peDimension = this.getSize();840 // On recupere ensuite les coordonnees et dimensions de l'ecran visible841 Rectangle cdRectangle = pureDrivers.GetDisplayArea();842 // Si l'objet est plus haut que l'ecran visible (et partiellement ou totalement hors ecran) :843 if ( pePosition.getY() < cdRectangle.getY() ) {844 int yShift = ( cdRectangle.getY() - pePosition.getY() ) + ( ( cdRectangle.getHeight() / 2 ) - ( peDimension.getHeight() / 2 ) );845 // Scroller vers le haut de la page, d'une valeur de yShift pixels846 JavascriptExecutor jse = (JavascriptExecutor)myDriver.mainDriver;847 jse.executeScript("window.scrollTo( " + ( cdRectangle.getY() - yShift ) + "," + "0" + ")" );848 }849 // Si l'objet est plus bas que l'ecran visible (et partiellement ou totalement hors ecran) :850 if ( ( pePosition.getY() + peDimension.getHeight() ) > ( cdRectangle.getY() + cdRectangle.getHeight() ) ){851 int yShift = ( ( pePosition.getY() + peDimension.getHeight() ) - ( cdRectangle.getY() + cdRectangle.getHeight() ) ) + 852 ( ( cdRectangle.getHeight() / 2 ) - ( peDimension.getHeight() / 2 ) );853 // Scroller vers le bas de la page, d'une valeur de yShift pixels...

Full Screen

Full Screen

Source:RemoteWebElementWrapper.java Github

copy

Full Screen

...473 return original.getLocation();474 }475 /**476 * @return477 * @see org.openqa.selenium.remote.RemoteWebElement#getSize()478 */479 @Override480 public Dimension getSize() {481 return original.getSize();482 }483 /**484 * @return485 * @see org.openqa.selenium.remote.RemoteWebElement#getRect()486 */487 @Override488 public Rectangle getRect() {489 return original.getRect();490 }491 /**492 * @return493 * @see org.openqa.selenium.remote.RemoteWebElement#getCoordinates()494 */495 @Override...

Full Screen

Full Screen

Source:ZetaOSXDriver.java Github

copy

Full Screen

...205 public boolean isDisplayed() {206 return originalElement.isDisplayed();207 }208 @Override209 public Dimension getSize() {210 final NSPoint elementSize = NSPoint.fromString(this.getAttribute(AX_SIZE));211 return new Dimension(elementSize.x(), elementSize.y());212 }213 @Override214 public Point getLocation() {215 final NSPoint elementLocation = NSPoint.fromString(this.getAttribute(AX_POSITION));216 return new Point(elementLocation.x(), elementLocation.y());217 }218 @Override219 public <X> X getScreenshotAs(OutputType<X> outputType) throws WebDriverException {220 Point elLocation = this.getLocation();221 Dimension elSize = this.getSize();222 if (OutputType.BASE64.equals(outputType)) {223 throw new WebDriverException("Base64 screenshot not supported yet");224 } else if (OutputType.BYTES.equals(outputType)) {225 return (X) bufferedImageAsByteArray(robot.createScreenCapture(new Rectangle(226 elLocation.getX(), elLocation.getY(), elSize.getWidth(), elSize.getHeight())));227 } else if (OutputType.FILE.equals(outputType)) {228 throw new WebDriverException("File screenshot not supported yet");229 } else {230 throw new WebDriverException("Unsupported OutputType selection");231 }232 }233 @Override234 public String toString() {235 return originalElement.toString();236 }237 }238 protected class ZetaRemoteWebDriverOptions extends RemoteWebDriverOptions {239 @Beta240 @Override241 public WebDriver.Window window() {242 final WebElement window = findElement(windowLocator);243 return new ZetaRemoteWindow(window);244 }245 @Beta246 protected class ZetaRemoteWindow extends RemoteWindow {247 private final WireRemoteWebElement window;248 public ZetaRemoteWindow(WebElement window) {249 this.window = new WireRemoteWebElement((RemoteWebElement) window);250 }251 public <X> X getScreenshotAs(OutputType<X> outputType) throws WebDriverException {252 return window.getScreenshotAs(outputType);253 }254 @Override255 public Dimension getSize() {256 return window.getSize();257 }258 @Override259 public Point getPosition() {260 return window.getLocation();261 }262 }263 }264}...

Full Screen

Full Screen

Source:ZetaWinWebAppDriver.java Github

copy

Full Screen

...212 return originalElement.isDisplayed();213 }214215 @Override216 public Dimension getSize() {217 return originalElement.getSize();218 }219220 @Override221 public Point getLocation() {222 return originalElement.getLocation();223 }224225 @Override226 public <X> X getScreenshotAs(OutputType<X> outputType) throws WebDriverException {227 Point webviewPosition = manage().window().getPosition();228 Dimension webviewSize = manage().window().getSize();229 Point elLocation = this.getLocation();230 Dimension elSize = this.getSize();231232 if (OutputType.BASE64.equals(outputType)) {233 throw new WebDriverException("Base64 screenshot not supported yet");234 } else if (OutputType.BYTES.equals(outputType)) {235 BufferedImage webviewScreenshot = getWinDriver().getRobot().createScreenCapture(236 new Rectangle(webviewPosition.getX(), webviewPosition.getY(),237 webviewSize.getWidth(), webviewSize.getHeight()));238 BufferedImage elementScreenshot = webviewScreenshot.getSubimage(elLocation.getX(), elLocation.getY(), elSize.239 getWidth(), elSize.getHeight());240 return (X) getWinDriver().bufferedImageAsByteArray(elementScreenshot);241 } else if (OutputType.FILE.equals(outputType)) {242 throw new WebDriverException("File screenshot not supported yet");243 } else {244 throw new WebDriverException("Unsupported OutputType selection");245 }246 }247248 @Override249 public String toString() {250 return originalElement.toString();251 }252253 }254255 protected class ZetaRemoteWebDriverOptions extends RemoteWebDriverOptions {256 public static final String xpathWebview = "/*[@ClassName='Chrome_WidgetWin_1' and @ControlType='ControlType.Window' and contains(@Name,'Wire')]/*[@ControlType='ControlType.Custom']/*[@ControlType='ControlType.Custom']/*[@ControlType='ControlType.Custom']/*[@ControlType='ControlType.Custom']";257 final WebElement webview = winDriver.findElement(By.xpath(xpathWebview));258259 @Beta260 @Override261 public WebDriver.Window window() {262 return new ZetaRemoteWindow();263 }264265 @Beta266 protected class ZetaRemoteWindow extends267 RemoteWebDriverOptions.RemoteWindow {268269 @Override270 public Dimension getSize() {271 return webview.getSize();272 }273274 @Override275 public Point getPosition() {276 return webview.getLocation();277 }278279 }280 }281} ...

Full Screen

Full Screen

Source:ZetaOSXWebAppDriver.java Github

copy

Full Screen

...178 public boolean isDisplayed() {179 return originalElement.isDisplayed();180 }181 @Override182 public Dimension getSize() {183 return originalElement.getSize();184 }185 @Override186 public Point getLocation() {187 return originalElement.getLocation();188 }189 @Override190 public <X> X getScreenshotAs(OutputType<X> outputType) throws WebDriverException {191 Point windowPosition = manage().window().getPosition();192 Dimension windowSize = manage().window().getSize();193 Point elLocation = this.getLocation();194 Dimension elSize = this.getSize();195 if (OutputType.BASE64.equals(outputType)) {196 throw new WebDriverException("Base64 screenshot not supported yet");197 } else if (OutputType.BYTES.equals(outputType)) {198 BufferedImage fullScreenshot = getOsxDriver().getRobot().createScreenCapture(new Rectangle(Toolkit.199 getDefaultToolkit().200 getScreenSize()));201 BufferedImage webappScreenshot = fullScreenshot.getSubimage(windowPosition.getX(), windowPosition.getY(),202 windowSize.getWidth(), windowSize.getHeight());203 BufferedImage elementScreenshot = webappScreenshot.getSubimage(elLocation.getX(), elLocation.getY(), elSize.204 getWidth(), elSize.getHeight());205 return (X) getOsxDriver().bufferedImageAsByteArray(elementScreenshot);206 } else if (OutputType.FILE.equals(outputType)) {207 throw new WebDriverException("File screenshot not supported yet");208 } else {209 throw new WebDriverException("Unsupported OutputType selection");210 }211 }212 @Override213 public String toString() {214 return originalElement.toString();215 }216 }217 protected class ZetaRemoteWebDriverOptions extends RemoteWebDriverOptions {218 @Beta219 @Override220 public WebDriver.Window window() {221 return new ZetaRemoteWindow();222 }223 @Beta224 protected class ZetaRemoteWindow extends RemoteWebDriverOptions.RemoteWindow {225 @Override226 public Dimension getSize() {227 return osxDriver.manage().window().getSize();228 }229 @Override230 public Point getPosition() {231 return osxDriver.manage().window().getPosition();232 }233 }234 }235}...

Full Screen

Full Screen

Source:EyesAppiumElement.java Github

copy

Full Screen

...31 setParent(driver.getRemoteWebDriver());32 setId(this.webElement.getId());33 }34 @Override35 public Dimension getSize() {36 Dimension size = webElement.getSize();37 if (pixelRatio == 1.0) {38 return size;39 }40 int unscaledWidth;41 int unscaledHeight;42 if (driver.getRemoteWebDriver() instanceof IOSDriver) {43 unscaledWidth = size.getWidth();44 unscaledHeight = size.getHeight();45 } else {46 unscaledWidth = (int) Math.ceil(size.getWidth() * pixelRatio);47 unscaledHeight = (int) Math.ceil(size.getHeight() * pixelRatio);48 }49 return new Dimension(unscaledWidth, unscaledHeight);50 }...

Full Screen

Full Screen

Source:MobileElement.java Github

copy

Full Screen

...56 }5758 public Point getCenter() {59 Point upperLeft = this.getLocation();60 Dimension dimensions = this.getSize();61 return new Point(upperLeft.getX() + dimensions.getWidth() / 2, upperLeft.getY() + dimensions.getHeight() / 2);62 }6364 @Override65 public void pinch() {66 ((AppiumDriver) parent).pinch(this); 67 }6869 @Override70 public void tap(int fingers, int duration) {71 ((AppiumDriver) parent).tap(fingers, this, duration); 72 }7374 @Override ...

Full Screen

Full Screen

Source:SelendroidReview.java Github

copy

Full Screen

...28 return synopsis.getText();29 }30 @Override31 public Object getPoster() {32 return poster.getSize();33 }34}...

Full Screen

Full Screen

getSize

Using AI Code Generation

copy

Full Screen

1import org.openqa.selenium.By;2import org.openqa.selenium.Dimension;3import org.openqa.selenium.WebDriver;4import org.openqa.selenium.WebElement;5import org.openqa.selenium.firefox.FirefoxDriver;6public class RemoteWebElementExample {7public static void main(String[] args) {8 WebDriver driver = new FirefoxDriver();9 Dimension size = element.getSize();10 System.out.println("Height of the element is " + size.height);11 System.out.println("Width of the element is " + size.width);12 driver.quit();13}14}

Full Screen

Full Screen

getSize

Using AI Code Generation

copy

Full Screen

1import org.openqa.selenium.By;2import org.openqa.selenium.Dimension;3import org.openqa.selenium.WebDriver;4import org.openqa.selenium.WebElement;5import org.openqa.selenium.firefox.FirefoxDriver;6public class RemoteWebElementExample {7public static void main(String[] args) {8 WebDriver driver = new FirefoxDriver();9 Dimension size = element.getSize();10 System.out.println("Height of the element is " + size.height);11 System.out.println("Width of the element is " + size.width);12 driver.quit();13}14}

Full Screen

Full Screen

getSize

Using AI Code Generation

copy

Full Screen

1package com.selenium4beginners.java.webdriver.interrogation;2import org.openqa.selenium.By;3import org.openqa.selenium.Dimension;4import org.openqa.selenium.WebDriver;5import org.openqa.selenium.WebElement;6import org.openqa.selenium.chrome.ChromeDriver;7public class GetSizeMethod {8 public static void main(String[] args) {9 System.setProperty("webdriver.chrome.driver", "C:\\Selenium\\chromedriver.exe");10 WebDriver driver = new ChromeDriver();11 Dimension size = element.getSize();12 System.out.println("Height: " + size.getHeight());13 System.out.println("Width: " + size.getWidth());14 driver.quit();15 }16}

Full Screen

Full Screen

getSize

Using AI Code Generation

copy

Full Screen

1import org.openqa.selenium.By;2import org.openqa.selenium.Dimension;3import org.openqa.selenium.WebDriver;4import org.openqa.selenium.WebElement;5import org.openqa.selenium.chrome.ChromeDriver;6public class getSize {7public static void main(String[] args) {8System.setProperty("webdriver.chrome.driver", "C:\\Users\\Sandeep\\Downloads\\chromedriver.exe");9WebDriver driver=new ChromeDriver();10WebElement searchbox=driver.findElement(By.name("q"));11Dimension size=searchbox.getSize();12System.out.println("Width of the element is "+size.width);13System.out.println("Height of the element is "+size.height);14driver.close();15}16}17Related posts: How to use getTagName() method in Selenium WebDriver? How to use getAttribute() method in Selenium WebDriver? How to use getCssValue() method in Selenium WebDriver? How to use getSelectedOption() method in Selenium WebDriver? How to use getAllSelectedOptions() method in Selenium WebDriver? How to use getFirstSelectedOption() method in Selenium WebDriver? How to ue sMultiple() method i Selenium WebDriver? How to use isDisplayed() method in Selenium WebDriver? How to use isSelected() method in Selenium WebDriver? How to use isEnabled() method in Selenium WebDriver? How to use getTagName() method in Selenium WebDriver? How to use getAttribute() method in Selenium WebDriver? How to use etCssValue() method in Selenium WebDriver? How to use getSelectedOption() method in Selenium WebDriver? How to use getAllSelectedOptions() method in Selenium WebDriver? How to use getFirstSelectedOption() method in Selenium WebDriver? How to use isMultiple() method in Selenium WebDriver? How to use isDisplayed() method in Selenium WebDriver? How to use isSelected() method in Selenium WebDriver? How to use isEnabled() method in Selenium WebDriver? How to use getTagName() method in Selenium WebDriver? How to use getAttribute() method in Selenium WebDriver? How to use getCssValue() method in Selenium WebDriver? How to use getSelectedOption() method in Selenium WebDriver? How to use getAllSelectedOptions() method in Selenium WebDriver? How to use getFirstSelectedOption() method in Selenium WebDriver? How to use isMultiple() method in Selenium WebDriver? How to use isDisplayed() method in Selenium WebDriver? How to use isSelected() method in Selenium WebDriver? How to use isEnabled() method in Selenium WebDriver

Full Screen

Full Screen

getSize

Using AI Code Generation

copy

Full Screen

1Dimension size = element.getSize();2System.out.println("Size of element is: " + size);3int width = element.getSize().getWidth();4System.out.println("Width of element is: " + width);5int height = element.getSize().getHeight();6System.out.println("Height of element is: " + height);7int width = element.getSize().width;8System.out.println("Width of eletWidth();9System.out.prinmln("eidth of element is: " + width);

Full Screen

Full Screen

getSize

Using AI Code Generation

copy

Full Screen

1int height = element.getSize().height;2System.out.println("Height of element is: " + height);3int width = element.getSize().width();4System.out.println("Width of element is: " + width);5int height = element.getSize().height();6System.out.println("Height of element is: " + height);7int width = element.getSize().getWidth();8System.out.println("Width of element is: " + width);9int height = element.getSize().getHeight();10System.out.println("Height of element is: " + height);11int width = element.getSize().getWidth();12System.out.println("Width of element is: " + width);

Full Screen

Full Screen

Selenium 4 Tutorial:

LambdaTest’s Selenium 4 tutorial is covering every aspects of Selenium 4 testing with examples and best practices. Here you will learn basics, such as how to upgrade from Selenium 3 to Selenium 4, to some advanced concepts, such as Relative locators and Selenium Grid 4 for Distributed testing. Also will learn new features of Selenium 4, such as capturing screenshots of specific elements, opening a new tab or window on the browser, and new protocol adoptions.

Chapters:

  1. Upgrading From Selenium 3 To Selenium 4?: In this chapter, learn in detail how to update Selenium 3 to Selenium 4 for Java binding. Also, learn how to upgrade while using different build tools such as Maven or Gradle and get comprehensive guidance for upgrading Selenium.

  2. What’s New In Selenium 4 & What’s Being Deprecated? : Get all information about new implementations in Selenium 4, such as W3S protocol adaption, Optimized Selenium Grid, and Enhanced Selenium IDE. Also, learn what is deprecated for Selenium 4, such as DesiredCapabilites and FindsBy methods, etc.

  3. Selenium 4 With Python: Selenium supports all major languages, such as Python, C#, Ruby, and JavaScript. In this chapter, learn how to install Selenium 4 for Python and the features of Python in Selenium 4, such as Relative locators, Browser manipulation, and Chrom DevTool protocol.

  4. Selenium 4 Is Now W3C Compliant: JSON Wireframe protocol is retiring from Selenium 4, and they are adopting W3C protocol to learn in detail about the advantages and impact of these changes.

  5. How To Use Selenium 4 Relative Locator? : Selenium 4 came with new features such as Relative Locators that allow constructing locators with reference and easily located constructors nearby. Get to know its different use cases with examples.

  6. Selenium Grid 4 Tutorial For Distributed Testing: Selenium Grid 4 allows you to perform tests over different browsers, OS, and device combinations. It also enables parallel execution browser testing, reads up on various features of Selenium Grid 4 and how to download it, and runs a test on Selenium Grid 4 with best practices.

  7. Selenium Video Tutorials: Binge on video tutorials on Selenium by industry experts to get step-by-step direction from automating basic to complex test scenarios with Selenium.

Selenium 101 certifications:

LambdaTest also provides certification for Selenium testing to accelerate your career in Selenium automation testing.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful