I want to generate detailed report of failed fields in Selenium webdriver. I want to highlight the field which failed during automation.Please send me the code for that.
javascript is the only way for that. change css attribute of that element. write javascript snippet and run it (JavaScriptExecutor) class. This should highlight the element and then u can take the screen shot.
enter link description here
Related
I am automating a native android application using appium and java. I could find locators of each element. Please refer below screen shots for your reference. Its not working as expected and getting me time out exception i.e. failed to find element where you can see, I have given correct id.
For time being, I am using touchaction with x,y co-ordinates which is not correct solution. please help me to solve it.
Code snippet:
For example :
Exception Screen shot:
Try invoking driver.getPageSource() method and double check that the desired element is present in the XML page representation.
Going forward you can set printPageSourceOnFindFailure to true so Appium would print the source code of the page to the STDOUT on element find failure like:
caps.setCapability("printPageSourceOnFindFailure", true);
More information:
Appium Desired Capabilities
Appium Studio for Eclipse - Capabilities Manager
I just started mobile automation using selenium and appium. I need to create a object which directly enter the value in textbox. Currently first it is launching the app then I am able to reach on the perticular textbox . I do not want to launch the app again and again I just want to enter the information in textbox,dropdown etc.. Please help me to write the program...
You can get textbox by id using uiautomatorviewer if it's android or by xpath if it's on webbrowser, then you can use
driver.findElement(By.id("id here as string of textbox")).sendKeys("what you want to send");
at the end you can confirm by clicking accept or something using
driver.findElement(By.id("id of accept button")).click();
keep in mind that if you use id you must use By.id, xpath then By.xpath and so on.
I want to add google ads code in a content type but when I try to do this editor remove ins tags from ads. I am using ck-Editor in Drupal 7.x
Thanks
I haven't check adding Google Ads code in CK-editor but if "tags got removed" is only your problem you can fix this by following the below instructions.
1. Navigate to admin->configurations->Text Formats.
2. Select a format FilterHTML/FullHTML for change its configurations.
3. On the edit form you will be able to insert tags which you want to allow by CK-editor from you editors source code.
This will appear by default, but if not for you please select the check box options "Limit allowed HTML tags" above in the form. Now clear you cache and check. It might resolve your issue.
Is there a way to make the value in #Stories annotation to be a hyperlink? So that user can click on it and open a page.
The value in the #Story now cannot be used as link.
Now you just can provide property for testcase and it can be link. We have an example of this approach on our teamcity (click "login as guest" to get in). There you can see the url of the tested page above the steps block. It is clickable and leads to tested page.
If these way is not suitable for you, please report an issue and give more infromation about your use-cases of this feature
I learning automation of application with selenium ide.The application which I am currently testing is a extjs application.In this application all the required validations are shown in the tooltip.For ex: I have password form in which new password and confirm password are the two fields and there is a submit button.If the password entered in the new and confirm password field do not match then "Password do not match" message is shown in the tooltip and the submit button is disabled.In this case how to verify the tooltip and its contents in the selenium.
Plz can anyone suggest some solution to the above problem?All validation in my application are shown in the tooltip.
thanks,
sushi
First, make sure that you explicitly assign ids to your fields. Otherwise, it will be very hard to get a hold of the components with the automatically generated ids (like "ext-comp-004").
The strategy is to use the verifyEval Selenium command and use the Ext JS API to do certain things.
For checking the active error message of a field with id "password_confirm", you can use:
Ext.getCmp("password_confirm").getActiveError();
First, try this in the Firebug console manually to make sure it works for you. Then you can do the same in your Selenium script as:
Command: verifyEval
Script: Ext.getCmp("password_confirm").getActiveError()
Expected: Passwords do not match
If you want to test this out with Selenium IDE in Firefox first, you should take into account that the window object will be wrapped in a XPCNativeWrapper. You can access the actual window object and the Ext JS namespace in it through wrappedJSObject:
Command: verifyEval
Script: window.wrappedJSObject.Ext.getCmp("password_confirm").getActiveError()
Expected: Passwords do not match
For some general tips on testing Ext JS applications with Selenium, see this answer. Some parts of it may be outdated, but can still give you an idea about the general strategies involved.