Posts

Webdriver | Implicit wait vs Explicit wait vs Fluentwait

Image
Implicit Wait: An implicit wait is to tell WebDriver to poll the DOM for a certain amount of time when trying to find an element or elements if they are not immediately available. The default setting is 0. Once set, the implicit wait is set for the life of the WebDriver object instance. WebDriver driver = new FirefoxDriver (); driver . manage (). timeouts (). implicitlyWait ( 10 , TimeUnit . SECONDS ); driver . get ( "http://somedomain/url_that_delays_loading" ); WebElement myDynamicElement = driver . findElement ( By . id ( "myDynamicElement" )); When to use : Not recommended Explicit wait: An explicit waits is code you define to wait for a certain condition to occur before proceeding further in the code. WebDriverWait by default calls the ExpectedCondition every 500 milliseconds until it returns successfully. WebDriver driver = new FirefoxDriver (); driver . get ( "http://somedomain/url_that_delays_loading" ); WebElement myDyn...

Common Issues While Creating Performance Scripts

Common Issues While Creating Performance Scripts When you start load testing a web site (especially if this is the first load test in your life) you may see a lot of errors in the report. Possibly you will even have to stop the test before it completes, because at some point in time it becomes clear that something goes wrong. If the problem is not so obvious, it is still recommended to check the report for the errors related to each virtual user profile (i.e. to each different type of virtual users) before looking at any performance data. Issue 1:   Most probably the errors appear because you have not parameterized the HTTP requests in your profile. Note that initially all requests are recorded as is. If user use a recorded profile without any modifications. Performance tool will simply repeat all the same requests with the same values of all parameters. However some values should be unique for each session. You can check the “Logs” folder for errors and find the first ...

How to use ADB (Android Debug Bridge) over WiFi | Android automation

Image
Whenever we work with Android mobile app automation we have to connect the device using USB cable. We can connect the device over Wi-Fi. To get rid of from the USB there is a super simple way! All you need is a USB cable (for the initial setup) and have both devices in the same network. This will work for non-rooted devices also. Precondition:  Your system and device must be in the same network. Android mobile must have developer option set to true. ADB (Android debug bridge) must be configure Android SDK installed. Step 1. Attach mobile via USB Step 2. Open then command terminal type  adb devices  and press enter It will confirm that your device is connected and able to recognize by android sdk. Step 3:   type: adb tcpip 5555 Step 4:To find the mobile ip type: adb shell ip - f inet addr show wlan0 Step 5: The ip address will be shown in second line like this: inet 192.168 . 1.233 / 24 brd 192.168 . 1.255 scope gl...

How to know app package and activities information without having apk | android app | Appium

Image
How to know app package and activities information without having apk | android app | Appium In Android app mobile automation,we need apk file of app but sometimes we have to perform action on inbuild app(pre installed) which come with device like call,sms etc.. for this we do not have apk file. Basically in android app automation we need app package information  and app activities. In case of apk it is easy to get above information with appium. But if we do not have apk and need the app package/activities information, we can use following command: Precondition:  1. Android mobile must have developer option set to true. 2. ADB (Android debug bridge) must be configure 3. Android SDK installed. Step1. Open then command terminal type adb devices  and press enter It will confirm that your device is connected and able to recognize by android sdk. Step2: Now in mobile, open the app of which you want to get app pkg info/activities. In your m...

WebDriver compare data/css between two pages

Hi All, In Web based project like implemented in CQ5 where we have to check same site for different country. For this we have to rollout/replicate some/all pages for different countries OR I can say downloaded/uploaded the production data in testing environment or vice versa. After this we have to validate page static data (like text) with production site Data, page wise validation. E.g.  One page of US site and replicate the same page for another country then verify page content or css For this we have to check manually, we can automate the same. I assume both pages having same text content (English). Logic to implement this: • First we have to analyze page objects properties (what are the common page objects (elements) properties are being used) like class, id, type etc and create array of this. • Then we have to get all elements from the base page(expected) using xpath(//*) • For each element get all properties and value using java script and store only those element...

Difference between action.build().perform() and action.perform()

In Webdriver, handling keyboard events and mouse events (including actions such as Drag and Drop or clicking multiple elements With Control key) are done using the advanced user interactions API . It contains Actions and Action classes which are needed when performing these events. In order to perform action events, we need to use org.openqa.selenium.interactions.Actions class. The build() method is used compile all the listed actions into a single step. we have to use build() when we are performing sequence of operations and no need to use only if we are performing single action. example where build() required Actions builder = new Actions(driver); builder.clickAndHold((WebElement)listItems.get(0)) .clickAndHold((WebElement)listItems.get(3)) .click() .build() .perform(); in the above code we are performing more than one operations so we have to use build() to compile all the actions into a single step example where build is not required WebElement draggable = driver.find...

What qualities should have in your automation framework

The following are some qualities should have in your automation framework. Maintainability  Portability  Flexibility  Robustness  Scalability  Reliability  Usability  Performance