I am working in Windows application automation. I am using winapp driver tool.
I want to run every machine to this respective code without make any changes .
here in this line capabilities.setCapability("app", "C:\Users\Pooja\AppData\Local\Apps\2.0\HONMQK9H.9MB\MQ0TMZNT.MGW\data..tion_6e5be371fe594b2d_0006.0001_842b5c92335cdaae"); This is application location path. My application is loading from this location. here this is my username as Pooja. But every machine have different different user. so How to better way to do this ,so I can put my code into bitbucket, then every person in my company can use my code, without make any changes

Here is mycode :

public class BaseBallTest {

    private static WindowsDriver<WindowsElement> driver;

    public static void main(String args[]) throws MalformedURLException, InterruptedException {

        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("app", "C:\Users\Pooja\AppData\Local\Apps\2.0\HONMQK9H.9MB\MQ0TMZNT.MGW\data..tion_6e5be371fe594b2d_0006.0001_842b5c92335cdaae");
        WindowsDriver Session = new WindowsDriver(new URL("http://127.0.0.1:4723"), capabilities);

        Assert.assertNotNull(Session);
        Session.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);

        Session.findElementByName("OK").click();


        DesiredCapabilities Appcapabilities = new DesiredCapabilities();
        Appcapabilities.setCapability("app", "Root");
        WindowsDriver AppSession = new WindowsDriver(new URL("http://127.0.0.1:4723"), Appcapabilities);
        Thread.sleep(5000);

        WebDriverWait wait=new WebDriverWait(AppSession, 30);
        AppSession.findElementByAccessibilityId("Txtusername").sendKeys("r_abhis");
        AppSession.findElementByAccessibilityId("TxtPassword").sendKeys("abhishek");
        AppSession.findElementByAccessibilityId("btnLogin").click();
    }



}



Source link https://sqa.stackexchange.com/questions/34757/what-is-the-better-way-to--the-

LEAVE A REPLY

Please enter your comment!
Please enter your name here