Hey folks,
plz help me its urgent.
I have one text “*Premium quality data is based on physicians assessed by the UnitedHealth Premium program. For more information on the premium program,click here "
How can I click on link"click here” inside TextView?
the problem is I am using by content description and it is same for all the content on the page there are four content on the page with same content description. I used this code but its not working…
WebElement element = driver.findElement(getElement(“AboutDoctorondemandPage.Content.Label”));
Point point = element.getLocation();
int x = point.x +1;
int y = point.y + element.getSize().getHeight() - 1;
new TouchAction(driver).tap(x, y).perform();
these details is for whole text "Premium quality data is based on physicians assessed by the UnitedHealth Premium program. For more information on the premium program,click here ".
hey that’s work but I have one thing to discuss see we will put coordinate but that coordinate differ device to device…so it will work on particular device through which we will take the coordinate but not with others…
Actually that approach should be the last solution you should apply during finding out the better one. The reason is very clear as you mentioned. We have many devices with different screen size, even if on same device with Portrait/landscape.
if you have less device, you can control that by using switch (String UDID) case: return the location for those elements.
If you have a lot of devices, that should be nightmare!
So, as I mentioned, you need to find another better approach (if you can).
yeah sure,there are navigation bars in the bottom of screen
1.click on search
2.click on virtual visit
3.click on doctor on demand
4.there are two click here …try the one with second click here
The last one what I could find out in the worse case.
Create a Method name: tapAround with the logic as below:
// This is the original code
String originalContext = appiumDriver.getContext();
Point coordinate = element.getLocation();
Dimension dms = element.getSize();
int centerX = dms.getWidth() / 2 + coordinate.getX();
int centerY = dms.getHeight() / 2 + coordinate.getY();
appiumDriver.context(“NATIVE_APP”);
appiumDriver.tap(1, centerX, centerY, 200);
appiumDriver.context(originalContext);
//You need to implement it to touch around X, Y with shift-amount
// The signal to make it successfully should be something on the screen after click on the link
The ideal mean you will click around till successfully.
Base on that, you can use it on any devices.