How to use values method of org.openqa.selenium.Enum Platform class

Best Selenium code snippet using org.openqa.selenium.Enum Platform.values

Source:SmartAnnotations.java Github

copy

Full Screen

...124 private Strategies(String valueName) {125 this.valueName = valueName;126 }127 private static String[] strategyNames() {128 Strategies[] strategies = values();129 String[] result = new String[strategies.length];130 int i = 0;131 for (Strategies strategy : values()) {132 result[i] = strategy.valueName;133 i++;134 }135 return result;136 }137 private static String getValue(Annotation annotation,138 Strategies strategy) {139 try {140 Method m = annotation.getClass().getMethod(strategy.valueName, DEFAULT_ANNOTATION_METHOD_ARGUMENTS);141 return m.invoke(annotation, new Object[]{}).toString();142 } catch (NoSuchMethodException | SecurityException | IllegalArgumentException | IllegalAccessException | InvocationTargetException e) {143 throw new RuntimeException(e);144 }145 }146 org.openqa.selenium.By getBy(Annotation annotation) {147 return null;148 }149 }150 public SmartAnnotations(Field field, MobilePlatform platform) {151 this(field, platform, WebDriverInjectors.getInjector().getInstance(CustomFindByAnnotationProviderService.class));152 }153 public SmartAnnotations(Field field, MobilePlatform platform,154 CustomFindByAnnotationProviderService customFindByAnnotationProviderService) {155 super(field);156 this.field = field;157 this.platform = platform;158 this.customFindByAnnotationProviderService = customFindByAnnotationProviderService;159 }160 protected void assertValidAnnotations() {161 FindBys findBys = field.getAnnotation(FindBys.class);162 FindBy myFindBy = field.getAnnotation(FindBy.class);163 // START - [dep1] *** todo [deprecate thucydides] Remove this check once thucydides package name removed164 net.thucydides.core.annotations.findby.FindBy myDepFindBy = field.getAnnotation(net.thucydides.core.annotations.findby.FindBy.class);165 if (myDepFindBy != null && myFindBy != null) {166 throw new IllegalArgumentException(("Do not combine the serenitybdd and thucydides namespace. The thucydides namespace is now deprecated, so please convert."));167 }168 if (findBys != null && myDepFindBy != null) {169 throw new IllegalArgumentException("If you use a '@FindBys' annotation, "170 + "you must not also use a '@FindBy' annotation");171 }172 // END - [dep1] *** [deprecated thucydides]173 if (findBys != null && myFindBy != null) {174 throw new IllegalArgumentException("If you use a '@FindBys' annotation, "175 + "you must not also use a '@FindBy' annotation");176 }177 }178 // @Override179 public org.openqa.selenium.By buildBy() {180 assertValidAnnotations();181 org.openqa.selenium.By by = null;182 // appium additions183 AndroidFindBy androidBy = field.getAnnotation(AndroidFindBy.class);184 if (androidBy != null && ANDROID.toUpperCase().equals(platform.name())) {185 by = getMobileBy(androidBy, getFieldValue(androidBy));186 }187 AndroidFindBys androidBys = field.getAnnotation(AndroidFindBys.class);188 if (androidBys != null && ANDROID.toUpperCase().equals(platform.name())) {189 by = getComplexMobileBy(androidBys.value(), ByChained.class);190 }191 AndroidFindAll androidFindAll = field.getAnnotation(AndroidFindAll.class);192 if (androidFindAll != null && ANDROID.toUpperCase().equals(platform.name())) {193 by = getComplexMobileBy(androidFindAll.value(), ByChained.class);194 }195 iOSXCUITFindBy iOSBy = field.getAnnotation(iOSXCUITFindBy.class);196 if (iOSBy != null && IOS.toUpperCase().equals(platform.name())) {197 by = getMobileBy(iOSBy, getFieldValue(iOSBy));198 }199 iOSXCUITFindBys iOSBys = field.getAnnotation(iOSXCUITFindBys.class);200 if (iOSBys != null && IOS.toUpperCase().equals(platform.name())) {201 by = getComplexMobileBy(iOSBys.value(), ByChained.class);202 }203 iOSXCUITFindAll iOSXCUITFindAll = field.getAnnotation(iOSXCUITFindAll.class);204 if (iOSXCUITFindAll != null && IOS.toUpperCase().equals(platform.name())) {205 by = getComplexMobileBy(iOSXCUITFindAll.value(), ByChained.class);206 }207 //my additions to FindBy208 FindBy myFindBy = field.getAnnotation(FindBy.class);209 if (by == null && myFindBy != null) {210 by = buildByFromFindBy(myFindBy);211 }212 // START - [deo2] *** todo [deprecate thucydides] Remove this code once thucydides package name removed213 //my additions to FindBy214 net.thucydides.core.annotations.findby.FindBy myDepFindBy = field.getAnnotation(net.thucydides.core.annotations.findby.FindBy.class);215 if (by == null && myDepFindBy != null) {216 by = buildByFromFindBy(myDepFindBy);217 }218 //END - [dep2] ***219// FindBys thucydidesBys = field.getAnnotation(FindBys.class);220// if (thucydidesBys != null) {221// by = buildByFromFindBys(thucydidesBys);222// }223//224// // default implementation in case if org.openqa.selenium.support.FindBy was used225// org.openqa.selenium.support.FindBy seleniumBy = field.getAnnotation(org.openqa.selenium.support.FindBy.class);226// if (seleniumBy != null) {227// by = super.buildByFromFindBy(seleniumBy);228// }229//230// org.openqa.selenium.support.FindAll seleniumFindAll = field.getAnnotation(org.openqa.selenium.support.FindAll.class);231// if (seleniumFindAll != null) {232// by = super.buildBysFromFindByOneOf(seleniumFindAll);233// }234//235 if (by == null) {236 by = buildByFromCustomAnnotationProvider(field);237 }238 if (by == null) {239 by = super.buildBy();240 }241 if (by == null) {242 by = buildByFromDefault();243 }244 if (by == null) {245 throw new IllegalArgumentException("Cannot determine how to locate element " + field);246 }247 return by;248 }249 protected org.openqa.selenium.By buildByFromCustomAnnotationProvider( Field field) {250 return customFindByAnnotationProviderService.getCustomFindByAnnotationServices().stream()251 .filter(annotationService ->annotationService.isAnnotatedByCustomFindByAnnotation(field))252 .findFirst().map(annotationService ->annotationService.buildByFromCustomFindByAnnotation(field))253 .orElse(null);254 }255 protected org.openqa.selenium.By buildByFromFindBy(FindBy myFindBy) {256 assertValidFindBy(myFindBy);257 org.openqa.selenium.By by = buildByFromShortFindBy(myFindBy);258 if (by == null) {259 by = buildByFromLongFindBy(myFindBy);260 }261 return by;262 }263 protected org.openqa.selenium.By buildByFromLongFindBy(FindBy myFindBy) {264 How how = myFindBy.how();265 String using = myFindBy.using();266 switch (how) {267 case CLASS_NAME:268 return org.openqa.selenium.By.className(using);269 case CSS:270 return org.openqa.selenium.By.cssSelector(using);271 case ID:272 return org.openqa.selenium.By.id(using);273 case ID_OR_NAME:274 return new ByIdOrName(using);275 case LINK_TEXT:276 return org.openqa.selenium.By.linkText(using);277 case NAME:278 return org.openqa.selenium.By.name(using);279 case PARTIAL_LINK_TEXT:280 return org.openqa.selenium.By.partialLinkText(using);281 case TAG_NAME:282 return org.openqa.selenium.By.tagName(using);283 case XPATH:284 return org.openqa.selenium.By.xpath(using);285 case JQUERY:286 return By.jquery(using);287 case SCLOCATOR:288 return By.sclocator(using);289 case ACCESSIBILITY_ID:290 return MobileBy.AccessibilityId(using);291// case IOS_UI_AUTOMATION:292// return MobileBy.IosUIAutomation(using);293 case ANDROID_UI_AUTOMATOR:294 return MobileBy.AndroidUIAutomator(using);295 case IOS_CLASS_CHAIN:296 return MobileBy.iOSClassChain(using);297 case IOS_NS_PREDICATE_STRING:298 return MobileBy.iOSNsPredicateString(using);299 default:300 // Note that this shouldn't happen (eg, the above matches all301 // possible values for the How enum)302 throw new IllegalArgumentException("Cannot determine how to locate element " + field);303 }304 }305 protected org.openqa.selenium.By buildByFromShortFindBy(FindBy myFindBy) {306 if (isNotEmpty(myFindBy.className())) {307 return org.openqa.selenium.By.className(myFindBy.className());308 }309 if (isNotEmpty(myFindBy.css())) {310 return org.openqa.selenium.By.cssSelector(myFindBy.css());311 }312 if (isNotEmpty(myFindBy.id())) {313 return org.openqa.selenium.By.id(myFindBy.id());314 }315 if (isNotEmpty(myFindBy.linkText())) {316 return org.openqa.selenium.By.linkText(myFindBy.linkText());317 }318 if (isNotEmpty(myFindBy.name())) {319 return org.openqa.selenium.By.name(myFindBy.name());320 }321 if (isNotEmpty(myFindBy.ngModel())) {322 return org.openqa.selenium.By.cssSelector("*[ng-model='" + myFindBy.ngModel() + "']");323 }324 if (isNotEmpty(myFindBy.partialLinkText())) {325 return org.openqa.selenium.By.partialLinkText(myFindBy.partialLinkText());326 }327 if (isNotEmpty(myFindBy.tagName())) {328 return org.openqa.selenium.By.tagName(myFindBy.tagName());329 }330 if (isNotEmpty(myFindBy.xpath())) {331 return org.openqa.selenium.By.xpath(myFindBy.xpath());332 }333 if (isNotEmpty(myFindBy.sclocator())) {334 return By.sclocator(myFindBy.sclocator());335 }336 if (isNotEmpty(myFindBy.jquery())) {337 return By.jquery(myFindBy.jquery());338 }339 if (isNotEmpty(myFindBy.accessibilityId())) {340 return MobileBy.AccessibilityId(myFindBy.accessibilityId());341 }342 if (isNotEmpty(myFindBy.androidUIAutomator())) {343 return MobileBy.AndroidUIAutomator(myFindBy.androidUIAutomator());344 }345// if (isNotEmpty(myFindBy.iOSUIAutomation())) {346// // FIXME: Need to support android with platform switch347// return MobileBy.IosUIAutomation(myFindBy.iOSUIAutomation());348// }349 // Fall through350 return null;351 }352 private org.openqa.selenium.By getMobileBy(Annotation annotation, String valueName) {353 Strategies strategies[] = Strategies.values();354 for (Strategies strategy : strategies) {355 if (strategy.returnValueName().equals(valueName)) {356 return strategy.getBy(annotation);357 }358 }359 throw new IllegalArgumentException("@"360 + annotation.getClass().getSimpleName()361 + ": There is an unknown strategy " + valueName);362 }363 @SuppressWarnings("unchecked")364 private <T extends org.openqa.selenium.By> T getComplexMobileBy(Annotation[] annotations, Class<T> requiredByClass) {365 ;366 org.openqa.selenium.By[] byArray = new org.openqa.selenium.By[annotations.length];367 for (int i = 0; i < annotations.length; i++) {368 byArray[i] = getMobileBy(annotations[i],369 getFieldValue(annotations[i]));370 }371 try {372 Constructor<?> c = requiredByClass.getConstructor(org.openqa.selenium.By[].class);373 Object[] values = new Object[]{byArray};374 return (T) c.newInstance(values);375 } catch (Exception e) {376 throw new RuntimeException(e);377 }378 }379 private static String getFieldValue(Annotation mobileBy) {380 Method[] values = prepareAnnotationMethods(mobileBy.getClass());381 for (Method value : values) {382 try {383 String strategyParameter = value.invoke(mobileBy).toString();384 if (isNotEmpty(strategyParameter) && isStrategyName(value.getName())) {385 return value.getName();386 }387 } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {388 throw new RuntimeException(e);389 }390 }391 throw new IllegalArgumentException("@"392 + mobileBy.getClass().getSimpleName() + ": one of "393 + Arrays.toString(Strategies.strategyNames()) + " should be filled");394 }395 private static boolean isStrategyName(String potentialStrategyName) {396 return Arrays.asList(Strategies.strategyNames()).contains(potentialStrategyName);397 }398 private static Method[] prepareAnnotationMethods(399 Class<? extends Annotation> annotation) {400 List<String> targetAnnotationMethodNamesList = getMethodNames(annotation.getDeclaredMethods());401 targetAnnotationMethodNamesList.removeAll(METHODS_TO_BE_EXCLUDED_WHEN_ANNOTATION_IS_READ);402 Method[] result = new Method[targetAnnotationMethodNamesList.size()];403 for (String methodName : targetAnnotationMethodNamesList) {404 try {405 result[targetAnnotationMethodNamesList.indexOf(methodName)] = annotation.getMethod(methodName, DEFAULT_ANNOTATION_METHOD_ARGUMENTS);406 } catch (NoSuchMethodException e) {407 throw new RuntimeException(e);408 } catch (SecurityException e) {409 throw new RuntimeException(e);410 }411 }412 return result;413 }414 private static List<String> getMethodNames(Method[] methods) {415 List<String> names = new ArrayList<String>();416 for (Method m : methods) {417 names.add(m.getName());418 }419 return names;420 }421 private final static List<String> METHODS_TO_BE_EXCLUDED_WHEN_ANNOTATION_IS_READ = new ArrayList<String>() {422 private static final long serialVersionUID = 1L;423 {424 List<String> objectClassMethodNames = getMethodNames(Object.class425 .getDeclaredMethods());426 addAll(objectClassMethodNames);427 List<String> annotationClassMethodNames = getMethodNames(Annotation.class428 .getDeclaredMethods());429 annotationClassMethodNames.removeAll(objectClassMethodNames);430 addAll(annotationClassMethodNames);431 }432 };433 private void assertValidFindBy(FindBy findBy) {434 if (findBy.how() != null) {435 if (findBy.using() == null) {436 throw new IllegalArgumentException(437 "If you set the 'how' property, you must also set 'using'");438 }439 }440 Set<String> finders = new HashSet<String>();441 if (!"".equals(findBy.using())) finders.add("how: " + findBy.using());442 if (!"".equals(findBy.className())) finders.add("class name:" + findBy.className());443 if (!"".equals(findBy.css())) finders.add("css:" + findBy.css());444 if (!"".equals(findBy.id())) finders.add("id: " + findBy.id());445 if (!"".equals(findBy.linkText())) finders.add("link text: " + findBy.linkText());446 if (!"".equals(findBy.name())) finders.add("name: " + findBy.name());447 if (!"".equals(findBy.ngModel())) finders.add("ngModel: " + findBy.ngModel());448 if (!"".equals(findBy.partialLinkText())) finders.add("partial link text: " + findBy.partialLinkText());449 if (!"".equals(findBy.tagName())) finders.add("tag name: " + findBy.tagName());450 if (!"".equals(findBy.xpath())) finders.add("xpath: " + findBy.xpath());451 if (!"".equals(findBy.sclocator())) finders.add("scLocator: " + findBy.sclocator());452 if (!"".equals(findBy.jquery())) finders.add("jquery: " + findBy.jquery());453 if (!"".equals(findBy.accessibilityId())) finders.add("accessibilityId: " + findBy.accessibilityId());454 if (!"".equals(findBy.androidUIAutomator())) finders.add("androidUIAutomator: " + findBy.androidUIAutomator());455 if (!"".equals(findBy.iOSUIAutomation())) finders.add("iOSUIAutomation: " + findBy.iOSUIAutomation());456 // A zero count is okay: it means to look by name or id.457 if (finders.size() > 1) {458 throw new IllegalArgumentException(459 String.format("You must specify at most one location strategy. Number found: %d (%s)",460 finders.size(), finders.toString()));461 }462 }463 // START - [dep3] *** todo [deprecate thucydides] Remove this once thucydides package name is removed464 /**465 * @deprecated use serenitybdd variation466 */467 @Deprecated468 protected org.openqa.selenium.By buildByFromFindBy(net.thucydides.core.annotations.findby.FindBy myDepFindBy) {469 assertValidFindBy(myDepFindBy);470 org.openqa.selenium.By ans = buildByFromShortFindBy(myDepFindBy);471 if (ans == null) {472 ans = buildByFromLongFindBy(myDepFindBy);473 }474 return ans;475 }476 /**477 * @deprecated use serenitybdd variation478 */479 @Deprecated480 protected org.openqa.selenium.By buildByFromLongFindBy(net.thucydides.core.annotations.findby.FindBy myDepFindBy) {481 How how = myDepFindBy.how();482 String using = myDepFindBy.using();483 switch (how) {484 case CLASS_NAME:485 return org.openqa.selenium.By.className(using);486 case CSS:487 return org.openqa.selenium.By.cssSelector(using);488 case ID:489 return org.openqa.selenium.By.id(using);490 case ID_OR_NAME:491 return new ByIdOrName(using);492 case LINK_TEXT:493 return org.openqa.selenium.By.linkText(using);494 case NAME:495 return org.openqa.selenium.By.name(using);496 case PARTIAL_LINK_TEXT:497 return org.openqa.selenium.By.partialLinkText(using);498 case TAG_NAME:499 return org.openqa.selenium.By.tagName(using);500 case XPATH:501 return org.openqa.selenium.By.xpath(using);502 case JQUERY:503 return By.jquery(using);504 case SCLOCATOR:505 return By.sclocator(using);506 default:507 // Note that this shouldn't happen (eg, the above matches all508 // possible values for the How enum)509 throw new IllegalArgumentException("Cannot determine how to locate element " + field);510 }511 }512 /**513 * @deprecated use serenitybdd variation514 */515 @Deprecated516 protected org.openqa.selenium.By buildByFromShortFindBy(net.thucydides.core.annotations.findby.FindBy myDepFindBy) {517 if (isNotEmpty(myDepFindBy.className())) {518 return org.openqa.selenium.By.className(myDepFindBy.className());519 }520 if (isNotEmpty(myDepFindBy.css())) {521 return org.openqa.selenium.By.cssSelector(myDepFindBy.css());522 }...

Full Screen

Full Screen

Source:test_ESTest_scaffolding.java Github

copy

Full Screen

1/**2 * Scaffolding file used to store all the setups needed to run 3 * tests automatically generated by EvoSuite4 * Thu Apr 04 02:58:34 GMT 20195 */6package com.test.applications;7import org.evosuite.runtime.annotation.EvoSuiteClassExclude;8import org.junit.BeforeClass;9import org.junit.Before;10import org.junit.After;11import org.junit.AfterClass;12import org.evosuite.runtime.sandbox.Sandbox;13import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;14@EvoSuiteClassExclude15public class test_ESTest_scaffolding {16 @org.junit.Rule 17 public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();18 private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); 19 private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);20 @BeforeClass 21 public static void initEvoSuiteFramework() { 22 org.evosuite.runtime.RuntimeSettings.className = "com.test.applications.test"; 23 org.evosuite.runtime.GuiSupport.initialize(); 24 org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; 25 org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; 26 org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; 27 org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; 28 org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); 29 org.evosuite.runtime.classhandling.JDKClassResetter.init();30 setSystemProperties();31 initializeClasses();32 org.evosuite.runtime.Runtime.getInstance().resetRuntime(); 33 } 34 @AfterClass 35 public static void clearEvoSuiteFramework(){ 36 Sandbox.resetDefaultSecurityManager(); 37 java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); 38 } 39 @Before 40 public void initTestCase(){ 41 threadStopper.storeCurrentThreads();42 threadStopper.startRecordingTime();43 org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); 44 org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); 45 setSystemProperties(); 46 org.evosuite.runtime.GuiSupport.setHeadless(); 47 org.evosuite.runtime.Runtime.getInstance().resetRuntime(); 48 org.evosuite.runtime.agent.InstrumentingAgent.activate(); 49 } 50 @After 51 public void doneWithTestCase(){ 52 threadStopper.killAndJoinClientThreads();53 org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); 54 org.evosuite.runtime.classhandling.JDKClassResetter.reset(); 55 resetClasses(); 56 org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); 57 org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); 58 org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); 59 } 60 public static void setSystemProperties() {61 62 java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); 63 java.lang.System.setProperty("file.encoding", "GBK"); 64 java.lang.System.setProperty("java.awt.headless", "true"); 65 java.lang.System.setProperty("user.country", "CN"); 66 java.lang.System.setProperty("user.language", "zh"); 67 java.lang.System.setProperty("user.timezone", "Asia/Shanghai"); 68 }69 private static void initializeClasses() {70 org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(test_ESTest_scaffolding.class.getClassLoader() ,71 "org.openqa.selenium.io.FileHandler$Filter",72 "org.openqa.selenium.remote.CommandInfo",73 "org.openqa.selenium.net.EphemeralPortRangeDetector",74 "com.google.common.collect.ImmutableMultimap$Itr",75 "com.google.common.collect.Lists$RandomAccessPartition",76 "org.openqa.selenium.remote.Augmentable",77 "com.google.common.collect.Collections2",78 "com.google.common.collect.PeekingIterator",79 "com.google.common.collect.ImmutableSet$Indexed",80 "org.openqa.selenium.logging.LogEntry$1",81 "org.openqa.selenium.os.OsProcess",82 "org.openqa.selenium.chrome.ChromeOptions",83 "org.openqa.selenium.remote.internal.ApacheHttpClient",84 "org.openqa.selenium.internal.FindsById",85 "org.openqa.selenium.net.FixedIANAPortRange",86 "org.openqa.selenium.net.UrlChecker$TimeoutException",87 "com.google.common.collect.ImmutableCollection$ArrayBasedBuilder",88 "com.google.common.collect.Platform",89 "com.google.common.collect.ImmutableMap$IteratorBasedImmutableMap$1EntrySetImpl",90 "com.google.common.collect.RegularImmutableMap",91 "com.google.common.collect.RegularImmutableBiMap",92 "com.google.common.base.Converter$IdentityConverter",93 "com.google.common.collect.ImmutableMultimap$Values",94 "org.apache.http.conn.HttpClientConnectionManager",95 "com.google.common.collect.AbstractMapEntry",96 "com.google.common.collect.ImmutableMap$IteratorBasedImmutableMap",97 "com.google.common.collect.Iterators$12",98 "com.google.common.collect.Iterators$11",99 "com.google.common.collect.ImmutableBiMap$Builder",100 "com.google.common.base.Predicate",101 "com.google.common.collect.ImmutableSet$Indexed$1",102 "org.apache.http.client.CredentialsProvider",103 "com.google.common.base.Joiner",104 "org.openqa.selenium.logging.profiler.ProfilerLogEntry",105 "org.apache.http.client.ClientProtocolException",106 "org.openqa.selenium.SearchContext",107 "org.openqa.selenium.chrome.ChromeDriverService",108 "org.openqa.selenium.WebDriverException",109 "org.openqa.selenium.WebDriver",110 "com.google.common.collect.Iterators$13",111 "org.openqa.selenium.remote.RemoteWebDriver$When",112 "com.google.common.collect.Lists$Partition",113 "com.google.common.collect.Lists",114 "org.apache.http.auth.Credentials",115 "com.google.common.collect.UnmodifiableListIterator",116 "com.google.common.collect.ImmutableMultimap",117 "org.openqa.selenium.remote.FileDetector",118 "org.openqa.selenium.remote.Response",119 "com.google.common.collect.Maps$BiMapConverter",120 "com.google.common.base.Joiner$MapJoiner",121 "com.google.common.base.Equivalence$Equals",122 "org.apache.http.client.RedirectStrategy",123 "com.test.applications.test",124 "org.openqa.selenium.remote.SessionNotFoundException",125 "org.apache.http.protocol.HttpContext",126 "com.google.common.collect.ImmutableMapEntry$NonTerminalImmutableMapEntry",127 "org.openqa.selenium.remote.CommandExecutor",128 "org.apache.http.HttpResponse",129 "com.google.common.base.Preconditions",130 "org.openqa.selenium.UnsupportedCommandException",131 "org.openqa.selenium.remote.SessionId",132 "com.google.common.collect.ImmutableMapValues",133 "com.google.common.collect.ImmutableEntry",134 "com.google.common.base.Joiner$1",135 "com.google.common.base.Joiner$2",136 "com.google.common.base.Converter$ConverterComposition",137 "com.google.common.collect.AbstractNavigableMap",138 "com.google.common.collect.ImmutableCollection",139 "com.google.common.collect.ImmutableEnumMap",140 "org.openqa.selenium.logging.LoggingHandler",141 "org.openqa.selenium.JavascriptExecutor",142 "org.openqa.selenium.interactions.HasInputDevices",143 "com.google.common.collect.ImmutableCollection$Builder",144 "com.google.common.collect.ImmutableSetMultimap",145 "com.google.common.collect.Iterators$6",146 "com.google.common.collect.BiMap",147 "com.google.common.collect.Iterators$7",148 "com.google.common.collect.ImmutableSet",149 "com.google.common.collect.Lists$AbstractListWrapper",150 "com.google.common.collect.ImmutableMapEntry",151 "org.openqa.selenium.remote.HttpCommandExecutor",152 "org.apache.http.HttpEntity",153 "org.openqa.selenium.interactions.Mouse",154 "com.google.common.collect.Iterators$1",155 "com.google.common.collect.Iterators$2",156 "com.google.common.collect.ImmutableMapValues$1",157 "com.google.common.collect.Iterators$3",158 "com.google.common.collect.ImmutableMapValues$2",159 "org.openqa.selenium.internal.FindsByLinkText",160 "org.openqa.selenium.remote.http.HttpClient",161 "com.google.common.base.Converter$ReverseConverter",162 "com.google.common.collect.ImmutableMultimap$EntryCollection",163 "com.google.common.collect.Lists$StringAsImmutableList",164 "com.google.common.collect.Lists$2",165 "org.openqa.selenium.logging.NeedsLocalLogs",166 "com.google.common.collect.Maps$IteratorBasedAbstractMap",167 "com.google.common.collect.Maps$FilteredEntryBiMap",168 "com.google.common.collect.RegularImmutableBiMap$Inverse",169 "com.google.common.collect.Lists$1",170 "org.apache.http.conn.SchemePortResolver",171 "org.openqa.selenium.logging.LogEntry",172 "com.google.common.base.Equivalence$Identity",173 "org.openqa.selenium.remote.UnreachableBrowserException",174 "com.google.common.collect.Multiset",175 "org.openqa.selenium.internal.FindsByClassName",176 "com.google.common.collect.AbstractMultimap",177 "com.google.common.collect.EmptyImmutableListMultimap",178 "com.google.common.collect.ImmutableList",179 "org.openqa.selenium.internal.FindsByName",180 "org.openqa.selenium.NotFoundException",181 "org.openqa.selenium.HasCapabilities",182 "org.openqa.selenium.By$ByPartialLinkText",183 "org.openqa.selenium.NoAlertPresentException",184 "org.openqa.selenium.By$ById",185 "org.openqa.selenium.html5.WebStorage",186 "com.google.common.collect.Maps$FilteredEntrySortedMap",187 "org.openqa.selenium.io.FileHandler",188 "org.openqa.selenium.By",189 "com.google.common.collect.ImmutableMap$Builder",190 "com.google.common.base.Converter$FunctionBasedConverter",191 "org.openqa.selenium.WebDriver$TargetLocator",192 "com.google.common.collect.Maps$EntryTransformer",193 "org.openqa.selenium.remote.http.HttpMethod",194 "org.openqa.selenium.logging.LocalLogs",195 "org.openqa.selenium.Platform$10",196 "org.openqa.selenium.Platform$11",197 "com.google.common.collect.Hashing",198 "org.openqa.selenium.remote.service.DriverService$Builder",199 "org.openqa.selenium.Platform$14",200 "com.google.common.collect.ImmutableList$SubList",201 "org.openqa.selenium.Platform$15",202 "com.google.common.collect.ListMultimap",203 "com.google.common.base.FunctionalEquivalence",204 "org.openqa.selenium.html5.LocationContext",205 "org.openqa.selenium.Platform$12",206 "org.openqa.selenium.Platform$13",207 "com.google.common.collect.RegularImmutableList",208 "com.google.common.base.Optional",209 "com.google.common.collect.Lists$TransformingRandomAccessList",210 "org.apache.http.HttpMessage",211 "org.openqa.selenium.Platform$16",212 "org.openqa.selenium.remote.http.HttpClient$Factory",213 "com.google.common.collect.ImmutableMapKeySet",214 "com.google.common.collect.ImmutableMap$MapViewOfValuesAsSingletonSets$1",215 "org.openqa.selenium.remote.DesiredCapabilities",216 "org.apache.http.HttpRequest",217 "com.google.common.collect.SortedMapDifference",218 "com.google.common.collect.RegularImmutableSet",219 "org.openqa.selenium.NoSuchSessionException",220 "org.openqa.selenium.chrome.ChromeDriverService$Builder",221 "com.google.common.collect.ImmutableListMultimap",222 "com.google.common.collect.ImmutableMultimap$1",223 "org.openqa.selenium.internal.FindsByCssSelector",224 "com.google.common.collect.Maps$AbstractFilteredMap",225 "org.openqa.selenium.internal.FindsByTagName",226 "org.openqa.selenium.logging.Logs",227 "com.google.common.base.Present",228 "org.openqa.selenium.By$ByName",229 "com.google.common.collect.ImmutableMultimap$2",230 "com.google.common.collect.ImmutableAsList",231 "com.google.common.collect.ImmutableMapEntrySet$RegularEntrySet",232 "com.google.common.collect.ImmutableSet$Builder",233 "com.google.common.collect.RegularImmutableAsList",234 "com.google.common.collect.Maps$FilteredEntryMap",235 "com.google.common.collect.SingletonImmutableSet",236 "org.apache.http.client.methods.HttpUriRequest",237 "com.google.common.collect.ImmutableMapEntrySet",238 "org.openqa.selenium.Platform$5",239 "org.openqa.selenium.Platform$6",240 "org.openqa.selenium.Platform$3",241 "org.openqa.selenium.TakesScreenshot",242 "org.openqa.selenium.Platform$4",243 "org.openqa.selenium.Platform$9",244 "org.apache.http.client.HttpClient",245 "org.openqa.selenium.Platform$7",246 "com.google.common.collect.ImmutableMultiset",247 "org.openqa.selenium.Platform$8",248 "com.google.common.collect.ImmutableMultimap$Keys",249 "org.openqa.selenium.os.ExecutableFinder",250 "org.openqa.selenium.Platform$1",251 "org.openqa.selenium.Platform$2",252 "com.google.common.collect.Lists$TransformingSequentialList",253 "org.openqa.selenium.net.PortProber",254 "org.openqa.selenium.WebDriver$Navigation",255 "com.google.common.collect.ObjectArrays",256 "com.google.common.collect.AbstractIterator",257 "org.openqa.selenium.Platform",258 "org.openqa.selenium.remote.RemoteWebDriver",259 "com.google.common.collect.ImmutableList$1",260 "org.openqa.selenium.NoSuchElementException",261 "com.google.common.collect.MapDifference",262 "com.google.common.collect.ImmutableMap$MapViewOfValuesAsSingletonSets",263 "org.openqa.selenium.By$ByXPath",264 "com.google.common.collect.UnmodifiableIterator",265 "org.openqa.selenium.By$ByClassName",266 "org.openqa.selenium.remote.Command",267 "com.google.common.collect.Maps$FilteredEntryNavigableMap",268 "org.openqa.selenium.chrome.ChromeDriver",269 "org.openqa.selenium.remote.service.DriverService",270 "org.apache.http.NoHttpResponseException",271 "com.google.common.collect.Lists$RandomAccessListWrapper",272 "org.openqa.selenium.interactions.Keyboard",273 "com.google.common.collect.ImmutableList$ReverseImmutableList",274 "org.apache.http.conn.routing.HttpRoutePlanner",275 "org.openqa.selenium.remote.ExecuteMethod",276 "com.google.common.collect.SingletonImmutableList",277 "org.openqa.selenium.logging.LocalLogs$1",278 "com.google.common.base.Converter",279 "com.google.common.collect.Maps$6",280 "com.google.common.base.Function",281 "com.google.common.collect.ImmutableMap",282 "com.google.common.collect.AbstractIndexedListIterator",283 "org.openqa.selenium.Capabilities",284 "com.google.common.collect.CollectPreconditions",285 "org.openqa.selenium.remote.internal.HttpClientFactory",286 "org.openqa.selenium.remote.internal.ApacheHttpClient$Factory",287 "com.google.common.collect.Maps$ViewCachingAbstractMap",288 "com.google.common.collect.ImmutableMap$1",289 "com.google.common.collect.ImmutableList$Builder",290 "org.openqa.selenium.chrome.ChromeDriverCommandExecutor",291 "org.openqa.selenium.By$ByLinkText",292 "com.google.common.collect.ImmutableMapEntry$NonTerminalImmutableBiMapEntry",293 "com.google.common.collect.Multimap",294 "com.google.common.collect.Iterators",295 "com.google.common.collect.ImmutableBiMap",296 "com.google.gson.JsonElement",297 "com.google.common.collect.SingletonImmutableBiMap",298 "com.google.common.base.PairwiseEquivalence",299 "org.openqa.selenium.remote.service.DriverCommandExecutor",300 "org.openqa.selenium.WebDriver$Options",301 "org.apache.http.impl.client.CloseableHttpClient",302 "org.openqa.selenium.os.CommandLine",303 "org.openqa.selenium.By$ByTagName",304 "com.google.common.base.Equivalence",305 "org.openqa.selenium.internal.FindsByXPath",306 "org.openqa.selenium.By$ByCssSelector",307 "com.google.common.collect.Maps",308 "org.openqa.selenium.Beta",309 "com.google.common.collect.SetMultimap",310 "org.openqa.selenium.logging.profiler.HttpProfilerLogEntry",311 "com.google.common.collect.Iterators$MergingIterator"312 );313 } 314 private static void resetClasses() {315 org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(test_ESTest_scaffolding.class.getClassLoader()); 316 org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(317 "org.openqa.selenium.remote.RemoteWebDriver",318 "org.openqa.selenium.chrome.ChromeDriverService",319 "com.google.common.collect.ImmutableMap",320 "com.google.common.collect.ImmutableBiMap",321 "com.google.common.collect.RegularImmutableBiMap",322 "org.openqa.selenium.Platform$1",323 "org.openqa.selenium.Platform$2",324 "org.openqa.selenium.Platform$3",325 "org.openqa.selenium.Platform$4",326 "org.openqa.selenium.Platform$5",327 "org.openqa.selenium.Platform$6",328 "org.openqa.selenium.Platform$7",329 "org.openqa.selenium.Platform$8",330 "org.openqa.selenium.Platform$9",331 "org.openqa.selenium.Platform$10",332 "org.openqa.selenium.Platform$11",333 "org.openqa.selenium.Platform$12",334 "org.openqa.selenium.Platform$13",335 "org.openqa.selenium.Platform$14",336 "org.openqa.selenium.Platform$15",337 "org.openqa.selenium.Platform$16",338 "org.openqa.selenium.Platform",339 "org.openqa.selenium.net.PortProber",340 "com.google.common.collect.ImmutableCollection",341 "com.google.common.collect.ImmutableSet",342 "com.google.common.collect.ObjectArrays",343 "com.google.common.collect.Hashing",344 "com.google.common.collect.RegularImmutableSet",345 "org.openqa.selenium.os.ExecutableFinder",346 "com.google.common.collect.ImmutableCollection$Builder",347 "com.google.common.collect.Iterators",348 "com.google.common.collect.ImmutableList",349 "com.google.common.collect.SingletonImmutableList",350 "org.openqa.selenium.chrome.ChromeOptions",351 "com.google.common.collect.Collections2",352 "com.google.common.collect.Maps",353 "org.openqa.selenium.remote.DesiredCapabilities",354 "org.openqa.selenium.remote.HttpCommandExecutor",355 "org.openqa.selenium.remote.http.HttpMethod",356 "com.google.common.collect.SingletonImmutableBiMap",357 "org.openqa.selenium.chrome.ChromeDriverCommandExecutor",358 "org.openqa.selenium.remote.internal.ApacheHttpClient$Factory",359 "org.openqa.selenium.remote.internal.HttpClientFactory"360 );361 }362}...

Full Screen

Full Screen

Source:CapabilityTypes.java Github

copy

Full Screen

...28 * <p>29 * <p>{@code web.driver.capability.browserName} to define browser. This is the necessary property</p>30 * <p>{@code web.driver.capability.platformName} to define name of a supported platform.31 * Windows, Linux etc. This is not the necessary property. @see org.openqa.selenium.Platform</p>32 * <p>{@code web.driver.capability.javascriptEnabled} to enable or to disable js. Possible values are33 * {@code true} or {@code false}. By default js is enabled. This is not the necessary property.</p>34 * <p>{@code web.driver.capability.browserVersion} to define a version of browser. This is not the necessary35 * property.</p>36 * <p>{@code remote.capability.suppliers} to define additional capabilities. It is a string with name of a37 * supplier.38 * @see CapabilitySupplier39 * @see AdditionalCapabilitiesFor </p>40 * </p>41 *42 * @return built {@link Capabilities}43 */44 @Override45 public Capabilities get() {46 if (CommonCapabilityProperties.BROWSER_NAME.get() == null ||47 isBlank(String.valueOf(CommonCapabilityProperties.BROWSER_NAME.get()))) {48 throw new IllegalArgumentException(format("The property %s should be defined",49 CommonCapabilityProperties.BROWSER_NAME.getPropertyName()));50 }51 return super.get();52 }53 },54 /**55 * Capabilities for the starting of {@link org.openqa.selenium.chrome.ChromeDriver}56 */57 CHROME("chrome") {58 /**59 * Creates {@link Capabilities} with following properties:60 * <p>61 * <p>{@code web.driver.capability.platformName} to define name of a supported platform.62 * Windows, Linux etc. This is not the necessary property. @see org.openqa.selenium.Platform</p>63 * <p>{@code web.driver.capability.javascriptEnabled} to enable or to disable js. Possible values are64 * {@code true} or {@code false}. By default js is enabled. This is not the necessary property.</p>65 * <p>{@code web.driver.capability.browserVersion} to define a version of browser. This is not the necessary66 * property.</p>67 * <p>{@code remote.capability.suppliers} to define additional capabilities. It is a string with name of a68 * supplier.69 * @see CapabilitySupplier70 * @see AdditionalCapabilitiesFor </p>71 * </p>72 *73 * @return built {@link ChromeOptions}74 */75 @Override76 public Capabilities get() {77 return new ChromeOptions().merge(super.get());78 }79 },80 /**81 * Capabilities for the starting of {@link org.openqa.selenium.edge.EdgeDriver}82 */83 EDGE("edge") {84 /**85 * Creates {@link Capabilities} with following properties:86 * <p>87 * <p>{@code web.driver.capability.platformName} to define name of a supported platform.88 * Windows, Linux etc. This is not the necessary property. @see org.openqa.selenium.Platform</p>89 * <p>{@code web.driver.capability.javascriptEnabled} to enable or to disable js. Possible values are90 * {@code true} or {@code false}. By default js is enabled. This is not the necessary property.</p>91 * <p>{@code web.driver.capability.browserVersion} to define a version of browser. This is not the necessary92 * property.</p>93 * <p>{@code remote.capability.suppliers} to define additional capabilities. It is a string with name of a94 * supplier.95 * @see CapabilitySupplier96 * @see AdditionalCapabilitiesFor </p>97 * </p>98 *99 * @return built {@link EdgeOptions}100 */101 @Override102 public Capabilities get() {103 return new EdgeOptions().merge(super.get());104 }105 },106 /**107 * Capabilities for the starting of {@link org.openqa.selenium.firefox.FirefoxDriver}108 */109 FIREFOX("firefox") {110 /**111 * Creates {@link Capabilities} with following properties:112 * <p>113 * <p>{@code web.driver.capability.platformName} to define name of a supported platform.114 * Windows, Linux etc. This is not the necessary property. @see org.openqa.selenium.Platform</p>115 * <p>{@code web.driver.capability.javascriptEnabled} to enable or to disable js. Possible values are116 * {@code true} or {@code false}. By default js is enabled. This is not the necessary property.</p>117 * <p>{@code web.driver.capability.browserVersion} to define a version of browser. This is not the necessary118 * property.</p>119 * <p>{@code remote.capability.suppliers} to define additional capabilities. It is a string with name of a120 * supplier.121 * @see CapabilitySupplier122 * @see AdditionalCapabilitiesFor </p>123 * </p>124 *125 * @return built {@link FirefoxOptions}126 */127 @Override128 public Capabilities get() {129 return new FirefoxOptions().merge(super.get());130 }131 },132 /**133 * Capabilities for the starting of {@link org.openqa.selenium.ie.InternetExplorerDriver}134 */135 IE("ie") {136 /**137 * Creates {@link Capabilities} with following properties:138 * <p>139 * <p>{@code web.driver.capability.platformName} to define name of a supported platform.140 * Windows, Linux etc. This is not the necessary property. @see org.openqa.selenium.Platform</p>141 * <p>{@code web.driver.capability.javascriptEnabled} to enable or to disable js. Possible values are142 * {@code true} or {@code false}. By default js is enabled. This is not the necessary property.</p>143 * <p>{@code web.driver.capability.browserVersion} to define a version of browser. This is not the necessary144 * property.</p>145 * <p>{@code remote.capability.suppliers} to define additional capabilities. It is a string with name of a146 * supplier.147 * @see CapabilitySupplier148 * @see AdditionalCapabilitiesFor </p>149 * </p>150 *151 * @return built {@link InternetExplorerOptions}152 */153 @Override154 public Capabilities get() {155 return new InternetExplorerOptions().merge(super.get());156 }157 },158 /**159 * Capabilities for the starting of {@link org.openqa.selenium.opera.OperaDriver}160 */161 OPERA("opera") {162 /**163 * Creates {@link Capabilities} with following properties:164 * <p>165 * <p>{@code web.driver.capability.platformName} to define name of a supported platform.166 * Windows, Linux etc. This is not the necessary property. @see org.openqa.selenium.Platform</p>167 * <p>{@code web.driver.capability.javascriptEnabled} to enable or to disable js. Possible values are168 * {@code true} or {@code false}. By default js is enabled. This is not the necessary property.</p>169 * <p>{@code web.driver.capability.browserVersion} to define a version of browser. This is not the necessary170 * property.</p>171 * <p>{@code remote.capability.suppliers} to define additional capabilities. It is a string with name of a172 * supplier.173 * @see CapabilitySupplier174 * @see AdditionalCapabilitiesFor </p>175 * </p>176 *177 * @return built {@link OperaOptions}178 */179 @Override180 public Capabilities get() {181 return new OperaOptions().merge(super.get());182 }183 },184 /**185 * Capabilities for the starting of {@link org.openqa.selenium.safari.SafariDriver}186 */187 SAFARI("safari") {188 /**189 * Creates {@link Capabilities} with following properties:190 * <p>191 * <p>{@code web.driver.capability.platformName} to define name of a supported platform.192 * Windows, Linux etc. This is not the necessary property. @see org.openqa.selenium.Platform</p>193 * <p>{@code web.driver.capability.javascriptEnabled} to enable or to disable js. Possible values are194 * {@code true} or {@code false}. By default js is enabled. This is not the necessary property.</p>195 * <p>{@code web.driver.capability.browserVersion} to define a version of browser. This is not the necessary196 * property.</p>197 * <p>{@code remote.capability.suppliers} to define additional capabilities. It is a string with name of a198 * supplier.199 * @see CapabilitySupplier200 * @see AdditionalCapabilitiesFor </p>201 * </p>202 *203 * @return built {@link SafariOptions}204 */205 @Override206 public Capabilities get() {207 return new SafariOptions().merge(super.get());208 }209 },210 /**211 * Creates {@link Capabilities} with following properties:212 * <p>213 * <p>{@code web.driver.capability.platformName} to define name of a supported platform.214 * Windows, Linux etc. This is not the necessary property. @see org.openqa.selenium.Platform</p>215 * <p>{@code web.driver.capability.javascriptEnabled} to enable or to disable js. Possible values are216 * {@code true} or {@code false}. By default js is enabled. This is not the necessary property.</p>217 * <p>{@code web.driver.capability.browserVersion} to define a version of browser. This is not the necessary218 * property.</p>219 * <p>{@code remote.capability.suppliers} to define additional capabilities. It is a string with name of a220 * supplier.221 * @see CapabilitySupplier222 * @see AdditionalCapabilitiesFor </p>223 * </p>224 *225 * @return built {@link Capabilities} for {@link org.openqa.selenium.phantomjs.PhantomJSDriver}226 */227 PHANTOM_JS("phantomJs") {228 @Override229 public Capabilities get() {...

Full Screen

Full Screen

Source:ChromeSet_ESTest_scaffolding.java Github

copy

Full Screen

1/**2 * Scaffolding file used to store all the setups needed to run 3 * tests automatically generated by EvoSuite4 * Thu Apr 04 03:05:30 GMT 20195 */6package com.test.selenium;7import org.evosuite.runtime.annotation.EvoSuiteClassExclude;8import org.junit.BeforeClass;9import org.junit.Before;10import org.junit.After;11import org.junit.AfterClass;12import org.evosuite.runtime.sandbox.Sandbox;13import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;14@EvoSuiteClassExclude15public class ChromeSet_ESTest_scaffolding {16 @org.junit.Rule 17 public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();18 private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); 19 private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);20 @BeforeClass 21 public static void initEvoSuiteFramework() { 22 org.evosuite.runtime.RuntimeSettings.className = "com.test.selenium.ChromeSet"; 23 org.evosuite.runtime.GuiSupport.initialize(); 24 org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; 25 org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; 26 org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; 27 org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; 28 org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); 29 org.evosuite.runtime.classhandling.JDKClassResetter.init();30 setSystemProperties();31 initializeClasses();32 org.evosuite.runtime.Runtime.getInstance().resetRuntime(); 33 } 34 @AfterClass 35 public static void clearEvoSuiteFramework(){ 36 Sandbox.resetDefaultSecurityManager(); 37 java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); 38 } 39 @Before 40 public void initTestCase(){ 41 threadStopper.storeCurrentThreads();42 threadStopper.startRecordingTime();43 org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); 44 org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); 45 setSystemProperties(); 46 org.evosuite.runtime.GuiSupport.setHeadless(); 47 org.evosuite.runtime.Runtime.getInstance().resetRuntime(); 48 org.evosuite.runtime.agent.InstrumentingAgent.activate(); 49 } 50 @After 51 public void doneWithTestCase(){ 52 threadStopper.killAndJoinClientThreads();53 org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); 54 org.evosuite.runtime.classhandling.JDKClassResetter.reset(); 55 resetClasses(); 56 org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); 57 org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); 58 org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); 59 } 60 public static void setSystemProperties() {61 62 java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); 63 java.lang.System.setProperty("file.encoding", "GBK"); 64 java.lang.System.setProperty("java.awt.headless", "true"); 65 java.lang.System.setProperty("user.country", "CN"); 66 java.lang.System.setProperty("user.language", "zh"); 67 java.lang.System.setProperty("user.timezone", "Asia/Shanghai"); 68 }69 private static void initializeClasses() {70 org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(ChromeSet_ESTest_scaffolding.class.getClassLoader() ,71 "org.openqa.selenium.Platform$10",72 "org.openqa.selenium.io.FileHandler$Filter",73 "org.openqa.selenium.Platform$11",74 "com.google.common.collect.Hashing",75 "org.openqa.selenium.remote.service.DriverService$Builder",76 "org.openqa.selenium.remote.CommandInfo",77 "org.openqa.selenium.net.EphemeralPortRangeDetector",78 "org.openqa.selenium.Platform$14",79 "com.google.common.collect.ImmutableList$SubList",80 "org.openqa.selenium.Platform$15",81 "org.openqa.selenium.html5.LocationContext",82 "org.openqa.selenium.Platform$12",83 "org.openqa.selenium.Platform$13",84 "com.google.common.collect.Lists$RandomAccessPartition",85 "com.google.common.collect.Collections2",86 "com.google.common.collect.PeekingIterator",87 "com.test.selenium.ChromeSet",88 "com.google.common.collect.ImmutableSet$Indexed",89 "org.openqa.selenium.os.OsProcess",90 "com.google.common.collect.RegularImmutableList",91 "org.openqa.selenium.chrome.ChromeOptions",92 "org.openqa.selenium.internal.FindsById",93 "org.openqa.selenium.net.FixedIANAPortRange",94 "com.google.common.collect.Lists$TransformingRandomAccessList",95 "org.openqa.selenium.Platform$16",96 "org.openqa.selenium.net.UrlChecker$TimeoutException",97 "com.google.common.collect.ImmutableCollection$ArrayBasedBuilder",98 "com.google.common.collect.Platform",99 "org.openqa.selenium.remote.http.HttpClient$Factory",100 "com.google.common.collect.ImmutableMapKeySet",101 "com.google.common.collect.RegularImmutableMap",102 "com.google.common.collect.RegularImmutableBiMap",103 "org.openqa.selenium.remote.DesiredCapabilities",104 "org.apache.http.conn.HttpClientConnectionManager",105 "com.google.common.collect.SortedMapDifference",106 "com.google.common.collect.RegularImmutableSet",107 "com.google.common.collect.AbstractMapEntry",108 "com.google.common.collect.ImmutableMap$IteratorBasedImmutableMap",109 "com.google.common.collect.Iterators$12",110 "com.google.common.collect.Iterators$11",111 "org.openqa.selenium.NoSuchSessionException",112 "org.openqa.selenium.chrome.ChromeDriverService$Builder",113 "org.openqa.selenium.internal.FindsByCssSelector",114 "org.openqa.selenium.internal.FindsByTagName",115 "org.openqa.selenium.logging.Logs",116 "org.apache.http.client.CredentialsProvider",117 "com.google.common.base.Joiner",118 "org.openqa.selenium.logging.profiler.ProfilerLogEntry",119 "org.openqa.selenium.SearchContext",120 "org.openqa.selenium.chrome.ChromeDriverService",121 "com.google.common.collect.ImmutableAsList",122 "com.google.common.collect.ImmutableMapEntrySet$RegularEntrySet",123 "org.openqa.selenium.WebDriver",124 "org.openqa.selenium.WebDriverException",125 "com.google.common.collect.ImmutableSet$Builder",126 "com.google.common.collect.RegularImmutableAsList",127 "com.google.common.collect.SingletonImmutableSet",128 "com.google.common.collect.Iterators$13",129 "com.google.common.collect.ImmutableMapEntrySet",130 "org.openqa.selenium.Platform$5",131 "org.openqa.selenium.Platform$6",132 "org.openqa.selenium.Platform$3",133 "com.google.common.collect.Lists$Partition",134 "org.openqa.selenium.TakesScreenshot",135 "org.openqa.selenium.Platform$4",136 "com.google.common.collect.Lists",137 "org.openqa.selenium.Platform$9",138 "org.apache.http.client.HttpClient",139 "org.openqa.selenium.Platform$7",140 "org.apache.http.auth.Credentials",141 "org.openqa.selenium.Platform$8",142 "com.google.common.collect.UnmodifiableListIterator",143 "org.openqa.selenium.os.ExecutableFinder",144 "org.openqa.selenium.Platform$1",145 "org.openqa.selenium.remote.FileDetector",146 "org.openqa.selenium.Platform$2",147 "com.google.common.collect.Lists$TransformingSequentialList",148 "org.openqa.selenium.net.PortProber",149 "org.openqa.selenium.WebDriver$Navigation",150 "com.google.common.collect.ObjectArrays",151 "com.google.common.collect.Maps$BiMapConverter",152 "com.google.common.collect.AbstractIterator",153 "org.openqa.selenium.Platform",154 "com.google.common.base.Joiner$MapJoiner",155 "org.openqa.selenium.remote.RemoteWebDriver",156 "com.google.common.collect.ImmutableList$1",157 "com.google.common.collect.MapDifference",158 "org.apache.http.client.RedirectStrategy",159 "com.google.common.collect.ImmutableMap$MapViewOfValuesAsSingletonSets",160 "org.openqa.selenium.remote.SessionNotFoundException",161 "com.google.common.collect.ImmutableMapEntry$NonTerminalImmutableMapEntry",162 "org.openqa.selenium.remote.CommandExecutor",163 "com.google.common.base.Preconditions",164 "com.google.common.collect.UnmodifiableIterator",165 "org.openqa.selenium.UnsupportedCommandException",166 "com.google.common.collect.ImmutableMapValues",167 "com.google.common.collect.ImmutableEntry",168 "org.openqa.selenium.chrome.ChromeDriver",169 "com.google.common.base.Joiner$1",170 "com.google.common.base.Joiner$2",171 "org.openqa.selenium.remote.service.DriverService",172 "com.google.common.collect.ImmutableCollection",173 "com.google.common.collect.ImmutableEnumMap",174 "org.openqa.selenium.logging.LoggingHandler",175 "com.google.common.collect.Lists$RandomAccessListWrapper",176 "org.openqa.selenium.interactions.Keyboard",177 "org.openqa.selenium.JavascriptExecutor",178 "com.google.common.collect.ImmutableList$ReverseImmutableList",179 "org.apache.http.conn.routing.HttpRoutePlanner",180 "org.openqa.selenium.remote.ExecuteMethod",181 "com.google.common.collect.SingletonImmutableList",182 "org.openqa.selenium.interactions.HasInputDevices",183 "com.google.common.collect.ImmutableCollection$Builder",184 "com.google.common.base.Converter",185 "com.google.common.collect.Iterators$6",186 "com.google.common.collect.BiMap",187 "com.google.common.collect.Iterators$7",188 "com.google.common.collect.Maps$6",189 "com.google.common.base.Function",190 "com.google.common.collect.ImmutableSet",191 "com.google.common.collect.Lists$AbstractListWrapper",192 "com.google.common.collect.ImmutableMap",193 "com.google.common.collect.ImmutableMapEntry",194 "com.google.common.collect.AbstractIndexedListIterator",195 "org.openqa.selenium.remote.HttpCommandExecutor",196 "org.openqa.selenium.Capabilities",197 "com.google.common.collect.CollectPreconditions",198 "org.openqa.selenium.interactions.Mouse",199 "com.google.common.collect.Iterators$1",200 "com.google.common.collect.Iterators$2",201 "com.google.common.collect.Iterators$3",202 "org.openqa.selenium.remote.internal.HttpClientFactory",203 "org.openqa.selenium.remote.internal.ApacheHttpClient$Factory",204 "org.openqa.selenium.internal.FindsByLinkText",205 "org.openqa.selenium.remote.http.HttpClient",206 "com.google.common.collect.Lists$StringAsImmutableList",207 "com.google.common.collect.Lists$2",208 "org.openqa.selenium.logging.NeedsLocalLogs",209 "com.google.common.collect.RegularImmutableBiMap$Inverse",210 "com.google.common.collect.ImmutableMap$1",211 "com.google.common.collect.ImmutableList$Builder",212 "com.google.common.collect.Lists$1",213 "org.apache.http.conn.SchemePortResolver",214 "org.openqa.selenium.logging.LogEntry",215 "org.openqa.selenium.remote.UnreachableBrowserException",216 "com.google.common.collect.Multiset",217 "org.openqa.selenium.internal.FindsByClassName",218 "org.openqa.selenium.chrome.ChromeDriverCommandExecutor",219 "com.google.common.collect.ImmutableMapEntry$NonTerminalImmutableBiMapEntry",220 "com.google.common.collect.Iterators",221 "com.google.common.collect.ImmutableBiMap",222 "com.google.common.collect.ImmutableList",223 "org.openqa.selenium.internal.FindsByName",224 "com.google.common.collect.SingletonImmutableBiMap",225 "org.openqa.selenium.NotFoundException",226 "org.openqa.selenium.HasCapabilities",227 "org.openqa.selenium.html5.WebStorage",228 "org.openqa.selenium.remote.service.DriverCommandExecutor",229 "org.openqa.selenium.WebDriver$Options",230 "org.openqa.selenium.io.FileHandler",231 "org.openqa.selenium.os.CommandLine",232 "org.openqa.selenium.internal.FindsByXPath",233 "com.google.common.collect.Maps",234 "org.openqa.selenium.logging.profiler.HttpProfilerLogEntry",235 "org.openqa.selenium.WebDriver$TargetLocator",236 "com.google.common.collect.Maps$EntryTransformer",237 "org.openqa.selenium.remote.http.HttpMethod",238 "com.google.common.collect.Iterators$MergingIterator"239 );240 } 241 private static void resetClasses() {242 org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(ChromeSet_ESTest_scaffolding.class.getClassLoader()); 243 org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(244 "org.openqa.selenium.remote.RemoteWebDriver",245 "org.openqa.selenium.chrome.ChromeDriverService",246 "com.google.common.collect.ImmutableMap",247 "com.google.common.collect.ImmutableBiMap",248 "com.google.common.collect.RegularImmutableBiMap",249 "org.openqa.selenium.Platform$1",250 "org.openqa.selenium.Platform$2",251 "org.openqa.selenium.Platform$3",252 "org.openqa.selenium.Platform$4",253 "org.openqa.selenium.Platform$5",254 "org.openqa.selenium.Platform$6",255 "org.openqa.selenium.Platform$7",256 "org.openqa.selenium.Platform$8",257 "org.openqa.selenium.Platform$9",258 "org.openqa.selenium.Platform$10",259 "org.openqa.selenium.Platform$11",260 "org.openqa.selenium.Platform$12",261 "org.openqa.selenium.Platform$13",262 "org.openqa.selenium.Platform$14",263 "org.openqa.selenium.Platform$15",264 "org.openqa.selenium.Platform$16",265 "org.openqa.selenium.Platform",266 "org.openqa.selenium.net.PortProber",267 "com.google.common.collect.ImmutableCollection",268 "com.google.common.collect.ImmutableSet",269 "com.google.common.collect.ObjectArrays",270 "com.google.common.collect.Hashing",271 "com.google.common.collect.RegularImmutableSet",272 "org.openqa.selenium.os.ExecutableFinder",273 "com.google.common.collect.ImmutableCollection$Builder",274 "com.google.common.collect.Iterators",275 "com.google.common.collect.ImmutableList",276 "com.google.common.collect.SingletonImmutableList",277 "org.openqa.selenium.chrome.ChromeOptions",278 "com.google.common.collect.Collections2",279 "com.google.common.collect.Maps",280 "org.openqa.selenium.remote.DesiredCapabilities",281 "org.openqa.selenium.remote.HttpCommandExecutor",282 "org.openqa.selenium.remote.http.HttpMethod",283 "com.google.common.collect.SingletonImmutableBiMap",284 "org.openqa.selenium.chrome.ChromeDriverCommandExecutor",285 "org.openqa.selenium.remote.internal.ApacheHttpClient$Factory",286 "org.openqa.selenium.remote.internal.HttpClientFactory"287 );288 }289}...

Full Screen

Full Screen

Source:BrowserType.java Github

copy

Full Screen

...72 options.addArguments("--allow-insecure-localhost=yes");73 options.addArguments("--ignore-urlfetcher-cert-requests=yes");74 options.addArguments("--disable-infobars");75 Map<String, Object> prefs = new HashMap<String, Object>();76 prefs.put("profile.default_content_setting_values.notifications", 2);77 prefs.put("credentials_enable_service", false);78 options.setExperimentalOption("prefs", prefs);79 options.addArguments("--test-type");80 chromeCapabilities.setCapability(ChromeOptions.CAPABILITY, options);81 chromeCapabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, false);82 chromeCapabilities.setCapability(UNEXPECTED_ALERT_BEHAVIOUR, false);83 chromeCapabilities.setCapability(CapabilityType.TAKES_SCREENSHOT, true);84 chromeCapabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);85 chromeCapabilities.setCapability("browserstack.debug", true);86 if (StringUtils.equals(ReadWriteJson.getValueFromConfigFile(Constants.LOCAL_EXECUTION), "true")) {87 System.setProperty(Constants.DRIVER_CHROME_PROPERTY,88 getDriverResourcePath(platform, Constants.DRIVER_PATH ,Constants.CHROME_DRIVER_NAME));89 return new ChromeDriver(options);90 } else {91 System.setProperty(92 Constants.DRIVER_CHROME_PROPERTY,93 getDriverResourcePath(platform, Constants.DRIVER_PATH ,Constants.CHROME_DRIVER_NAME));94 return new RemoteWebDriver(95 new URL(ReadWriteJson.getValueFromConfigFile(Constants.HUB_URL)),96 chromeCapabilities);97 //launchGridPlatform();98 }99 }100 };101 102 private static final Map<String, BrowserType> BROWSER_TYPE_MAP = Arrays.stream(BrowserType.values())103 .collect(Collectors.toMap(BrowserType::getKey, e -> e));104 private String key;105 public String getKey() {106 return this.key;107 }108 BrowserType(final String key) {109 this.key = key;110 }111 public static Optional<BrowserType> instanceByKey(String key) {112 return Optional.of(BROWSER_TYPE_MAP.get(key));113 }114 /**115 * The method is used for build the web driver for each browser type116 * @return...

Full Screen

Full Screen

Source:WebDriverFactory.java Github

copy

Full Screen

...27 return Drivers.valueOf(webDriverProperty.toUpperCase()).newDriver();28 } catch (IllegalArgumentException e) {29 String msg = format("The webdriver system property '%s' did not match any " +30 "existing browser or the browser was not supported on your operating system. " +31 "Valid values are %s",32 webDriverProperty, stream(Drivers33 .values())34 .map(Enum::name)35 .map(String::toLowerCase)36 .collect(toList()));37 throw new IllegalStateException(msg, e);38 }39 }40 private enum Drivers {41 FIREFOX {42 @Override43 public WebDriver newDriver() {44 DesiredCapabilities capabilities = DesiredCapabilities.firefox();45 return new FirefoxDriver(capabilities);46 }47 }, CHROME {...

Full Screen

Full Screen

Source:BrowserManagerEnum.java Github

copy

Full Screen

...36 this.browserName = browserName;37 }38 public static BrowserManagerEnum of( final String browserName ) {39 final String lBrowserName = StringUtils.lowerCase( browserName );40 for( final BrowserManagerEnum browser : BrowserManagerEnum.values() ) {41 if( browser.browserName.equals( lBrowserName ) ) {42 return browser;43 }44 }45 return NONE;46 }47 public BrowserManager getBrowserManager() {48 switch( this ) {49 case CHROME: return ChromeDriverManager.getInstance().version( "2.24" );50 case MARIONETTE:51 case FIREFOX: return FirefoxDriverManager.getInstance();52 case EDGE: return EdgeDriverManager.getInstance();53 case IE: return InternetExplorerDriverManager.getInstance();54 case OPERA: return OperaDriverManager.getInstance();...

Full Screen

Full Screen

Source:DriverFactory.java Github

copy

Full Screen

...45 }46 public static BrowserType getBrowserTypeByProperty(){47 BrowserType type = null;48 String browsername = (StringUtils.isNotEmpty(System.getenv("BROWSER"))) ? System.getenv("BROWSER") : PropertyManager.getProperty("BROWSER");49 for(BrowserType bType : BrowserType.values()){50 if(bType.getBrowserName().equalsIgnoreCase(browsername)){51 type = bType;52 System.out.println("BROWSER = " + type.getBrowserName());53 }54 }55 return type;56 }57}...

Full Screen

Full Screen

values

Using AI Code Generation

copy

Full Screen

1System.out.println(Platform.MAC);2System.out.println(Platform.WINDOWS);3System.out.println(Platform.LINUX);4System.out.println(Platform.ANY);5System.out.println(Platform.getCurrent());6System.out.println(Platform.extractFromSysProperty("platform"));7System.out.println(Platform.extractFromSysProperty("os.name"));8System.out.println(Platform.extractFromSysProperty("os.arch"));9System.out.println(BrowserType.CHROME);10System.out.println(BrowserType.FIREFOX);11System.out.println(BrowserType.IE);12System.out.println(BrowserType.IEXPLORE);13System.out.println(BrowserType.EDGE);14System.out.println(BrowserType.SAFARI);15System.out.println(BrowserType.HTMLUNIT);16System.out.println(BrowserType.HTMLUNITWITHJS);17System.out.println(BrowserType.OPERA_BLINK);18System.out.println(BrowserType.OPERA);19System.out.println(BrowserType.ANDROID);20System.out.println(BrowserType.IPAD);21System.out.println(BrowserType.IPHONE);22System.out.println(BrowserType.PHANTOMJS);23System.out.println(BrowserType.GOOGLECHROME);24System.out.println(BrowserType.PHANTOMJS);25System.out.println(BrowserType.SAFARI);26System.out.println(BrowserType.IE_HTA);27System.out.println(BrowserType.IE_PROXY);28System.out.println(BrowserType.IE_EMBEDDED);29System.out.println(BrowserType.IE_NO_PROXY);30System.out.println(BrowserType.IE_HTA);31System.out.println(BrowserType.IE_PROXY);32System.out.println(BrowserType.IE_EMBEDDED);33System.out.println(BrowserType.IE_NO_PROXY);34System.out.println(BrowserType.IE_HTA);35System.out.println(BrowserType.IE_PROXY);36System.out.println(BrowserType.IE_EMBEDDED);37System.out.println(BrowserType.IE_NO_PROXY);38System.out.println(BrowserType.IE_HTA);39System.out.println(BrowserType.IE_PROXY);40System.out.println(BrowserType.IE_EMBEDDED);41System.out.println(BrowserType.IE_NO_PROXY);42System.out.println(BrowserType.IE_HTA);43System.out.println(BrowserType.IE_PROXY);44System.out.println(BrowserType.IE_EMBEDDED);45System.out.println(BrowserType.IE_NO_PROXY);46System.out.println(BrowserType.IE_HTA);

Full Screen

Full Screen

values

Using AI Code Generation

copy

Full Screen

1import org.openqa.selenium.Platform;2Platform platform = Platform.getCurrent();3System.out.println("Platform Name: " + platform.name());4System.out.println("Platform Value: " + platform.getValue());5System.out.println("Platform Values: " + Arrays.toString(platform.getValues()));6System.out.println("Platform Version: " + platform.getVersion());7import org.openqa.selenium.Platform;8Platform platform = Platform.getCurrent();9System.out.println("Platform Name: " + platform.name());10import org.openqa.selenium.Platform;11Platform platform = Platform.getCurrent();12System.out.println("Platform Version: " + platform.getVersion());13import org.openqa.selenium.Platform;14Platform platform = Platform.getCurrent();15System.out.println("Platform Value: " + platform.getValue());16import org.openqa.selenium.Platform;17Platform platform = Platform.getCurrent();18System.out.println("Platform Values: " + Arrays.toString(platform.getValues()));

Full Screen

Full Screen

values

Using AI Code Generation

copy

Full Screen

1for (Platform platform : Platform.values()) {2 System.out.println(platform);3}4System.out.println(Platform.valueOf("ANDROID"));5System.out.println(Platform.ANDROID.getName());6System.out.println(Platform.ANDROID.is(Platform.ANDROID));7System.out.println(Platform.ANDROID.is(Platform.MAC));8System.out.println(Platform.ANDROID.toString());9System.out.println(Platform.fromString("ANDROID"));10System.out.println(Platform.ANDROID.getActualPlatform());11System.out.println(Platform.ANDROID.getMajorVersion());

Full Screen

Full Screen

values

Using AI Code Generation

copy

Full Screen

1import org.openqa.selenium.WebDriver;2import org.openqa.selenium.chrome.ChromeDriver;3import org.openqa.selenium.remote.CapabilityType;4import org.openqa.selenium.remote.DesiredCapabilities;5import org.openqa.selenium.remote.RemoteWebDriver;6import org.openqa.selenium.Platform;7import java.net.URL;8import java.net.MalformedURLException;9public class PlatformTest {10 public static void main(String[] args) throws MalformedURLException {11 System.setProperty("webdriver.chrome.driver", "C:\\chromedriver.exe");12 WebDriver driver = new ChromeDriver();13 driver.get(url);14 String title = driver.getTitle();15 int titleLength = driver.getTitle().length();16 System.out.println("Title of the page is : " + title);17 System.out.println("Length of the title is : " + titleLength);18 String actualUrl = driver.getCurrentUrl();19 if (actualUrl.equals(url)) {20 System.out.println("Verification Successful - The correct Url is opened.");21 } else {22 System.out.println("Verification Failed - An incorrect Url is opened.");23 System.out.println("Actual URL is : " + actualUrl);24 System.out.println("Expected URL is : " + url);25 }26 String pageSource = driver.getPageSource();27 int pageSourceLength = pageSource.length();

Full Screen

Full Screen

values

Using AI Code Generation

copy

Full Screen

1import org.openqa.selenium.Platform;2import java.util.Arrays;3import java.util.List;4import java.util.stream.Collectors;5public class GetPlatformNameAndPosition {6 public static void main(String[] args) {7 List<Platform> platforms = Arrays.asList(Platform.values());8 System.out.println("platforms = " + platforms);9 System.out.println("platforms.size() = " + platforms.size());10 System.out.println("platforms.get(0).name() = " + platforms.get(0).name());11 System.out.println("platforms.get(0).ordinal() = " + platforms.get(0).ordinal());12 System.out.println("platforms.get(2).name() = " + platforms.get(2).name());13 System.out.println("platforms.get(2).ordinal() = " + platforms.get(2).ordinal());14 System.out.println("platforms.get(3).name() = " + platforms.get(3).name());15 System.out.println("platforms.get(3).ordinal() = " + platforms.get(3).ordinal());16 System.out.println("platforms.get(4).name() = " + platforms.get(4).name());17 System.out.println("platforms.get(4).ordinal() = " + platforms.get(4).ordinal());18 System.out.println("platforms.get(5).name() = " + platforms.get(5).name());19 System.out.println("platforms.get(5).ordinal() = " + platforms.get(5).ordinal());20 System.out.println("platforms.get(6).name() = " + platforms.get(6).name());21 System.out.println("platforms.get(6).ordinal() = " + platforms.get(6).ordinal());22 System.out.println("platforms.get(7).name() = " + platforms.get(7).name());23 System.out.println("platforms.get(7).ordinal() = " + platforms.get(7).ordinal());24 System.out.println("platforms.get(8).name() = " + platforms.get(8).name());25 System.out.println("platforms.get(8).ordinal() = " + platforms.get(8).ordinal());

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.

Run Selenium automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful