Mobile testing
Hi team,
1) I am doing mobile web testing using emulators. It is opening as a "smartbear test extension" started debugging this browser. Here i need to set a resolution based on the mobile we are selecting. So, i need to set a resolution over there.
>>refer the below code,
function main(){
VirtualBrowsers.Item("iPad").Run();
var mblPage=VirtualBrowsers.CurrentBrowser.Navigate("https://www.smartbear.com/");
var element=mblPage.FindElement("xpath");
element.click();
}
>>Here need to set resolution over there as width (768) and height (1024)
2) I tried to click over an element in that page but it throws error as TypeError: cannot read property "FindElement" of undefined
Could any one helpme regarding this issue??
In your code that you have written
var mblPage=VirtualBrowsers.CurrentBrowser.Navigate("https://www.smartbear.com/");
the Navigate Method returns none, and not a Page object.
and,
var page=VirtualBrowsers.Item("iPad").Run("https://www.smartbear.com/");
the Run Method returns a Process object if found, and not a Page object.
Make sure you fully understand the above methods and their return objects. In my previous response, did you see the code example in Page Object? It's vital you learn the basics, knowing how to select an object on a page, before jumping ahead and wanting to use VirtualBrowser